Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Video embedded into HTML doesn't play

I am trying to accomplish a very simple task; at least I would think it should be but its not.

I am trying to embed video into HTML and nothing I try seems to works. Here is the code I am using to do it:

<video width="560" height="340" controls>
    <source src="video/30.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>  
    <source src="video/30.ogv" type='video/ogg; codecs="theora, vorbis"'>

    <object width="640" height="384" type="application/x-shockwave-flash"   data="video/player_flv_maxi.swf?image=placeholder.jpg&file=video/30.swf">
    <param name="movie" value="video/player_flv_maxi.swf?image=placeholder.jpg&file=video/30.swf" />
    </object>
</video>

I am using this resource to try and accomplish this: http://www.webmonkey.com/2010/05/embed-videos-in-your-web-pages-using-html5/

I also have tried: http://www.w3schools.com/html/html5_video.asp

And none of those seem to work. Can someone please tell me why none of the video formats I have listed above play in Google Chrome? Is there something wrong with the code?

like image 922
Frank G. Avatar asked Apr 21 '14 07:04

Frank G.


People also ask

Why isn't my video playing on HTML?

The video files are not in the right place on the server, so you're getting 404 or 503 errors on them. The video files are not encoded correctly in a way the browser can play them. This may be the case if the wrong codec was used or if the bit rate is way too high (not super likely).

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.

How do I embed an MP4 video in HTML?

The <vid eo> element allows us to embed video files into an HTML, very similar to the way images are embedded. Attributes we can include are: src This attribute stands for the source, which is very similar to the src attribute used in the image element. We will add the link to a video file in the src attribute.

How do you embed an embedded video in HTML?

To embed a video in an HTML page, use the <iframe> element. The source attribute included the video URL. For the dimensions of the video player, set the width and height of the video appropriately. The Video URL is the video embed link.


1 Answers

I figured out what my problem was. It has to do with including the MIME Type to your IIS. I found this webpage that got me up and running in know time:

http://blog.arvixe.com/to-play-mp4-video-in-asp-net-you-may-need-to-add-a-mime-type/

Make sure if you are running Mircosoft IIS that you have the MIME Type added to IIS so IIS knows what to do when someone tries to load a mp4 video type. Thanks all for the help!

like image 100
Frank G. Avatar answered Nov 03 '22 02:11

Frank G.