【发布时间】:2016-10-04 07:16:53
【问题描述】:
我正在使用<video> 实现视频播放器。这适用于 Chrome、Firefox 和 Internet Explorer,但不适用于 Safari。
$("#vdsourceVideoPath").attr("src", "http://localhost:3000/Documents/upc and shelf info_0001.mp4");
var player = document.getElementById('vdTrainingVideoPlayer');
player.load();
player.play();
<video id="vdTrainingVideoPlayer" class="vdTrainingVideoPlayer" controls="controls" autoplay="autoplay">
<source id="vdsourceVideoPath" src="" type="video/mp4" />
</video>
player.load() 和 player.play() 方法在 Safari 中出现错误。
【问题讨论】:
-
"正在给出错误" — 而且您认为不值得一提错误消息所说的内容?!
-
您可以只使用 YouTube 或类似的东西,然后使用嵌入代码。哪个可以跨浏览器使用
-
@Quentin 先生,它没有给出任何错误,只是无法正常工作。就是这样。
-
@M_Griffiths 先生,请您提供代码或链接。提前致谢。
-
@AbhishekSingh — 如果它没有给出任何错误,你为什么说“player.load() 和 player.play() 方法在 Safari 中出现错误”。有问题吗?