Skip to content
This repository was archived by the owner on Oct 20, 2022. It is now read-only.

Issues building a custom text track renderer #242

@ghost

Description

Hello,

Thanks for the great project. My team is currently using HasPlayer to provide an MSE-based smooth streaming solution on Edge and IE and it's working great.

However, we're currently integrating a custom closed-captions rendering layer for text tracks delivered via a smoothstreaming manifest. This work can be thought of as three separate parts:

  1. Reading the available tracks from a manifest.
  2. Selecting/unselecting an available track.
  3. Hooking into cuechange events from the selected track once active in order to update our UI.

So far, we have successfully completed steps 1 and 2, using a combinations of the following HasPlayer APIs:

  • MediaPlayer.prototype.enableSubtitles() to enable the parsing of text tracks
  • MediaPlayer.prototype.getTracks() to read the available tracks
  • MediaPlayer.prototype.selectTrack() to select the desired track

Once a track has been selected, I can see that a text track appears in the textTracks array of the HTML video element on which HasPlayer is mounted, and a list of cues is also available.

Unfortunately, the activeCues array is never updated, and no cuechange events are emitted from the track. I see that you have proprietary cueEnter and cueExit events triggered directly from the MediaPlayer instance, but these do not seem to emit either.

Am I doing something wrong or misunderstanding the API?

I've been unable to find any general documentation or example closed captions integrations to reference.

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions