JSFiddle - React, Tailwind, and code Playground

HTML

<video id="video" src="http://clips.vorwaerts-gmbh.de/VfE_html5a.mp4" autoplay="true">
  
</video>

JavaScript

//video valido: http://clips.vorwaerts-gmbh.de/VfE_html5.mp4
//video invalido: http://clips.vorwaerts-gmbh.de/VfE_asasasasashtml5.mp4

var teste = function(e) {
	console.log('foi');
}

var video = document.getElementById('video');
video.onerror = function(e) {
	console.log('2');
}