0
改變HTML5視頻源我有我的網頁上的視頻,像這樣:使用JavaScript/jQuery的
<div id="videoContainer">
<video id="video1" width="960" controls autoplay>
<source src=static/media/Wreck_It_Ralph_Trailer.mp4 type="video/mp4">
Your browser does not support html5 video
</video>
,我想改變使用jQuery/JavaScript的視頻源。我有這樣的代碼,但它不工作
$('source').attr({'src':'static/media/Here_Comes_The_Boom_Official_Trailer.mp4'})
有人會說這是爲什麼不工作或建議以正確的方式做到這一點?
http://stackoverflow.com/questions/5235145/changing-source-on-html5-video-tag – Mic