video not loading in html5

Sredny M Casanova picture Sredny M Casanova · Nov 4, 2015 · Viewed 7.1k times · Source

I'm having a problem with the HTML5 video player, doesn't show the video, in a html file I have:

<video>
          <source src="video.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
          Video tag not supported.
<video>

I even tried without the codec atributte in chrome I gets nothing, only the black square of the reproductor

the file video.mp4 is inside the same folder of the html, it doesn't even show a preview, nothing!

Answer

Akshaya Raghuvanshi picture Akshaya Raghuvanshi · Nov 4, 2015

It should work with HTML5 video tag perfectly. I've put an example for your reference.

<video controls="" autoplay name="media">
    <source src="http://www.html5rocks.com/en/tutorials/video/basics/devstories.mp4" type="video/mp4;codecs="avc1.42E01E, mp4a.40.2"">
</video>