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