From 20f733e9b168c676198615c70c66073c07f5ae0f Mon Sep 17 00:00:00 2001 From: Alexandru Branza Date: Wed, 15 Jan 2025 12:35:22 +0200 Subject: [PATCH] Fix Fallback URL for Subtitles --- src/withStreamingServer/withStreamingServer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/withStreamingServer/withStreamingServer.js b/src/withStreamingServer/withStreamingServer.js index 4a63dab..9cfedbe 100644 --- a/src/withStreamingServer/withStreamingServer.js +++ b/src/withStreamingServer/withStreamingServer.js @@ -173,8 +173,6 @@ function withStreamingServer(Video) { subtitles: Array.isArray(commandArgs.stream.subtitles) ? commandArgs.stream.subtitles.map(function(track) { return Object.assign({}, track, { - // fallback is used in case server conversion fails (if server is offline) - fallbackUrl: track.url, url: typeof track.url === 'string' ? url.resolve(commandArgs.streamingServerURL, '/subtitles.vtt?' + new URLSearchParams([['from', track.url]]).toString()) : @@ -261,6 +259,8 @@ function withStreamingServer(Video) { commandArgs: Object.assign({}, commandArgs, { tracks: commandArgs.tracks.map(function(track) { return Object.assign({}, track, { + // fallback is used in case server conversion fails (if server is offline) + fallbackUrl: track.url, url: typeof track.url === 'string' ? url.resolve(loadArgs.streamingServerURL, '/subtitles.vtt?' + new URLSearchParams([['from', track.url]]).toString()) :