I'm trying to control the video in the plex/web client via javascript and have had some success, specifically with the pausing and playing functionality (shown below):
var video = $('.html-video')[0];
video.play()
video.pause()
video.currentTime
0.081
According to the html5 video spec I should be able to seek in the video by setting the currentTime value like:
video.currentTime = 100.0;
But this doesn't appear to work in the Plex video. Any ideas?
If the video is direct playing, then just changing currentTime should work. If the video is transcoding, it can be a little more complicated depending on the browser. If Chrome is being used with the experimental player, a new transcode session is started with each seek. This is due to the way the video is being transcoded and consumed by the browser. If you use OSX Safari, HLS is used when transcoding and changing currentTime should work like if you are direct playing.
Ah that would make sense, since all my videos are being remuxed for the web player. I guess I'm going to have to dig further into how this works. Thanks