bvibber / ogv.js

JavaScript media player using Ogg/Vorbis/Theora/Opus/WebM libs compiled with Emscripten
https://brooke.vibber.net/misc/ogv.js/demo/
Other
1.19k stars 99 forks source link

Implement OGVMediaSource (Media Source Extensions / MSE shim) #359

Open bvibber opened 8 years ago

bvibber commented 8 years ago

Might be better to implement adaptive streaming using standardish Media Source Extensions interfaces rather than hacking it custom inside the player.

Public APIs:

Internals:

yarontorbaty commented 8 years ago

For General purposes MSE would do. For Safari on iOS/iPhones, where inline video playing is prohibited and therefore most needed, it would not work as iOS does not support MSE as of now. So maybe hacking it inside the player is a better approach.

bvibber commented 8 years ago

Right you'd use OGVMediaSource which would be part of ogv.js, not the default MediaSource class which either doesn't exist or wouldn't work.

bvibber commented 8 years ago

Roughly, in MSE the MediaSource class encapsulates part of the interface to the demuxers, exposing to the client code the ability to stuff input data buffers in. You then hook up your MediaSource to a video or audio element, which behind the scenes knows how to pull actual video and audio data from the demuxers. Because there is no public interface defined for how the player gets data from the MediaSource, you would not be able to use a native MediaSource with an OGVPlayer, nor an OGVMediaSource with an HTMLVideoElement. So the presence of native MSE doesn't affect how ogv.js's own MSE implementation would work; they are parallel and separate.

publicocean0 commented 7 years ago

Implement a MSE shim would be a great idea

bvibber commented 6 years ago

Regarding notes from https://github.com/brion/ogv.js/issues/475 :

  1. Theoretically, the OGVInputSource interface is/will be a subset of what StreamFile does, so a custom object could be assigned (but need to actually make it so you can use one).
  2. StreamFile has been refactored to use promises, but have not yet done the same for the demuxer and codec interfaces. This is still pending; old notes are at https://github.com/brion/ogv.js/wiki/Proposed-module-interfaces
  3. ideally, internally the high-level OGVPlayer should implement handling of plain-files-referenced-by-URL by using the lower-level OGVMediaSource internally. This'll require separating out the display-and-UI parts of OGVPlayer from the internal bits that keep track of the demuxer and decoders.
suman commented 4 years ago

Is there any progress about implementing MSE ?