Defer video stream

Hi,

I use the stream service, but I want to defer the loading. Basically to reduce the time for load the page.

Now I use this code:

<stream src="2b56dce9458aa30688fdf992a21973XXX" controls poster="https://XXXX/public/[email protected]"></stream>
<script data-cfasync="false" defer type="text/javascript" src="https://embed.videodelivery.net/embed/r4xu.fla9.latest.js?video=2b56dce9458aa30688fdf992a21973XXX"></script>

when I check the performance with gtmetrix, I see:

video.mpd >> 200 >> videodelivery.net >> 2.3 KB >> 800 ms to load.

is possibile to load the video (the palyer I think) later? after page is loaded?

Thanks

I’m currently testing this:

<stream src="2b56dce9458aa30688fdf992a219XXXX" controls poster="https://XXXX/public/[email protected]"></stream>

<script type="text/javascript">
function downloadJSAtOnload() {
var element = document.createElement("script");
element.src = "https://embed.videodelivery.net/embed/r4xu.fla9.latest.js?video=2b56dce9458aa30688fdf992a219XXXX";
document.body.appendChild(element);
}
if (window.addEventListener)
window.addEventListener("load", downloadJSAtOnload, false);
else if (window.attachEvent)
window.attachEvent("onload", downloadJSAtOnload);
else window.onload = downloadJSAtOnload;
</script>

and I scratched 400 ms to load

it seems strange to me that nobody cares, however, this is the solution that I have adopted now, the script is downloaded only on click on the poster, and the video starts with autoload:

<div>
   <stream src="2b56dce9458aa30688fdf992a219xxxx" autoplay muted controls></stream>
    <div id="video-poster">
	<a href='#' id='scriptdl'>
		<img border="0" alt="video-player" src="https://xxxx/poster.png" width="100%" height="100%">
	</a>
     </div>
</div>

script:

<script type="text/javascript">
  var scriptdl = document.getElementById('scriptdl');
  scriptdl.onclick = function(){

  var element = document.getElementById("video-poster");
  element.classList.add("hidden");

  var script = document.createElement("script");
  script.type = "text/javascript";
  script.src = "https://embed.videodelivery.net/embed/r4xu.fla9.latest.js"; 
  document.getElementsByTagName("head")[0].appendChild(script);
  return false;
    		    
 }
</script>

css:

div.hidden { display: none; }