mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-03 13:53:53 +02:00
Clarify docs
This commit is contained in:
@@ -123,6 +123,8 @@ output.setMetadataTags({
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you add metadata tags, you must call this method *before* starting the `Output`.
|
||||||
|
|
||||||
For more info on which tags you can write, see [`MetadataTags`](../api/MetadataTags).
|
For more info on which tags you can write, see [`MetadataTags`](../api/MetadataTags).
|
||||||
|
|
||||||
## Starting an output
|
## Starting an output
|
||||||
|
|||||||
+4
-4
@@ -197,7 +197,7 @@ export class Output<
|
|||||||
this._muxer = options.format._createMuxer(this);
|
this._muxer = options.format._createMuxer(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Adds a video track to the output with the given source. Must be called before output is started. */
|
/** Adds a video track to the output with the given source. Can only be called before the output is started. */
|
||||||
addVideoTrack(source: VideoSource, metadata: VideoTrackMetadata = {}) {
|
addVideoTrack(source: VideoSource, metadata: VideoTrackMetadata = {}) {
|
||||||
if (!(source instanceof VideoSource)) {
|
if (!(source instanceof VideoSource)) {
|
||||||
throw new TypeError('source must be a VideoSource.');
|
throw new TypeError('source must be a VideoSource.');
|
||||||
@@ -221,7 +221,7 @@ export class Output<
|
|||||||
this._addTrack('video', source, metadata);
|
this._addTrack('video', source, metadata);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Adds an audio track to the output with the given source. Must be called before output is started. */
|
/** Adds an audio track to the output with the given source. Can only be called before the output is started. */
|
||||||
addAudioTrack(source: AudioSource, metadata: AudioTrackMetadata = {}) {
|
addAudioTrack(source: AudioSource, metadata: AudioTrackMetadata = {}) {
|
||||||
if (!(source instanceof AudioSource)) {
|
if (!(source instanceof AudioSource)) {
|
||||||
throw new TypeError('source must be an AudioSource.');
|
throw new TypeError('source must be an AudioSource.');
|
||||||
@@ -231,7 +231,7 @@ export class Output<
|
|||||||
this._addTrack('audio', source, metadata);
|
this._addTrack('audio', source, metadata);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Adds a subtitle track to the output with the given source. Must be called before output is started. */
|
/** Adds a subtitle track to the output with the given source. Can only be called before the output is started. */
|
||||||
addSubtitleTrack(source: SubtitleSource, metadata: SubtitleTrackMetadata = {}) {
|
addSubtitleTrack(source: SubtitleSource, metadata: SubtitleTrackMetadata = {}) {
|
||||||
if (!(source instanceof SubtitleSource)) {
|
if (!(source instanceof SubtitleSource)) {
|
||||||
throw new TypeError('source must be a SubtitleSource.');
|
throw new TypeError('source must be a SubtitleSource.');
|
||||||
@@ -245,7 +245,7 @@ export class Output<
|
|||||||
* Sets descriptive metadata tags about the media file, such as title, author, date, or cover art. When called
|
* Sets descriptive metadata tags about the media file, such as title, author, date, or cover art. When called
|
||||||
* multiple times, only the metadata from the last call will be used.
|
* multiple times, only the metadata from the last call will be used.
|
||||||
*
|
*
|
||||||
* Must be called before output is started.
|
* Can only be called before the output is started.
|
||||||
*/
|
*/
|
||||||
setMetadataTags(tags: MetadataTags) {
|
setMetadataTags(tags: MetadataTags) {
|
||||||
validateMetadataTags(tags);
|
validateMetadataTags(tags);
|
||||||
|
|||||||
Reference in New Issue
Block a user