Reputation: 478
Is it possible to use the MediaSource API to receive valid header and pages of an Ogg vorbis bitstream and play the track while it is streamed in an audio element? An example would be very much appreciated =)
NB: I have looked into the WebAudio API but it seems that it can only decode full ogg files, not ogg pages progressively.
EDIT: I am even wondering if it is currently possible to use the MediaSource API with audio elements in Chrome. The spec says so, but it seems to be implemented only for video elements in Chrome.
Thanks
Upvotes: 2
Views: 1065
Reputation: 286
Ogg is not supported by Chrome's MediaSource implementation and currently there are no plans to add support. We are focusing our efforts on the WebM & ISO-BMFF bytestreams mentioned in the spec.
The MediaSource API should work with audio elements. If you are using audio-only content you must make sure that the mimetype passed to addSourceBuffer() only contains the audio codec and nothing else. For example if you have an audio only WebM file, then 'audio/webm;codecs="vorbis"' should work, but 'video/webm;codecs="vorbis,vp8"' would fail because the file doesn't contain VP8 data.
If you use Dev Channel Chrome builds (Chrome 25+), you can see MediaSource related errors by opening chrome:media-internals in another tab and then reloading your tab that is trying to use the MediaSource API.
Upvotes: 3