Skip to content

Commit

Permalink
Fix Fallback URL for Subtitles
Browse files Browse the repository at this point in the history
  • Loading branch information
jaruba committed Jan 15, 2025
1 parent 54cd8ea commit 20f733e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/withStreamingServer/withStreamingServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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())
:
Expand Down Expand Up @@ -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())
:
Expand Down

0 comments on commit 20f733e

Please sign in to comment.