Created
November 12, 2016 06:31
-
-
Save amitmbee/d11e652b49f6851f0ef8ac7786de53e3 to your computer and use it in GitHub Desktop.
HTML5 Video function for modals
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#playbtn").on('click', function() { | |
var video = document.getElementById(videoid); | |
video.play() | |
}); | |
function stopVideo(videoid) { | |
var video = document.getElementById(videoid); | |
video.pause(); | |
video.currentTime = 0; | |
} | |
//Now you can use stopVideo() method to stop HTML5 video. Like, | |
$("#stopbtn").on('click', function() { | |
stopVideo("videoid"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment