mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-28 19:33:51 +02:00
Use WritableStream for StreamTarget & integrate backpressure concepts
This commit is contained in:
+25
-6
@@ -9,11 +9,17 @@ export abstract class OutputFormat {
|
||||
abstract _createMuxer(output: Output): Muxer;
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export type Mp4OutputFormatOptions = {
|
||||
fastStart?: false | 'in-memory' | 'fragmented'
|
||||
};
|
||||
|
||||
/** @public */
|
||||
export class Mp4OutputFormat extends OutputFormat {
|
||||
constructor(public options: {
|
||||
fastStart?: false | 'in-memory' | 'fragmented',
|
||||
} = {}) {
|
||||
/** @internal */
|
||||
_options: Mp4OutputFormatOptions;
|
||||
|
||||
constructor(options: Mp4OutputFormatOptions = {}) {
|
||||
if (!options || typeof options !== 'object') {
|
||||
throw new TypeError('options must be an object.');
|
||||
}
|
||||
@@ -22,6 +28,8 @@ export class Mp4OutputFormat extends OutputFormat {
|
||||
}
|
||||
|
||||
super();
|
||||
|
||||
this._options = options;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
@@ -30,11 +38,17 @@ export class Mp4OutputFormat extends OutputFormat {
|
||||
}
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export type MkvOutputFormatOptions = {
|
||||
streamable?: boolean
|
||||
};
|
||||
|
||||
/** @public */
|
||||
export class MkvOutputFormat extends OutputFormat {
|
||||
constructor(public options: {
|
||||
streamable?: boolean
|
||||
} = {}) {
|
||||
/** @internal */
|
||||
_options: MkvOutputFormatOptions;
|
||||
|
||||
constructor(options: MkvOutputFormatOptions = {}) {
|
||||
if (!options || typeof options !== 'object') {
|
||||
throw new TypeError('options must be an object.');
|
||||
}
|
||||
@@ -43,6 +57,8 @@ export class MkvOutputFormat extends OutputFormat {
|
||||
}
|
||||
|
||||
super();
|
||||
|
||||
this._options = options;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
@@ -51,5 +67,8 @@ export class MkvOutputFormat extends OutputFormat {
|
||||
}
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export type WebMOutputFormatOptions = MkvOutputFormatOptions;
|
||||
|
||||
/** @public */
|
||||
export class WebMOutputFormat extends MkvOutputFormat {}
|
||||
Reference in New Issue
Block a user