1
votes

I would like to embed an MP4 video into a webpage of mine. At first I was setting the plugin to Quicktime player, but the movie wasn't playing smoothly so I decided to use the Windows Media Player plugin. All of this works, except for users with WinXP. Is there a trick to make it work on WinXP too? This is the HTML I have used:

<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="300" height="150" data="test.mp4" url="test.mp4" type="video/x-ms-asf">
<param name="url" value="test.mp4">
<param name="filename" value="test.mp4">
<param name="autostart" value="1">
<param name="autosize" value="1">
<embed src="test.mp4" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" width="300" height="150" autostart="true" scale="tofit"></embed>
</object>
2
This is bad idea if you want it to be compatible for lot of browsers. You should consider using HTML5 to embed the videos or use Youtube/Vimeo for max compatiblity or another JS method.Simon Hayter
See my comment on Jorges reply below..Adam

2 Answers

1
votes

jwplayer is probably the best IMHO HTML5 video player

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

And rather than only specifying a single video format you would use along with mp4, ogg, webm etc so that your video would load in most browsers, and mobile devices.

This is example code with flash fallback

<script type="text/javascript" src="/jwplayer/jwplayer.js"></script>

<video height="270" width="480" id="myVideo">
  <source src="/static/bunny.mp4" type="video/mp4">
  <source src="/static/bunny.webm" type="video/webm">
</video>

<script type="text/javascript">
  jwplayer("myVideo").setup({
    modes: [
        { type: 'html5' },
        { type: 'flash', src: '/jwplayer/player.swf' }
    ]
  });
</script>

http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/22644/using-the-html5-video-tag/

0
votes

Use HTML5:

<video width="300" height="150" controls>
<source src="movie.mp4" type="video/mp4">
 Your browser does not support the video tag.
</video>

Example with events