Stop all HTML5 videos from playing

This snippet will stop all HTML videos on a page from playing by looping through any video tags found and calling the 'pause' function.

$('video').each(function()
{
    $(this)[0].pause();
});

Note that all videos are placed in a paused state, so they will pick up where they left off if resumed.

Sign Up
comments powered by Disqus
Sign Up

Popular Tags

350x250

Need a web developer?

If you'd like to work with code synthesis on your next project get in touch via the contact page.