fix: emit TEXT_TRACK_CHANGE event when changing subtitles in ShakaTech - #130
Merged
Merged
Conversation
Problem:
When using ShakaTech (DASH streams) with the Eyevinn player skin, changing
subtitles through the UI doesn't update the displayed text track. The subtitle
selector shows available tracks, but selecting a different subtitle has no
visible effect.
Root Cause:
ShakaTech's textTrack setter successfully calls Shaka Player's
selectTextTrack() and setTextTrackVisibility() to change the active subtitle,
but never emits the TEXT_TRACK_CHANGE event. This means:
- Player state is never updated with the new text track selection
- UI never receives notification via STATE_CHANGE event
- Other components listening for text track changes are not notified
Solution:
Add onTextTrackChange() calls after changing tracks in the setter, following
the same pattern already used for audio track changes (line 91). This ensures:
- State is updated via updateState({ textTracks: this.textTracks })
- TEXT_TRACK_CHANGE event is emitted
- Player relays STATE_CHANGE event to UI
This fix follows the existing pattern used by:
- ShakaTech's audioTrack setter (already calls onAudioTrackChange())
- HlsJsTech's text track handling (registers event listener)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
birme
approved these changes
Feb 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When using ShakaTech (DASH streams) with the Eyevinn player skin, changing subtitles through the UI doesn't update the displayed text track. The subtitle selector shows available tracks, but selecting a different subtitle has no visible effect.
Root Cause
ShakaTech's
textTracksetter successfully calls Shaka Player'sselectTextTrack()andsetTextTrackVisibility()methods to change the active subtitle, but it never emits theTEXT_TRACK_CHANGEevent. This means:STATE_CHANGEeventWhile the subtitle may technically change in Shaka Player internally, the player's state management system remains unaware.
Solution
Add
onTextTrackChange()calls after changing tracks in thetextTracksetter, following the same pattern already used for audio track changes (line 91).Changes:
this.onTextTrackChange();after enabling a text trackthis.onTextTrackChange();after disabling text tracksThis ensures:
updateState({ textTracks: this.textTracks })TEXT_TRACK_CHANGEevent is emittedSTATE_CHANGEevent to UIWhy This Fix Works
onTextTrackChange()infrastructureonAudioTrackChange()after changing audio tracks (line 91)Reference Implementation
HlsJsTech (HLS streams) correctly handles this by registering an event listener:
ShakaTech's audio tracks already follow the manual trigger pattern:
Testing
Manual Verification
npm run buildnpm run examplesTEXT_TRACK_CHANGEevents should appear in consoleCode Verification
Risk Assessment
Low Risk:
onTextTrackChange()from BaseTech)Related Issues
This may be related to or help resolve:
🤖 Generated with Claude Code