video.js simultaneous videos playing - pause or stop other videos HTML5 flash


/ Published in: ActionScript 3
Save to your folder(s)

stop other videos playing, HTML5 and flash


Copy this code and paste it in your HTML
  1. $('audio,video').bind('play', function() {
  2. activated = this;
  3. $('audio,video').each(function() {
  4. if(this != activated) this.pause();
  5. });
  6. });
  7.  
  8.  
  9. //flash - prevent simultaneous video playback - pauses other playing videos upon play
  10. $(".video-js").click(function(){
  11. activated = this;
  12. $('.video-js').each(function() {
  13. if(this != activated) _V_($(this).attr("id")).pause();
  14. });
  15. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.