fix: Player - selected check before video.load

Signed-off-by: Lachezar Lechev <lachezar@ambire.com>
This commit is contained in:
Lachezar Lechev 2025-07-18 12:08:48 +03:00
parent 0bec58b158
commit 3c2f8cb89b
No known key found for this signature in database
GPG key ID: FDC9325CE311E8A4

View file

@ -322,7 +322,8 @@ 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,
@ -358,7 +359,7 @@ const Player = ({ urlParams, queryParams }) => {
shellTransport: services.shell.active ? services.shell.transport : null, shellTransport: services.shell.active ? services.shell.transport : null,
}); });
} }
}, [streamingServer.baseUrl, player.selected, forceTranscoding, casting]); }, [streamingServer.baseUrl, player.selected, player.selected, forceTranscoding, casting]);
React.useEffect(() => { React.useEffect(() => {
if (video.state.stream !== null) { if (video.state.stream !== null) {
const tracks = player.subtitles.map((subtitles) => ({ const tracks = player.subtitles.map((subtitles) => ({