Skip to content

Conversation

@hudajkhan
Copy link
Contributor

@hudajkhan hudajkhan commented Mar 25, 2025

Closes #2335

What this pull request does:

In Chrome, the method for highlightCues is being called even before the player has fully loaded. (This may be due to some code that seems to be copying properties over which leads a timeupdate event being triggered. Code copied below from the Chrome debugger). This pull request adds code that returns from the method without doing anything if the player has not been loaded.

Reference:
/**

  • Set the value of crossOrigin from the media element. crossOrigin indicates
  • to the browser that should sent the cookies along with the requests for the
  • different assets/playlists
  • @method Html5#setCrossOrigin
  • @param {string} crossOrigin
  •     - anonymous indicates that the media should not sent cookies.
    
  •     - use-credentials indicates that the media should sent cookies along the requests.
    
  • @see [Spec]{@link https://html.spec.whatwg.org/#attr-media-crossorigin}
    */
    'crossOrigin'].forEach(function (prop) {
    Html5.prototype['set' + toTitleCase$1(prop)] = function (v) {
    this.el_[prop] = v;
    };
    });

@hudajkhan hudajkhan marked this pull request as ready for review March 25, 2025 17:09

highlightCue(evt) {
// This method is called when the time-updated event is triggered
// In Chrome, the event may be called even before the player is loaded
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you be more specific about what you mean by "the player"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible this happens if the video starts before we have the vtt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[sul-embed/prod] TypeError: Cannot read properties of undefined (reading 'remoteTextTracks')

3 participants