Netflix video player in Chrome - how to seek?

后端 未结 4 1278
感情败类
感情败类 2020-12-09 06:14

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

4条回答
  •  既然无缘
    2020-12-09 07:15

    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.
    

提交回复
热议问题