Jump to content

I'm trying to embed a movie


T1000Android

Recommended Posts

Hi all. I'm trying to embed a movie into my test html page but it doesn't work. I used this code:

<video id="testMovie" src="spacetest.mp4" controls preload autoplay width="800" height="600" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'></video>

All I get is a grey player saying: "Video format or MIME type is not supported" The questions are: 1. Is there something wrong with the code?2. What am I doing wrong?3. Do I need to run it through my server in order for it to work? I only tried with my XAMP server off, directly through the browser. Thanks in advance.

Link to comment
Share on other sites

I think the issue is the browser. You will need to re-encode your video in WebM or OGV formats as well as your existing mp4. ex.

<video id="video" controls='controls'>  <source src="videos/clip.mp4" type="video/mp4"/>  <source src="videos/clip.webm" type="video/webm"/>  <source src="videos/clip.ogv" type="video/ogg"/>  Your browser doesn't seem to support the video tag.</video>

Link to comment
Share on other sites

I found the web page with that code and it still doesn't work. My movie is mp4 so it should work. How does youtube embed videos? Is it with <embed>, <object> or < video>?
I understand you tried the code but the sources of each video format needs to be there for them all to work otherwise it is the same thing you are doing now. So unless you converted the video to all three types I assume it is not working.
Link to comment
Share on other sites

Ok! I've converted the movie to all 3 formats and it does work. I have to mention that this does work only through the server when using the code OTTO suggested:

<video id="video" controls='controls'>  <source src="videos/clip.mp4" type="video/mp4"/>  <source src="videos/clip.webm" type="video/webm"/>  <source src="videos/clip.ogv" type="video/ogg"/>  Your browser doesn't seem to support the video tag.</video>

Why is that? Shouldn't it work simply through the browser? The movie plays using quicktime player, not flashplayer as I expected. How do I use flash player like youtube?The code doesn't work in IE, sorry to say. How do I make it work in IE? Thanks guys. You have been very helpful so far.

Edited by T1000Android
Link to comment
Share on other sites

Youtube doesn't use the <video> element. They use a Flash player which they programmed themselves in Actionscript.To embed a Flash player, put the SWF file on your site and use the <object> element to embed it.

<object type="application/x-shockwave-flash" data="file.swf" width="X" height="Y">    <param name="movie" value="file.swf"></object>

Browsers don't have an in-built flash movie player. If you're seeing quicktime it probably means you're looking at your site with Safari.

Link to comment
Share on other sites

Thanks for the code. I'll try it. I'm looking at my site in Mozilla and IE9, not Safari (I don't have Safari). It won't even work in IE9. It just jumps down to:"Your browser doesn't seem to support the video tag." EDIT1: OOPS!Looks like my IE9 is broken. I went to a site with a non-flashplayer video and I got an error: "Internet Explorer cannot open the Internet Site www.blabla.com- operation aborted" Looks like I need some plugins. EDIT2: I converted the video to swf and it does work in flash using the code you gave me. Controls are added using javascript or flash? Thanks a bunch.

Edited by T1000Android
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...