2016-10-04 46 views
-1

我正在使用<video>實現視頻播放器。這可以在Chrome,Firefox和Internet Explorer中使用,但不適用於Safari。Html5視頻播放器在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中的錯誤。

+0

「是給錯誤」的 - 你不認爲這值得一提的**什麼錯誤消息說** ?! – Quentin

+0

你可以使用YouTube或類似的東西,然後使用嵌入代碼。這將工作跨瀏覽器 –

+0

@Quentin先生它沒有給出任何錯誤,它只是不工作。而已。 –

回答

-2

您可以使用YouTube播放器 使用YouTube網站找到你想要 點擊視頻下方的「分享」按鈕,視頻 點擊旁邊的「嵌入」按鈕,他們告訴你 複製iframe代碼的鏈接給出並粘貼到您的網頁的HTML。

看看這個link

本文給出了一個良好的運行,通過實現HTML5視頻播放器 http://www.creativebloq.com/html5/build-custom-html5-video-player-9134473

+0

這不提供問題的答案。要批評或要求作者澄清,請在其帖子下方留言。 - [來自評論](/ review/low-quality-posts/14089147) – VDWWD

+0

是的,我知道它沒有,但是運營商確實要求鏈接,所以這就是他們得到的。誠實的人在這個論壇上如此粗魯。 –

相關問題