Skip to content

Commit

Permalink
fix: Fix ID3 timing when included in EMSG (#7099)
Browse files Browse the repository at this point in the history
Related to #7097
  • Loading branch information
avelad authored Jul 24, 2024
1 parent dcdecf9 commit eb36c0d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/media/streaming_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -2317,10 +2317,11 @@ shaka.media.StreamingEngine = class {
this.playerInterface_.onManifestUpdate();
} else {
// All other schemes are dispatched as a general 'emsg' event.
const endTime = startTime + (eventDuration / timescale);
/** @type {shaka.extern.EmsgInfo} */
const emsg = {
startTime: startTime,
endTime: startTime + (eventDuration / timescale),
endTime: endTime,
schemeIdUri: schemeId,
value: value,
timescale: timescale,
Expand Down Expand Up @@ -2353,17 +2354,17 @@ shaka.media.StreamingEngine = class {
schemeId == 'https://developer.apple.com/streaming/emsg-id3') {
// See https://aomediacodec.github.io/id3-emsg/
const frames = shaka.util.Id3Utils.getID3Frames(messageData);
if (frames.length && reference) {
if (frames.length) {
/** @private {shaka.extern.ID3Metadata} */
const metadata = {
cueTime: reference.startTime,
cueTime: startTime,
data: messageData,
frames: frames,
dts: reference.startTime,
pts: reference.startTime,
dts: startTime,
pts: startTime,
};
this.playerInterface_.onMetadata(
[metadata], /* offset= */ 0, reference.endTime);
[metadata], /* offset= */ 0, endTime);
}
}
}
Expand Down

0 comments on commit eb36c0d

Please sign in to comment.