Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Html Video player plays sound but not video

Im in the process of making a webpage, and im trying to insert a video. The video player loads fine, and you can press play, but only the audio plays, not the video. (When previewing in chrome) When viewing in firefox it works properly

My code is as follows...

<video width="600" height="400" controls>
  <source src="ds2.mp4" type="video/mp4">
  <source src="ds2.ogv" type="video/ogv">
  <source src="ds2.webm" type="video/webm">

Your browser does not support the video tag.

</video>

My Doctype is <!Doctype html>

I checked the MIME type, its Video/mp4. however, one of the mime requests is in red and cancelled (When checking with google dev tools networking)

Im using microsoft expression web 4 (incase it is relevant)

If i've neglected any important information please let me know and ill update the post :) Thanks in advance for your help :)

like image 416
user3578539 Avatar asked Apr 27 '14 15:04

user3578539


People also ask

What to do if video is not playing in HTML?

This is not allowed for security reasons. Open the html file locally to view the video or upload the video to the server. Chrome will give this error: Not allowed to load local resource.

Why video is not playing in HTML5?

An 'HTML5: Video file not found' error indicates either the browser you are using doesn't support HTML5 or the webpage doesn't have the proper video codec. You may contact the website's developer to install HTML5 supporting codecs for all the three WebM, MP4, and OGG formats.

How do I make a video playable in HTML?

HTML allows playing video in the web browser by using <video> tag. To embed the video in the webpage, we use src element for mentioning the file address and width and height attributes are used to define its size. Example: In this example, we are using <video> tag to to add video into the web page.

Can we play both audio and video in HTML?

HTML5 Audio and Video are two new media elements used to add media content like, a song, a movie etc. Both of these elements are used to add media content on a webpage. Chrome 3+, Firefox 3.5+, safari 4+ and IE 9+ supports both Audio and Video tags.


1 Answers

Your problem is with the file encoding. HTML5 supports very few types and, sadly, every browser can play only part of this narrow list.

If you convert your mp4 file to H.264 encoding it will work on chrome and IE9 and above, but apparently due to patent issues, firefox does not support it but will play it if the OS can play it. This is really annoying and still require the use of players in order to play files in not-supported browsers.

like image 138
Gil Avatar answered Sep 28 '22 04:09

Gil