Semro / syncwatch

Browser extension to watch videos together
MIT License
135 stars 19 forks source link

Netflix doesn't work #20

Closed nilshellerhoff closed 3 years ago

nilshellerhoff commented 3 years ago

Netflix doesn't work (at least for me). As soon as one user pauses, plays, or changes the video time, Netflix will crash for the other user with error code M7375.

It might be possible to circumvent this though using the Netflix player API, instead of directly interacting with the video element (see https://stackoverflow.com/questions/42105028/netflix-video-player-in-chrome-how-to-seek#answer-46816934):

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

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

const player = videoPlayer
  .getVideoPlayerBySessionId(playerSessionId)

and then use

player.play()
player.pause()
player.seek(ms) // timestamp in milliseconds

Might try to implement it these days, and if it works I'll make a PR!