Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Seek to a point in a Netflix video

I am creating a sync web-extension and I would like to modify the current time of the video. So I detected the <video> and I do this for changing the time code:

video.currentTime=5;

but netflix automatically put an error on the screen: https://prnt.sc/sm0ro9 and https://prnt.sc/sm0sev

I got the same error with this.video.currentTime=5;

I know that the video.currenttime is working because in screen 1 we can see that netflix send the exact timecode to me.

Does someone know how I can edit the timecode ?

like image 662
Zarbi4734 Avatar asked Sep 03 '25 04:09

Zarbi4734


1 Answers

Ok so thanks to Paul I found the answer: I need to inject this code in the page:

const videoPlayer = netflix.appContext.state.playerApp.getAPI().videoPlayer;
const player=videoPlayer.getVideoPlayerBySessionId(videoPlayer.getAllPlayerSessionIds()[0]);

And if I want to seek:

player.seek(1091243)

(it go to 18min)

Thanks for help guys.

like image 170
Zarbi4734 Avatar answered Sep 05 '25 01:09

Zarbi4734



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!