mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-05-12 09:10:45 +00:00
chore: player - clean up and use handleNextVideoNavigation
Signed-off-by: Lachezar Lechev <lachezar@ambire.com>
This commit is contained in:
parent
32cf4cc12e
commit
3d163cf440
1 changed files with 24 additions and 36 deletions
|
|
@ -105,22 +105,27 @@ const Player = ({ urlParams, queryParams }) => {
|
||||||
video.setProp('extraSubtitlesOutlineColor', settings.subtitlesOutlineColor);
|
video.setProp('extraSubtitlesOutlineColor', settings.subtitlesOutlineColor);
|
||||||
}, [settings.subtitlesSize, settings.subtitlesOffset, settings.subtitlesTextColor, settings.subtitlesBackgroundColor, settings.subtitlesOutlineColor]);
|
}, [settings.subtitlesSize, settings.subtitlesOffset, settings.subtitlesTextColor, settings.subtitlesBackgroundColor, settings.subtitlesOutlineColor]);
|
||||||
|
|
||||||
// const handleNextVideoNavigation = React.useCallback((deepLinks, bingeWatching, ended) => {
|
const handleNextVideoNavigation = React.useCallback((deepLinks, bingeWatching, ended) => {
|
||||||
// if (bingeWatching && !ended) {
|
if (ended) {
|
||||||
// if (deepLinks.player) {
|
if (profile.settings.bingeWatching) {
|
||||||
// isNavigating.current = true;
|
if (deepLinks.player) {
|
||||||
// window.location.replace(deepLinks.player);
|
isNavigating.current = true;
|
||||||
// } else if (deepLinks.metaDetailsStreams) {
|
window.location.replace(deepLinks.player);
|
||||||
// isNavigating.current = true;
|
} else if (deepLinks.metaDetailsStreams) {
|
||||||
// window.location.replace(deepLinks.metaDetailsStreams);
|
isNavigating.current = true;
|
||||||
// }
|
window.location.replace(deepLinks.metaDetailsStreams);
|
||||||
// } else {
|
}
|
||||||
// if (!ended && deepLinks.metaDetailsStreams) {
|
}
|
||||||
// isNavigating.current = true;
|
} else {
|
||||||
// window.location.replace(deepLinks.metaDetailsStreams);
|
if (deepLinks.player) {
|
||||||
// }
|
isNavigating.current = true;
|
||||||
// }
|
window.location.replace(deepLinks.player);
|
||||||
// }, []);
|
} else if (deepLinks.metaDetailsStreams) {
|
||||||
|
isNavigating.current = true;
|
||||||
|
window.location.replace(deepLinks.metaDetailsStreams);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
const onEnded = React.useCallback(() => {
|
const onEnded = React.useCallback(() => {
|
||||||
// here we need to explicitly check for isNavigating.current
|
// here we need to explicitly check for isNavigating.current
|
||||||
|
|
@ -134,16 +139,7 @@ const Player = ({ urlParams, queryParams }) => {
|
||||||
nextVideo();
|
nextVideo();
|
||||||
|
|
||||||
const deepLinks = window.playerNextVideo.deepLinks;
|
const deepLinks = window.playerNextVideo.deepLinks;
|
||||||
// handleNextVideoNavigation(deepLinks, profile.settings.bingeWatching, true);
|
handleNextVideoNavigation(deepLinks, profile.settings.bingeWatching, true);
|
||||||
if (profile.settings.bingeWatching) {
|
|
||||||
if (deepLinks.player) {
|
|
||||||
isNavigating.current = true;
|
|
||||||
window.location.replace(deepLinks.player);
|
|
||||||
} else if (deepLinks.metaDetailsStreams) {
|
|
||||||
isNavigating.current = true;
|
|
||||||
window.location.replace(deepLinks.metaDetailsStreams);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
window.history.back();
|
window.history.back();
|
||||||
|
|
@ -274,17 +270,9 @@ const Player = ({ urlParams, queryParams }) => {
|
||||||
nextVideo();
|
nextVideo();
|
||||||
|
|
||||||
const deepLinks = player.nextVideo.deepLinks;
|
const deepLinks = player.nextVideo.deepLinks;
|
||||||
if (deepLinks.player) {
|
handleNextVideoNavigation(deepLinks, profile.settings.bingeWatching, false);
|
||||||
isNavigating.current = true;
|
|
||||||
window.location.replace(deepLinks.player);
|
|
||||||
} else if (deepLinks.metaDetailsStreams) {
|
|
||||||
isNavigating.current = true;
|
|
||||||
window.location.replace(deepLinks.metaDetailsStreams);
|
|
||||||
}
|
|
||||||
// handleNextVideoNavigation(deepLinks, profile.settings.bingeWatching, false);
|
|
||||||
}
|
}
|
||||||
// }, [player.nextVideo, handleNextVideoNavigation]);
|
}, [player.nextVideo, handleNextVideoNavigation, profile.settings]);
|
||||||
}, [player.nextVideo, profile.settings]);
|
|
||||||
|
|
||||||
const onVideoClick = React.useCallback(() => {
|
const onVideoClick = React.useCallback(() => {
|
||||||
if (video.state.paused !== null) {
|
if (video.state.paused !== null) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue