From 0880f36dabc6bbd6c74d313e8e86ffd463f858ad Mon Sep 17 00:00:00 2001 From: Andrew Mahone Date: Fri, 8 Nov 2019 08:38:21 -0500 Subject: [PATCH] Fallback to empty fonts list when server doesn't send MediaAttachments. --- src/components/htmlvideoplayer/plugin.js | 3 ++- yarn.lock | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/htmlvideoplayer/plugin.js b/src/components/htmlvideoplayer/plugin.js index 74cb0c4bf..d040c03bd 100644 --- a/src/components/htmlvideoplayer/plugin.js +++ b/src/components/htmlvideoplayer/plugin.js @@ -1038,10 +1038,11 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa } function renderWithSubtitlesOctopus(videoElement, track, item) { + var attachments = self._currentPlayOptions.mediaSource.MediaAttachments || []; var options = { video: videoElement, subUrl: getTextTrackUrl(track, item), - fonts: self._currentPlayOptions.mediaSource.MediaAttachments.map(i => i.DeliveryUrl), + fonts: attachments.map(i => i.DeliveryUrl), workerUrl: appRouter.baseUrl() + "/node_modules/libass-wasm/dist/subtitles-octopus-worker.js", onError: function() { htmlMediaHelper.onErrorInternal(self, 'mediadecodeerror') diff --git a/yarn.lock b/yarn.lock index cb8cd3e4f..074c848cf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2510,6 +2510,11 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +libass-wasm@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/libass-wasm/-/libass-wasm-2.1.1.tgz#f12f4fdb9579dd422dcbc348bc3bd61097f4d07d" + integrity sha512-d45bHQ7tFVsLW3QstQDrDog2m+0D6Cja4GTrkGi70R9A5+aeLunPSUz3G4CVB+sKffNgiWjK4QI5NZLHQKZ9oQ== + libjass@^0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/libjass/-/libjass-0.11.0.tgz#bff1f464a2428c3bddfb68e4503b2d52afe3d6e6"