mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-20 14:52:13 +00:00
add extra subtitles only if stream is loaded
This commit is contained in:
parent
0ad91c1410
commit
8126662957
1 changed files with 13 additions and 11 deletions
|
|
@ -223,17 +223,19 @@ const Player = ({ urlParams, queryParams }) => {
|
|||
}
|
||||
}, [streamingServer.baseUrl, player.selected, forceTranscoding, casting]);
|
||||
useDeepEqualEffect(() => {
|
||||
dispatch({
|
||||
type: 'command',
|
||||
commandName: 'addExtraSubtitlesTracks',
|
||||
commandArgs: {
|
||||
tracks: player.subtitles.map((subtitles, index) => ({
|
||||
...subtitles,
|
||||
id: `extra_${index}`,
|
||||
label: subtitles.url
|
||||
}))
|
||||
}
|
||||
});
|
||||
if (videoState.stream !== null) {
|
||||
dispatch({
|
||||
type: 'command',
|
||||
commandName: 'addExtraSubtitlesTracks',
|
||||
commandArgs: {
|
||||
tracks: player.subtitles.map((subtitles, index) => ({
|
||||
...subtitles,
|
||||
id: `extra_${index}`,
|
||||
label: subtitles.url
|
||||
}))
|
||||
}
|
||||
});
|
||||
}
|
||||
}, [player.subtitles, videoState.stream]);
|
||||
React.useEffect(() => {
|
||||
dispatch({ type: 'setProp', propName: 'extraSubtitlesSize', propValue: settings.subtitlesSize });
|
||||
|
|
|
|||
Loading…
Reference in a new issue