I have been unable to figure out how to do a video seek (automatically advance to a certain point in the video) in the Netflix video player running in Chrome. The curr
Finally found a simple solution:
netflix.cadmium.UiEvents.events.resize[1].scope.events.dragend[1].handler(null, {value: 999, pointerEventData: {playing: false}});
You can set:
It's not complete solution, but can be useful.
Previous version of netflix player was with global object window.netflix.cadmium.objects.videoPlayer. In the recent version it's empty, but you can access this object within events listeners:
Then in new global variable you can get access to temp1.cadmium.objects.videoPlayer
temp1.cadmium.objects.videoPlayer().getDuration() temp1.cadmium.objects.videoPlayer().seek(2283839); temp1.cadmium.objects.videoPlayer().seek(4283839);
[![enter image description here][1]][1]
I am not sure is it possible to do fully automatic. You can get access to this listeners by
getEventListeners(document.getElementsByTagName("body")[0]).keydown[0].listener
But I don't know how to get access to scopes variables
Looks like netflix changed player api. Its what I found:
const videoPlayer = netflix
.appContext
.state
.playerApp
.getAPI()
.videoPlayer
// Getting player id
const playerSessionId = videoPlayer
.getAllPlayerSessionIds()[0]
const player = videoPlayer
.getVideoPlayerBySessionId(playerSessionId)
Now you can use full player API.
For example player.seek
or player.getCurrentTime
or player.pause
, etc...
It will only work in console log of netflix if you want it to work in chrome extension then you need to inject this code in a script tag to make this work.
const videoPlayer = netflix.appContext.state.playerApp.getAPI().videoPlayer;
const player = videoPlayer.getVideoPlayerBySessionId(videoPlayer.getAllPlayerSessionIds()[0]);
player.seek(1091243) //seek to roughly 18mins
player.getCurrentTime() // will give you the current video time.
Building on Dmitry's response jump ahead 10 seconds by
player.seek(player.getCurrentTime() - 10000)