fix: player and useStatistics - use player.stream

Signed-off-by: Lachezar Lechev <lachezar@ambire.com>
This commit is contained in:
Lachezar Lechev 2025-11-26 21:10:23 +02:00
parent 4fba2a3770
commit 5f1841bfb8
No known key found for this signature in database
GPG key ID: 69BDCB3ED8CE8037
2 changed files with 7 additions and 7 deletions

View file

@ -323,8 +323,7 @@ const Player = ({ urlParams, queryParams }) => {
setError(null); setError(null);
video.unload(); video.unload();
// if (player.stream?.type === 'Ready' && streamingServer.settings?.type !== 'Loading') { if (player.stream?.type === 'Ready' && streamingServer.settings?.type !== 'Loading') {
if (player.selected && player.stream?.type === 'Ready' && streamingServer.settings?.type !== 'Loading') {
video.load({ video.load({
stream: { stream: {
...player.stream.content, ...player.stream.content,

View file

@ -7,11 +7,12 @@ const useStatistics = (player, streamingServer) => {
const { core } = useServices(); const { core } = useServices();
const stream = React.useMemo(() => { const stream = React.useMemo(() => {
return player.selected?.stream ? if (player.stream?.type === 'Ready') {
player.selected.stream return player.stream.content;
: } else {
null; return null;
}, [player.selected]); }
}, [player.stream]);
const infoHash = React.useMemo(() => { const infoHash = React.useMemo(() => {
return stream?.infoHash ? return stream?.infoHash ?