mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 10:53:50 +02:00
Remove createInputFrom, changed meaning of PathedSource, add CustomPathedSource
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { ALL_FORMATS, createInputFrom } from 'mediabunny';
|
||||
import { ALL_FORMATS, BlobSource, Input, UrlSource } from 'mediabunny';
|
||||
|
||||
import SampleFileUrl from '../../docs/assets/big-buck-bunny-trimmed.mp4';
|
||||
(document.querySelector('#sample-file-download') as HTMLAnchorElement).href = SampleFileUrl;
|
||||
@@ -12,7 +12,12 @@ const metadataContainer = document.querySelector('#metadata-container') as HTMLD
|
||||
|
||||
const extractMetadata = (resource: File | string) => {
|
||||
// Create a new input from the resource
|
||||
const input = createInputFrom(resource, ALL_FORMATS); // Accept all formats
|
||||
const input = new Input({
|
||||
source: typeof resource === 'string'
|
||||
? new UrlSource(resource)
|
||||
: new BlobSource(resource),
|
||||
formats: ALL_FORMATS, // Accept all formats
|
||||
});
|
||||
|
||||
let bytesRead = 0;
|
||||
let fileSize: number | null = null;
|
||||
|
||||
Reference in New Issue
Block a user