mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-28 19:33:51 +02:00
Update docs a bunch, fix some typos
This commit is contained in:
+11
-3
@@ -693,8 +693,8 @@ export type CreateInputFromOptions =
|
||||
* function automatically chooses the correct underlying {@link Source} based on the type of the data passed in.
|
||||
*
|
||||
* Legal data types are `ArrayBuffer`, `SharedArrayBuffer`, `ArrayBufferView`, `Blob` (and, by extension, `File`),
|
||||
* `ReadableStream<Uint8Array>`, `string` (representing either a URL or a local file path), `URL`, and `Request`. Local
|
||||
* file paths require a Node-like server-side environment with access to the file system.
|
||||
* `ReadableStream<Uint8Array>`, `string` (representing either a URL or a local file path), `URL`, `Request`, `Source`
|
||||
* and `PathedSource`. Local file paths require a Node-like server-side environment with access to the file system.
|
||||
*
|
||||
* The available options are the union of the options for each {@link Source}. Check the sources to see which field
|
||||
* applies to which source.
|
||||
@@ -706,7 +706,7 @@ export type CreateInputFromOptions =
|
||||
* @public
|
||||
*/
|
||||
export const createInputFrom = (
|
||||
data: AllowSharedBufferSource | Blob | ReadableStream<Uint8Array> | string | URL | Request,
|
||||
data: AllowSharedBufferSource | Blob | ReadableStream<Uint8Array> | string | URL | Request | Source | PathedSource,
|
||||
formats: InputFormat[],
|
||||
options: CreateInputFromOptions = {},
|
||||
): Input => {
|
||||
@@ -719,6 +719,14 @@ export const createInputFrom = (
|
||||
|
||||
const { initInput, ...sourceOptions } = options;
|
||||
|
||||
if (data instanceof Source || data instanceof PathedSource) {
|
||||
return new Input({
|
||||
formats,
|
||||
source: data,
|
||||
initInput,
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
data instanceof ArrayBuffer
|
||||
|| (typeof SharedArrayBuffer !== 'undefined' && data instanceof SharedArrayBuffer)
|
||||
|
||||
Reference in New Issue
Block a user