![]() ![]() remove() then you'll eventually run out of RAM and the video will stop playing. If you append too much data to the SourceBuffer without calling.You can only append one blob of video data to the SourceBuffer at a time, and you can't append a second blob until the first one has finished (asynchronously) processing.These have to be declared, and must be exact, or it won't work The SourceBuffer object is very picky about codecs.This way you can keep adding new bits of video without changing the object URL. Use SourceBuffer.appendBuffer() to add all of your chunks to the video.On the sourceopen event, create a SourceBuffer.Create an object URL from the MediaSource.How do they do it?Īfter some significant Googling I managed to find the missing piece to the puzzle: MediaSource I'm certain this should be possible because YouTube and many other video streaming services utilize Blob URLs for video playback. As Blobs are immutable, I don't know how to keep appending data as it's received. However this will still eventually run out of data. Var concatenatedBlob = new Blob(arrayOfBlobs) ![]() I also assume I can trivially concatenate all of the Blobs currently in my array somehow to play more than one second: // Something like this (untested) Of course this only plays the first 1 second of video. Var video = document.getElementsByTagName("video") I know that a Blob URL can be generated and played like so: var src = URL.createObjectURL(arrayOfBlobs) My goal is to stream this audio/video data to an HTML5 element. So the code roughly looks like so: var arrayOfBlobs = Every second a new Blob is generated and appended to my array. Each Blob contains 1 second of audio/video data. I'm using Blobs for now but maybe a Uint8Array or something would be better). I have an array of Blobs (binary data, really - I can express it however is most efficient. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |