mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 02:43:48 +02:00
Remove createInputFrom, changed meaning of PathedSource, add CustomPathedSource
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import {
|
||||
ALL_FORMATS,
|
||||
AudioBufferSink,
|
||||
BlobSource,
|
||||
CanvasSink,
|
||||
createInputFrom,
|
||||
Input,
|
||||
UrlSource,
|
||||
WrappedAudioBuffer,
|
||||
WrappedCanvas,
|
||||
} from 'mediabunny';
|
||||
@@ -96,7 +98,12 @@ const initMediaPlayer = async (resource: File | string) => {
|
||||
clearTimeout(liveRefreshIntervalId);
|
||||
|
||||
// Create an Input from the resource
|
||||
const input = createInputFrom(resource, ALL_FORMATS);
|
||||
const input = new Input({
|
||||
source: typeof resource === 'string'
|
||||
? new UrlSource(resource)
|
||||
: new BlobSource(resource),
|
||||
formats: ALL_FORMATS, // Accept all formats
|
||||
});
|
||||
|
||||
let videoTrack = await input.getPrimaryVideoTrack();
|
||||
let audioTrack = await input.getPrimaryAudioTrack();
|
||||
|
||||
Reference in New Issue
Block a user