Changing Video src using jquery -
Changing Video src using jquery -
this question has reply here:
changing source on html5 video tag 13 answersi want alter video scr when play button click html is
<video class="mvideo" controls autoplay="autoplay"> <source class="video" src="path.mp4" type="video/mp4" /> </video> <button class="button">play</button>
and jquery is
$(document).ready(function(){ $(".button").click(function(){ $(".video").attr("src","videos/funny cats.mp4"); }) });
the way dynamic sources going work if apply them straight video tag eg:
<video class="mvideo" controls autoplay="autoplay"></video> <button class="button">play</button> $(document).ready(function(){ $(".button").click(function(){ $("video").attr("src","videos/funny cats.mp4"); }); });
http://jsfiddle.net/xemzm/2/
source
jquery
Comments
Post a Comment