Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to embed mp4 video in web page

Posted on 2013-10-22
5
Medium Priority
?
540 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Viewers will learn the basics of using Ableton Live's advanced sampler instrument, Sampler. Load new Sampler into an empty MIDI track: Select a sample and drop it into sample window in Sampler: Adjust pitch if necessary with Root Key setting: …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

610 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