bvibber / ogv.js

JavaScript media player using Ogg/Vorbis/Theora/Opus/WebM libs compiled with Emscripten

Home Page:https://brooke.vibber.net/misc/ogv.js/demo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to skip frame (and audio) on a non-seekable stream?

rafi16jan opened this issue · comments

I'm using OGV.js as a polyfill for Safari on my application. I use MediaSource on other platforms to play the buffered stream and hooking on the video progress event to check if the video's currentTime and real elapsed time was far enough so then I will set the currentTime to keep the stream in sync. So logically, I did the same for OGV.js (with the framecallback event) but it turns out changing currentTime on a non-seekable stream is not supported on OGV.js. Is there any way to skip some frame (and audio) to keep the stream in sync?

Because in my understanding physically skipping the video chunk (I pass a function to read prop on init) is not possible as WebM needs to render every frame in the assigned order hence I use the currentTime.

In MediaSource however there's a sequence mode and initially I am able to skip frames with this mode but crossplatform support sucks (either some browser doesn't support it or it is buggy) even it throws an error when the stream is playing long enough. Does such mode exist on OGV.js?

No, this is not supported. Feel free to modify the source yourself to add this feature for your needs.

No, this is not supported. Feel free to modify the source yourself to add this feature for your needs.

I see. But yesterday I actually try to skip the physical frames myself and it actually works! You can see it in action here https://simple-vidconf.herokuapp.com/client.js. See at onProgress function, basically I skip 10 frames when the real elapsed time and the currentTime is different and it actually works a bit ok. Is this how it intended to work? Because in the real MediaSource API you have to put it on sequence mode to actually achieve this.