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?
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).
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.
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.
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.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With