Fix atTimestamps iterator

This commit is contained in:
Vanilagy
2025-01-14 21:23:37 +01:00
parent 45474764ca
commit 9af3e6eb66
4 changed files with 44 additions and 17 deletions
+18
View File
@@ -42,6 +42,15 @@ export class EncodedVideoSample {
});
}
is(otherSample: EncodedVideoSample) {
return (
this.type === otherSample.type
&& this.timestamp === otherSample.timestamp
&& this.duration === otherSample.duration
&& this.byteLength === otherSample.byteLength
);
}
static fromEncodedVideoChunk(chunk: EncodedVideoChunk) {
if (typeof EncodedVideoChunk === 'undefined') {
throw new Error('Your browser does not support EncodedVideoChunk.');
@@ -98,6 +107,15 @@ export class EncodedAudioSample {
});
}
is(otherSample: EncodedAudioSample) {
return (
this.type === otherSample.type
&& this.timestamp === otherSample.timestamp
&& this.duration === otherSample.duration
&& this.byteLength === otherSample.byteLength
);
}
static fromEncodedAudioChunk(chunk: EncodedAudioChunk) {
if (typeof EncodedAudioChunk === 'undefined') {
throw new Error('Your browser does not support EncodedAudioChunk.');