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);
video.unload();
// if (player.stream?.type === 'Ready' && streamingServer.settings?.type !== 'Loading') {
if (player.selected && player.stream?.type === 'Ready' && streamingServer.settings?.type !== 'Loading') {
if (player.stream?.type === 'Ready' && streamingServer.settings?.type !== 'Loading') {
video.load({
stream: {
...player.stream.content,

View file

@ -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 ?