Skip to content

Commit

Permalink
Fix a bug when dispatching subtitle events that causes an error in th… (
Browse files Browse the repository at this point in the history
#4389)

* Fix a bug when dispatching subtitle events that causes an error in the event bus when the video is seeked
  • Loading branch information
dsilhavy committed Feb 19, 2024
1 parent 9e3da3c commit 1249205
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .circleci/config.yml
Expand Up @@ -49,7 +49,8 @@ commands:

build_unit_test_steps:
steps:
- browser-tools/install-browser-tools
- browser-tools/install-browser-tools:
chrome-version: "120.0.6099.224"
- run:
name: Build and run unit tests
command: |
Expand Down
5 changes: 1 addition & 4 deletions samples/captioning/events.html
Expand Up @@ -46,10 +46,7 @@
player.updateSettings({
streaming: {
text: {
dispatchForManualRendering: true,
webvtt: {
customRenderingEnabled: true
}
dispatchForManualRendering: true
}
}
})
Expand Down
3 changes: 3 additions & 0 deletions src/streaming/text/TextTracks.js
Expand Up @@ -575,6 +575,9 @@ function TextTracks(config) {
if (_isHTMLCue(currentItem) && currentCaptionEventCue && currentCaptionEventCue.cueID !== cue.cueID) {
_triggerCueExit(currentCaptionEventCue);
}
// We need to delete the type attribute to be able to dispatch via th event bus
delete cue.type;

currentCaptionEventCue = cue;
_triggerCueEnter(cue);
}
Expand Down

0 comments on commit 1249205

Please sign in to comment.