HTML5: Play video from stored binary string

痞子三分冷 提交于 2019-12-03 08:25:58

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);
sebilasse

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!