Create multiple instances of html video object

随声附和 提交于 2019-12-13 20:14:33

问题


In my custom receiver, there is this snippet:

    <video id='media' width="1260" height="700" autoplay />
    <video id='videoloop' width="1260" height="700" loop autoplay />
    <script>
        window.onload = function() {
          //window.mediaElement = document.getElementById('media');
          window.mediaElement = document.getElementById('videoloop');
          window.mediaManager = new cast.receiver.MediaManager(window.mediaElement);
          window.castReceiverManager = cast.receiver.CastReceiverManager.getInstance();
          window.castReceiverManager.start();

With this line, I can play video with sound:

window.mediaElement = document.getElementById('media');

But with this line, I can only hear sound but no video:

window.mediaElement = document.getElementById('videoloop');

Any suggestions?

来源:https://stackoverflow.com/questions/31977396/create-multiple-instances-of-html-video-object

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