To make this into a listener, under normal circumstances, you'll want to listen to the suspend event. It's triggered when download is paused or stopped for any reason, including it's finished.
You'll also want to listen to playing for the cases when the content is already loaded (like, from cache)
video.addEventListener("playing", function() { console.log("[Playing] loading of video"); if ( video.readyState == 4 ) { console.log("[Finished] loading of video"); }});video.addEventListener("suspend", function(e) { console.log("[Suspended] loading of video"); if ( video.readyState == 4 ) { console.log("[Finished] loading of video"); }});
Source: https://developer.mozilla.org/en/docs/Web/Guide/Events/Media_events