Video stream through Websocket to <video> tag

允我心安 提交于 2019-12-02 16:25:55

Your example only contains the code that is shown on the rendered page from here: http://html5-demos.appspot.com/static/media-source.html

Check the source code, line 155 is what you are missing:

var file = new Blob([uInt8Array], {type: 'video/webm'});

So, you need to tell the Blob the content type and then feed the buffer with Uint8Array (see line 171):

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