diff --git a/package.json b/package.json index 5adafcf04..51333515b 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@babel/runtime": "7.26.0", "@sentry/browser": "8.42.0", "@stremio/stremio-colors": "5.2.0", - "@stremio/stremio-core-web": "0.50.0", + "@stremio/stremio-core-web": "0.51.0", "@stremio/stremio-icons": "5.8.0", "@stremio/stremio-video": "0.0.64", "a-color-picker": "1.2.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7ce641739..571443aac 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,8 +18,8 @@ importers: specifier: 5.2.0 version: 5.2.0 '@stremio/stremio-core-web': - specifier: 0.50.0 - version: 0.50.0 + specifier: 0.51.0 + version: 0.51.0 '@stremio/stremio-icons': specifier: 5.8.0 version: 5.8.0 @@ -1302,8 +1302,8 @@ packages: '@stremio/stremio-colors@5.2.0': resolution: {integrity: sha512-dYlPgu9W/H7c9s1zmW5tiDnRenaUa4Hg1QCyOg1lhOcgSfM/bVTi5nnqX+IfvGTTUNA0zgzh8hI3o3miwnZxTg==} - '@stremio/stremio-core-web@0.50.0': - resolution: {integrity: sha512-SRE9nStgYNbhjJAw7mXfmM0wdnSLS4GMSJsSMTXvoGxnUgd+yisJUkN/9Sughe4t2IU7Uct8QWpdx9zFdlil+g==} + '@stremio/stremio-core-web@0.51.0': + resolution: {integrity: sha512-rCgUrnG31wINZxf35LMvT3Cm/h+hEaJTagne99I9W7Wz8cGdMotVUxFzV8bkJLZh7q19+HkIr4WnEizkXuUZpg==} '@stremio/stremio-icons@5.8.0': resolution: {integrity: sha512-IVUvQbIWfA4YEHCTed7v/sdQJCJ+OOCf84LTWpkE2W6GLQ+15WHcMEJrVkE1X3ekYJnGg3GjT0KLO6tKSU0P4w==} @@ -6561,7 +6561,7 @@ snapshots: '@stremio/stremio-colors@5.2.0': {} - '@stremio/stremio-core-web@0.50.0': + '@stremio/stremio-core-web@0.51.0': dependencies: '@babel/runtime': 7.24.1 diff --git a/src/routes/Player/OptionsMenu/OptionsMenu.js b/src/routes/Player/OptionsMenu/OptionsMenu.js index 968de5341..da826ba41 100644 --- a/src/routes/Player/OptionsMenu/OptionsMenu.js +++ b/src/routes/Player/OptionsMenu/OptionsMenu.js @@ -54,8 +54,8 @@ const OptionsMenu = ({ className, stream, playbackDevices, extraSubtitlesTracks, } }, [streamingUrl, downloadUrl]); const onDownloadVideoButtonClick = React.useCallback(() => { - if (streamingUrl || downloadUrl) { - platform.openExternal(streamingUrl || downloadUrl); + if (downloadUrl || streamingUrl ) { + platform.openExternal(downloadUrl || streamingUrl); } }, [streamingUrl, downloadUrl]); diff --git a/src/routes/Player/Player.js b/src/routes/Player/Player.js index bcd973267..5f9856e31 100644 --- a/src/routes/Player/Player.js +++ b/src/routes/Player/Player.js @@ -323,10 +323,10 @@ const Player = ({ urlParams, queryParams }) => { setError(null); video.unload(); - if (player.selected && streamingServer.settings?.type !== 'Loading') { + if (player.selected && player.stream?.type === 'Ready' && streamingServer.settings?.type !== 'Loading') { video.load({ stream: { - ...player.selected.stream, + ...player.stream.content, subtitles: Array.isArray(player.selected.stream.subtitles) ? player.selected.stream.subtitles.map((subtitles) => ({ ...subtitles, @@ -361,7 +361,7 @@ const Player = ({ urlParams, queryParams }) => { shellTransport: services.shell.active ? services.shell.transport : null, }); } - }, [streamingServer.baseUrl, player.selected, forceTranscoding, casting]); + }, [streamingServer.baseUrl, player.selected, player.stream, forceTranscoding, casting]); React.useEffect(() => { if (video.state.stream !== null) { const tracks = player.subtitles.map((subtitles) => ({ diff --git a/src/routes/Player/useStatistics.js b/src/routes/Player/useStatistics.js index d13411327..d8b241a8c 100644 --- a/src/routes/Player/useStatistics.js +++ b/src/routes/Player/useStatistics.js @@ -7,11 +7,12 @@ const useStatistics = (player, streamingServer) => { const { core } = useServices(); const stream = React.useMemo(() => { - return player.selected?.stream ? - player.selected.stream - : - null; - }, [player.selected]); + if (player.stream?.type === 'Ready') { + return player.stream.content; + } else { + return null; + } + }, [player.stream]); const infoHash = React.useMemo(() => { return stream?.infoHash ?