
如何禁用html5視頻自動(dòng)播放?
我嘗試過(guò)的:
<video width="640" height="480" controls="controls" type="video/mp4" autoplay="false" preload="none"><source src="http://mydomain.com/mytestfile.mp4">Your browser does not support the video tag.</video>
我將刪除autoplay屬性,因?yàn)槿绻麨g覽器找到自動(dòng)播放字符串,它會(huì)自動(dòng)播放!
自動(dòng)播放不是布爾類型.
此外,類型進(jìn)入源代碼,如下所示:
<video width="640" height="480" controls preload="none"> <source src="http://example.com/mytestfile.mp4" type="video/mp4"> Your browser does not support the video tag. </video>
參考:http://www.w3.org/TR/html-markup/video.html
刪除視頻標(biāo)記中的自動(dòng)播放.使用這樣的代碼
<video class="embed-responsive-item" controls> <source src="http://example.com/video.mp4"> Your browser does not support the video tag. </video>
這是100%的工作
嘗試添加autostart="false"到源標(biāo)記.
<video width="640" height="480" controls="controls" type="video/mp4" preload="none"> <source src="http://example.com/mytestfile.mp4" autostart="false"> Your browser does not support the video tag. </video>
我們珍惜您每一次在線咨詢,有問(wèn)必答;用專業(yè)的技術(shù),貼心的服務(wù),解答您的開(kāi)發(fā)疑問(wèn)。
讓您真正感受到我們的服務(wù)態(tài)度和專業(yè)技術(shù)!