I would like to preload a video when the user hovers a link. (The link takes you to a new page, and the videos are not on the page with the links). Currently, when the user clicks the link, there is a short pause before the video loads - I would like to remove this pause. When the user hovers the link, it seems like a good opportunity to download the video so that if they decide the click the link, their experience is smoother.
CONS: The user may not click the link, wasted bandwidth
PROS: Smoother experience
I have tried using preload on the video tag on the destination page. This doesn't help.
I have also tried nesting the video in the link, hidden, with preload set to false, and then used some JS to switch the preload to auto/true on hover - this doesn't download the file ahead of time - I presume the DOM is already built at this point and the change is picked up.
The HTML:
<a class="preload" href="link.html">
<h4>Title</h4>
<p>Text</p>
<video class="hide" src="vid.mp4" preload="false">
</a>
THE JS:
$('.preload').mouseenter(function(){
var vid = this.childNodes[5];
vid.preload = true;
});
The video preload changes to 'true' (or 'auto'), but in the Chrome network tab, the video is not being downloaded.
So - what's a good way to pre-fetch this video, based on the users intent (hover) - and is it such a bad idea? I've read a few posts that say it can be a drain for lurkers who never click on the links!