test(player): fix binge watching (3)

This commit is contained in:
Timothy Z. 2025-05-01 22:52:39 +03:00
parent 0efd1453bb
commit 980d0038ec

View file

@ -215,14 +215,19 @@ const Player = ({ urlParams, queryParams }) => {
const onNextVideoRequested = React.useCallback(() => {
if (player.nextVideo !== null) {
nextVideo();
const deepLinks = player.nextVideo.deepLinks;
if (deepLinks.player) {
window.location.replace(deepLinks.player);
} else if (deepLinks.metaDetailsStreams) {
window.location.replace(deepLinks.metaDetailsStreams);
}
const navigateToPlayer = deepLinks.player ? deepLinks.player : null;
const navigateToDetails = deepLinks.metaDetailsStreams ? deepLinks.metaDetailsStreams : null;
nextVideo();
requestAnimationFrame(() => {
if (navigateToPlayer) {
window.location.replace(navigateToPlayer);
} else if (navigateToDetails) {
window.location.replace(navigateToDetails);
}
});
}
}, [player.nextVideo]);