javascript - Multiple mp4 requests in Chrome stuck in 'pending' -


i have list of films (buttons) - when user clicks - performs ajax request update video tag's source attribute. before loading new video (.load()), video element cloned, removed, re-inserted dom (this fix safari bug). see code below:

//load in new paths var contentvideos = $("#projectsmedia video source"); contentvideos.each(function () {     if ($(this).attr("src").lastindexof("mp4") !== -1) {         $(this).attr("src", videopath + ".mp4");     } else if ($(this).attr("src").lastindexof("ogv") !== -1) {         $(this).attr("src", videopath + ".ogv");     } else if ($(this).attr("src").lastindexof("webm") !== -1) {         $(this).attr("src", videopath + ".webm");     } });  //clone vid, delete, reload safari bug var clonedvid = $("#projectsmedia video").clone(); $("#projectsmedia video").remove(); clonedvid.insertafter($("#projectsmedia h1")); $("#projectsmedia video")[0].load(); 

this works fine browsers, chrome seems throwing spanner works. when new path put src attribute , video loaded, chrome takes anywhere between 2 second infinity load video.

opening dev console, found mp4 file being downloaded multiple times (an apparent feature of chrome), , requests stuck in pending indefinite amount of time , video loads within 10 seconds. see screenshot.

enter image description here

another curios behaviour in chrome on page refresh (or button-click perform new ajax request), if dev console not open, opening force mp4 load, , works fine.

does know of solution this?


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -