html5 - Pause video playing within <embed> Jquery -
i can find answer independent video tag , not 1 embed in html5 embed tag.
this problem: using ajax file i'm getting array of different type of files sources (mp4, pdf,xls,doc,etc) in order populate webpage. after retrieving json array, use following line of code populate:
$("#modal-body").append('<div class="embed-responsive" style="padding-bottom:80%"><embed src="'+ $path +'" width="800px" height="500px" style="text-align:center;" /></div>');
now, everytime click on file expanded modal window. in case of video, when modal window appears,it automatically starts play. wish when user closes modal window video pause or stop.
however, when triggering jquery .click() event closing modal window, nothing happens.
$("#modalbtn").click(function(){ $("#modal-window").toggleclass("invisible");// hide modal window $("video").each(function () { this.pause() }); });
i have noticed works if dealing single <video></video>
not <embed><video></video></embed>
can help?
Comments
Post a Comment