问题
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