Skip to content Skip to sidebar Skip to footer

HTML5: Play Video From Stored Binary String

I am trying to read the contents of a video file as a binary string using the FileReader.readAsBinaryString(Blob|File) as shown in the example http://www.html5rocks.com/en/tutorial

Solution 1:

Your problem might be with the player.src

player.src = "data:video/webm;base64,"+evt.target.result;

It is expecting the data to be in base64 but you're giving it a binary string.

Try encoding it to base64 using btoa

player.src = "data:video/webm;base64,"+btoa(evt.target.result);

Solution 2:

How about FileReader.readAsDataURL(Blob|File) ?
It is explained in your html5rocks-link as well.


Post a Comment for "HTML5: Play Video From Stored Binary String"