Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple video's on a single page Not loading all the video's Chrome

I'm loading multiple video's on a single page,

My code snippet is something like,

<div class="video_content left">
    <span style="font-weight:bold">1</span>
    <video  width="213" height="120" controls class="video_tag">
        <source src="<MY VIDEO SOURCE>" type="video/mp4" />
    </video>
</div>
<div class="video_content left">
    <span style="font-weight:bold">2</span>
    <video  width="213" height="120" controls class="video_tag">
        <source src="<MY VIDEO SOURCE>" type="video/mp4" />
    </video>
</div>
<div class="video_content left">
    <span style="font-weight:bold">3</span>
    <video  width="213" height="120" controls class="video_tag">
        <source src="<MY VIDEO SOURCE>" type="video/mp4" />
    </video>
</div>
<div class="video_content left">
    <span style="font-weight:bold">4</span>
    <video  width="213" height="120" controls class="video_tag">
        <source src="<MY VIDEO SOURCE>" type="video/mp4" />
    </video>
</div>

Sometimes I'll get 20+ video's on a single page, so that time I'll create those many video tags.

Whenever I try this code in my localhost it works fine, but if I host this code in remote server and try only few video's will be loading, but in my chrome inspect element there is no error message.

I tried re-loading video's one by one using JQuery with some time interval, that time I'll be getting "Provisional headers are shown" kind of warning in chrome's Inspect element.

Could anyone please help me to fix this issue?

Thanks in advance.

like image 799
harishkumar329 Avatar asked Oct 06 '14 06:10

harishkumar329


People also ask

Why some videos are not playing in Chrome?

Some video or game issues are caused by Chrome extensions, plugins, or something saved in your cache or browser data. On your computer, open Chrome. New Incognito Window. In the Incognito window, go to the site with the video or game.

How do you fix embedded videos not playing on Chrome?

Methods to Fix Embedded Videos Not Playing in Google Chrome Update Google Chrome. Update Adobe Flash Player. Disable Hardware Acceleration Plugins in Chrome. Disable Adblock on Chrome.

Why is my phone not playing videos on Chrome?

For instance, a change in the device's network settings could have blocked something, causing the video not to play in Chrome mobile. To fix this, you can go to your device's Settings > System > Reset and tap on the "Reset Network Settings" option.

How to fix when Google Chrome does not load videos?

Whenever Google Chrome does not load properly or web videos do not play on it, turn off Hardware Acceleration in the browser settings. Steps to disable Hardware Acceleration: Go to Settings in the Chrome menu. Under Advanced scroll down and select System.

How to speed up the loading of videos on Chrome?

Reset the Internet Connection of Your System: To achieve a speedy loading and playing of videos on your Chrome, you should reset your internet connection and start from afresh. How do you do this?

How to play videos properly on Chrome?

Play videos properly on Chrome by following the solutions and steps that are described in this section below: 1 Use Chrome's Incognito Mode:#N#Although the incognito mode doesn't imply that external sites cannot track you, it helps... 2 Reset the Internet Connection of Your System: More ...

Why won’t my videos play in chrome on Windows 10?

You may sometimes find your videos won’t play in Chrome (or another browser) on Windows 10. Why? The video or game issues are usually caused by Chrome extensions, plugins, and something saved in your cache the browsing data. To fix this, you’ll need to open Chrome on Windows, then, clear cache & cookies and browsing history by following steps.


2 Answers

Chrome limits the number of videos/audio files to 4 or 6 (I can't remember which) so, as brianchirls mentions, you need to set the preload attribute, although you need to set it to none.

My recommendation is to provide a poster image (via the poster attribute) for all your videos and to set preload="none" to all of them. That way the browser only actually tries to load them if the user actively clicks the play button.

Alternatively you could set the first 4/6 videos with preload="metadata" and the rest to preload="none".

like image 86
Ian Devlin Avatar answered Nov 15 '22 13:11

Ian Devlin


That can be a lot of data for the browser to download all at once, depending on how big the file is and how fast and far away the server is. Try giving each video tag a preload attribute and set it to "metadata". Like this:

<video  width="213" height="120" controls class="video_tag" preload="metadata">

That should limit the number of files the browser needs to load all at one time, only loading the header of each video file. The rest of the file will load once you start playing. If that doesn't work, try setting preload to "none".

Also, you'll want to make sure the remote server is using HTTP Byte Serving. i.e., the HTTP status header on the video files should be "206 Partial Content", not "200 OK".

like image 25
brianchirls Avatar answered Nov 15 '22 13:11

brianchirls