Skip to content

Commit

Permalink
fix: Fire PRFT event every time (#7408)
Browse files Browse the repository at this point in the history
Always raise prft events so consumers can have access to the wall clock
time.
  • Loading branch information
tykus160 authored Oct 10, 2024
1 parent 072f46c commit e7f7825
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions lib/media/media_source_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,6 @@ shaka.media.MediaSourceEngine = class {

/** @private {!shaka.util.PublicPromise.<number>} */
this.audioCompensation_ = new shaka.util.PublicPromise();

/** @private {boolean} */
this.parsedPrftEventRaised_ = false;
}

/**
Expand Down Expand Up @@ -496,7 +493,6 @@ shaka.media.MediaSourceEngine = class {
this.firstAudioTimestamp_ = null;
this.firstAudioReferenceStartTime_ = null;
this.audioCompensation_ = new shaka.util.PublicPromise();
this.parsedPrftEventRaised_ = false;

for (const contentType of streamsByType.keys()) {
const stream = streamsByType.get(contentType);
Expand Down Expand Up @@ -837,11 +833,9 @@ shaka.media.MediaSourceEngine = class {
const Mp4Parser = shaka.util.Mp4Parser;
let startTime = 0;
let parsedMedia = false;
const parser = new Mp4Parser();
if (!this.parsedPrftEventRaised_) {
parser.fullBox('prft', (box) => this.parsePrft_(timescale, box));
}
parser.box('moof', Mp4Parser.children)
new Mp4Parser()
.fullBox('prft', (box) => this.parsePrft_(timescale, box))
.box('moof', Mp4Parser.children)
.box('traf', Mp4Parser.children)
.fullBox('tfdt', (box) => {
goog.asserts.assert(
Expand Down Expand Up @@ -905,7 +899,6 @@ shaka.media.MediaSourceEngine = class {
const event = new shaka.util.FakeEvent(
eventName, data);
this.playerInterface_.onEvent(event);
this.parsedPrftEventRaised_ = true;
}


Expand Down

0 comments on commit e7f7825

Please sign in to comment.