noraworld / scraps

Just my scraps, like Zenn scraps feature
0 stars 0 forks source link

How to seek Netflix player #21

Open noraworld opened 2 years ago

noraworld commented 2 years ago
noraworld commented 2 years ago

Preparation

const videoPlayer = netflix
  .appContext
  .state
  .playerApp
  .getAPI()
  .videoPlayer

// Getting player id
const playerSessionId = videoPlayer
  .getAllPlayerSessionIds()[0]

const player = videoPlayer
  .getVideoPlayerBySessionId(playerSessionId)

How to use

// rewind by 10 seconds
player.seek(player.getCurrentTime() - 10000)