From 124920530d8503bd7581e1ffed300823b54c2512 Mon Sep 17 00:00:00 2001 From: Daniel Silhavy Date: Mon, 19 Feb 2024 14:51:01 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20a=20bug=20when=20dispatching=20subtitle?= =?UTF-8?q?=20events=20that=20causes=20an=20error=20in=20th=E2=80=A6=20(#4?= =?UTF-8?q?389)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix a bug when dispatching subtitle events that causes an error in the event bus when the video is seeked --- .circleci/config.yml | 3 ++- samples/captioning/events.html | 5 +---- src/streaming/text/TextTracks.js | 3 +++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b43d5c81b0..2f2cb2e0d3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: | diff --git a/samples/captioning/events.html b/samples/captioning/events.html index 54abc4175b..5c41b18810 100644 --- a/samples/captioning/events.html +++ b/samples/captioning/events.html @@ -46,10 +46,7 @@ player.updateSettings({ streaming: { text: { - dispatchForManualRendering: true, - webvtt: { - customRenderingEnabled: true - } + dispatchForManualRendering: true } } }) diff --git a/src/streaming/text/TextTracks.js b/src/streaming/text/TextTracks.js index cc7ee393ec..420114167f 100644 --- a/src/streaming/text/TextTracks.js +++ b/src/streaming/text/TextTracks.js @@ -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); }