fix: player nextVideo fix

Signed-off-by: Lachezar Lechev <lachezar@ambire.com>
This commit is contained in:
Lachezar Lechev 2025-03-18 10:58:10 +02:00
parent 5b94c92878
commit e9c7c4fcec
No known key found for this signature in database
GPG key ID: FDC9325CE311E8A4

View file

@ -210,11 +210,16 @@ const Player = ({ urlParams, queryParams }) => {
}, []);
const onNextVideoRequested = React.useCallback(() => {
if (player.nextVideo !== null) {
nextVideo();
console.log('Before nextVideo()');
nextVideo();
console.log('after nextVideo()');
});
React.useEffect(() => {
if (player.nextVideo !== null && player.nextVideo.deepLinks !== null) {
const deepLinks = player.nextVideo.deepLinks;
if (deepLinks.metaDetailsStreams && deepLinks.player) {
console.log('Next: window.location.replace() & window.location.href = deepLinks.player');
window.location.replace(deepLinks.metaDetailsStreams);
window.location.href = deepLinks.player;
} else {