mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-28 03:13:51 +02:00
Fix SourceRef race conditions, fix "source" and "target" getter returning unused instances, add missing validation, make "getDurationFromMetadata" only exist on tracks, fix examples, expand media player to support live playback, change the signatures of some Input APIs
This commit is contained in:
@@ -328,13 +328,6 @@ export class WaveDemuxer extends Demuxer {
|
||||
return null;
|
||||
}
|
||||
|
||||
async getDurationFromMetadata(): Promise<number | null> {
|
||||
await this.readMetadata();
|
||||
assert(this.dataSize !== -1);
|
||||
|
||||
return this.dataSize / this.audioInfo!.blockSizeInBytes / this.audioInfo!.sampleRate;
|
||||
}
|
||||
|
||||
async getMimeType() {
|
||||
return 'audio/wav';
|
||||
}
|
||||
@@ -421,8 +414,10 @@ class WaveAudioTrackBacking implements InputAudioTrackBacking {
|
||||
return null;
|
||||
}
|
||||
|
||||
getDurationFromMetadata() {
|
||||
return this.demuxer.getDurationFromMetadata();
|
||||
async getDurationFromMetadata() {
|
||||
assert(this.demuxer.dataSize !== -1);
|
||||
|
||||
return this.demuxer.dataSize / this.demuxer.audioInfo!.blockSizeInBytes / this.demuxer.audioInfo!.sampleRate;
|
||||
}
|
||||
|
||||
async getLiveRefreshInterval() {
|
||||
|
||||
Reference in New Issue
Block a user