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 currentTime
property can be read but not set in the Netflix player, and when set, immediately triggers the error "Whoops! Something went wrong.". Other actions such as Play and Pause work quite well. For example, you can try the following:
<ENTER>
:var video = document.evaluate('//*[@id="5670317"]/video',document).iterateNext()
Note: The id value is specific to Armageddon. If you choose a different movie, which is fine, change the id as per the id in the URL of that movie.
<Enter>
: video.play()
. Observe that the video resumes playing.Simple enough, but how to make the video auto-advance to a specific point in the video? You may want to refer to this doc. Obviously you can manually seek by dragging the video player slider from left to right and release it someplace. You may wish to discover which method or event is called when you do this, and simulate that. I haven't had luck thus far.
Any ideas?
You can use the Netflix.com Player to watch TV shows and movies on the latest version of Chrome, Edge, Firefox, Opera, and Safari browsers on Windows and Mac.
We currently use Microsoft Silverlight to deliver streaming video to web browsers on the PC and Mac. It provides a high-quality streaming experience and lets us easily experiment with improvements to our adaptive streaming algorithms.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With