Solved

How to embed mp4 video in web page

Posted on 2013-10-22
5
434 Views
Last Modified: 2013-10-22
I have an mp4 video and I would like to play it automatically on my web page. What code do I need in my html? Thanks for your help.
0
Comment
Question by:romsom
  • 3
  • 2
5 Comments
 
LVL 14

Expert Comment

by:Giovanni Heward
ID: 39592600
<video width="320" height="240" controls>
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
  <object data="movie.mp4" width="320" height="240">
    <embed src="movie.swf" width="320" height="240">
  </object>
</video> 

Open in new window

0
 

Author Comment

by:romsom
ID: 39592632
Unfortunately it is not working when I place the code in my html.
The video is in the same folder, and I can play it by right clicking it and selecting play. It is called SFO.mp4 so I customized the code above like this
<video width="320" height="240" controls>
  <source src="SFO.mp4" type="video/mp4">
  <source src="SFO.ogg" type="video/ogg">
  <object data="SFO.mp4" width="320" height="240">
    <embed src="SFO.swf" width="320" height="240">
  </object>
</video>

Open in new window

When I open my page an alert pops up saying "An ActiveX control on this page might be unsafe to interact with other parts of the page. Do you want to allow this interaction?" If I click yes, a media player window pops up and the following error message is displayed: Windows Media Player cannot find the file. If you are trying to play, burn, or sync an item that is in your library, the item might point to a file that has been moved, renamed, or deleted.
I wonder why this happens.
0
 
LVL 14

Expert Comment

by:Giovanni Heward
ID: 39592698
The other extensions were provided as an example, in an HTML5 compliant browser, try...

<video width="320" height="240" controls>
  <source src="SFO.mp4" type="video/mp4">
  <object data="SFO.mp4" width="320" height="240">
    <embed src="SFO.mp4" width="320" height="240">
  </object>
</video>
0
 
LVL 14

Accepted Solution

by:
Giovanni Heward earned 500 total points
ID: 39592707
If that fails you could try an embedded video player, such as

http://www.longtailvideo.com/jw-player/download/
http://www.videojs.com/

etc.

This site has a product which will create the code for you.

http://easyhtml5video.com/
0
 

Author Closing Comment

by:romsom
ID: 39592731
It is working fine when I play it on my computer, but when I upload it to the server I get the ActiveX message described above. Thank you for the links, I will use them.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
This article discusses how to create an extensible mechanism for linked drop downs.
Viewers will learn the basics of making and using Impulse Kits in Ableton Live. Load new Impulse into an empty MIDI track: Fill the 8 empty sample slots with drum samples: Adjust parameters to tailor each sound as desired: Proceed to create be…
Viewers will learn the basics of creating custom device Racks in Ableton Live. Place instrument(s) and effects onto a track, and select them all by holding the Shift key and clicking on the device title bars: Group them by typing Command-G (Ctrl-G…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now