创建html视频对象

时间:2015-08-13 00:02:42

标签: html5 chromecast

在我的自定义接收器中,有这个片段:

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

通过这一行,我可以播放带声音的视频:

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

但是用这条线,我只能听到声音,但没有视频:

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

有什么建议吗?

0 个答案:

没有答案