在下面的代码中,自动播放="false" 预加载="无"设置,但视频仍然自动播放。
问题出在哪里?
我错过了什么?
new_video = document.createElement('video');
new_video.setAttribute('controls','true');
//new_video.setAttribute('autoBuffering','true');
new_video.setAttribute('preload','none');//autoPlay: false, 'preload':'auto'
new_video.setAttribute('autoPlay','false');
//new_video.setAttribute('type','video/mp4;codecs="vp8, vorbis"');
video = document.getElementById('RIZfC358yRk').appendChild(new_video);
source = document.createElement('source');
source.setAttribute('src','https://dl.dropboxusercontent.com/u/87532981/Ella%20May%20and%20the%20Wishing%20Stone%20By%20Cary%20Fagan.mp4');
video.appendChild(source);
video.load();
video.play();
尝试使用"autostart"属性而不是"autoPlay":
new_video.setAttribute('autostart','false');
并删除最后一行,
video.play();