Skip to content

Guard embedded player DASH-to-HLS fallback against duplicate errors #641

Description

@filthyrake

Problem

The embedded player's initShakaPlayer in web/public/static/js/pages/embed.js has separate Shaka error-event and load-rejection handlers. Both call this.shakaPlayer.destroy(), immediately clear the field, and initialize HLS without awaiting teardown.

If one DASH failure produces both signals, the second handler can dereference the cleared player or initialize HLS twice. Starting HLS before asynchronous Shaka teardown completes can also disrupt the new playback attachment.

Expected fix and verification

Use one guarded asynchronous fallback, capture the failed player, await its destruction, and initialize HLS only once. Add a DOM regression that emits both failure signals and delays destruction, verifying HLS starts once and only after teardown.

Gafton's review of #640 identified this as pre-existing: the watch-page equivalent is repaired in that PR, but the embed fallback needs the same treatment. No live embedded-player failure was claimed or reproduced during the production cutover.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions