Videos inside tabs play at the same time in IE but works fine in Mozila Firefox :

I'm using but I’m having issue with I.E , Chrome
I’ve videos in 3 different tabs , but in I.E & Chrome all tabs starting playing when pages loads but in Mozila Firefox it starts playing when u click on tab.
I want each tab to starts works when someone click on it (starts fresh)
Can anyone please tell me how to fix this ??

Dani AI

Generated

reported that videos in each tab all begin playing at page load in IE and Chrome while Firefox waits until a tab is opened. asked for the URL and supplied one, which helps reproduce the behavior. A common and reliable way to fix this is to stop relying on browser autoplay of hidden media and explicitly control playback when a tab becomes active.

Remove any autoplay attributes and set preload="none" on the video elements, then use the tab-activation event to pause/reset all videos and start only the one in the active panel. Example jQuery approach (bind to the tab click/activate used by the tabs script):

$(".tabs a").on("click", function() {
  var target = $(this).attr("href");
  $("video").each(function() {
    this.pause();
    this.currentTime = 0;
  });
  $(target).find("video").each(function() {
    this.play();
  });
});

If the site uses Flash/embedded players or third-party widgets (YouTube, JWPlayer, Flowplayer), use their JavaScript API to stop or pause playback on tab hide and start on show. For verification, inspect the elements in DevTools for autoplay/preload and test removing autoplay first. Reference documentation: HTML video element and the HTMLMediaElement API (play/pause).

Recommended Answers

All 3 Replies

I'm willing to pay if anyone can help me fixing it around !!

I don't think it's a good idea to offer money here. Let's see what I can do. First, I need a url. Post it here and I'll know about it.

i'm sorry but i was not getting any reply to this solution well here is my url => ,
you will see Jquery tabs in the middle of the page where it has 3-4 tabs playing video files...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.