Solved

How to embed mp4 video in web page

Posted on 2013-10-22
5
470 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 15

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 15

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 15

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Text too large in Chrome 17 83
CSS question 4 56
close pop up windows when logout or main window closes 17 85
Excel to HTML macro with inserting lines 14 51
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
The advancements in today's technology are unparalleled. Much of the technology that we have could not have been imagined twenty years ago. One of the latest additions to the list of technological advances is virtual reality. Virtual reality has an …
Viewers will get an overview of how to make and use Drum Racks in Ableton Live. Load new Drum Rack into empty MIDI track: Fill rack with audio samples: Re-arrange sample slots as necessary: Adjust parameters of each slot to tailor each sound a…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

734 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