From 0ab71eb899bee45c8436f4f71e73586c098c535e Mon Sep 17 00:00:00 2001 From: Marius Luca Date: Fri, 7 Jan 2022 22:07:59 +0200 Subject: [PATCH] - limit font attachments requested for ass subtitles to a supported formats list --- src/plugins/htmlVideoPlayer/plugin.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/plugins/htmlVideoPlayer/plugin.js b/src/plugins/htmlVideoPlayer/plugin.js index e4692e597..783a49e6b 100644 --- a/src/plugins/htmlVideoPlayer/plugin.js +++ b/src/plugins/htmlVideoPlayer/plugin.js @@ -1048,12 +1048,16 @@ function tryRemoveElement(elem) { * @private */ renderSsaAss(videoElement, track, item) { + const supportedFonts = ['application/x-truetype-font', 'font/otf', 'font/ttf', 'font/woff', 'font/woff2']; const avaliableFonts = []; const attachments = this._currentPlayOptions.mediaSource.MediaAttachments || []; const apiClient = ServerConnections.getApiClient(item); - attachments.map(function (i) { - // embedded font url - return avaliableFonts.push(apiClient.getUrl(i.DeliveryUrl)); + attachments.forEach(i => { + // we only require font files and ignore embedded media attachments like covers as there are cases where ffmpeg fails to extract those + if (supportedFonts.includes(i.MimeType)) { + // embedded font url + avaliableFonts.push(apiClient.getUrl(i.DeliveryUrl)); + } }); const fallbackFontList = apiClient.getUrl('/FallbackFont/Fonts', { api_key: apiClient.accessToken()