Skip to content

Commit

Permalink
fix: use startTime instead of startTimeOfLoad to ensure all timeliner…
Browse files Browse the repository at this point in the history
…egionenter events are fired

see: #6711
  • Loading branch information
littlespex committed May 30, 2024
1 parent 30ac8c0 commit c048696
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -2405,7 +2405,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
const setupPlayhead = (startTime) => {
this.playhead_ = this.createPlayhead(startTime);
this.playheadObservers_ =
this.createPlayheadObserversForMSE_(startTimeOfLoad);
this.createPlayheadObserversForMSE_(startTime);

// We need to start the buffer management code near the end because it
// will set the initial buffering state and that depends on other
Expand Down Expand Up @@ -3242,16 +3242,16 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
* Create the observers for MSE playback. These observers are responsible for
* notifying the app and player of specific events during MSE playback.
*
* @param {number} startTimeOfLoad
* @param {number} startTime
* @return {!shaka.media.PlayheadObserverManager}
* @private
*/
createPlayheadObserversForMSE_(startTimeOfLoad) {
createPlayheadObserversForMSE_(startTime) {
goog.asserts.assert(this.manifest_, 'Must have manifest');
goog.asserts.assert(this.regionTimeline_, 'Must have region timeline');
goog.asserts.assert(this.video_, 'Must have video element');

const startsPastZero = this.isLive() || startTimeOfLoad > 0;
const startsPastZero = this.isLive() || startTime > 0;

// Create the region observer. This will allow us to notify the app when we
// move in and out of timeline regions.
Expand Down

0 comments on commit c048696

Please sign in to comment.