T1000Android Posted February 22, 2013 Share Posted February 22, 2013 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 More sharing options...
OTTO Posted February 22, 2013 Share Posted February 22, 2013 Here try this. <video id="testMovie" width="800" height="600" controls preload autoplay><source src="spacetest.mp4" type="video/mp4"></video> Link to comment Share on other sites More sharing options...
T1000Android Posted February 22, 2013 Author Share Posted February 22, 2013 (edited) No, sorry, I get the same thing. I tried playing it through the server and through the browser, same result. What next? I got it to work using quicktime player but I want it to work using the same player as youtube(flashplayer). Edited February 22, 2013 by T1000Android Link to comment Share on other sites More sharing options...
OTTO Posted February 22, 2013 Share Posted February 22, 2013 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 More sharing options...
T1000Android Posted February 22, 2013 Author Share Posted February 22, 2013 (edited) 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>? Edited February 22, 2013 by T1000Android Link to comment Share on other sites More sharing options...
Wolverine Posted February 22, 2013 Share Posted February 22, 2013 Try this URL: http://w3schools.com/html/html_youtube.asp .Also what browser are you using maybe if we know that it will help. Link to comment Share on other sites More sharing options...
OTTO Posted February 22, 2013 Share Posted February 22, 2013 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 More sharing options...
T1000Android Posted February 23, 2013 Author Share Posted February 23, 2013 @Wolverine: I am using Firefox 18.0.2 @OTTO: Ok, I'll try it. Link to comment Share on other sites More sharing options...
OTTO Posted February 23, 2013 Share Posted February 23, 2013 @Wolverine: I am using Firefox 18.0.2 @OTTO: Ok, I'll try it.Follow my instructions, in order to make it cross browser compatible. MP4 is not supported in firefox. Link to comment Share on other sites More sharing options...
T1000Android Posted February 23, 2013 Author Share Posted February 23, 2013 Oh, well that clears the problem. I'll convert the movie today and post the results. Thanks! Link to comment Share on other sites More sharing options...
T1000Android Posted February 24, 2013 Author Share Posted February 24, 2013 (edited) 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 February 24, 2013 by T1000Android Link to comment Share on other sites More sharing options...
Ingolme Posted February 24, 2013 Share Posted February 24, 2013 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 More sharing options...
T1000Android Posted February 24, 2013 Author Share Posted February 24, 2013 (edited) 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 February 24, 2013 by T1000Android Link to comment Share on other sites More sharing options...
T1000Android Posted February 24, 2013 Author Share Posted February 24, 2013 (edited) Ok, I have 1 final question: Why doesn't my video (not the flash one) work without a server? And how do I select which player to use? Edited February 24, 2013 by T1000Android Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now