From Jeroen Wijering I found a way to play MP4 movies in a webpage using the new Flash Version 9 beta, nicknamed Moviestar. It uses SWFObject to embed a Flash file using Javascript and the mediaplayer by Jeroen.
This is the code:
<script type="text/javascript" src="swfobject.js"></script>
<p id="player1">
<a href="http://www.macromedia.com/go/getflashplayer">
Get the Flash Player</a> to see this player.
</p>
<script type="text/javascript">
var s1 = new SWFObject("mediaplayer.swf","single","384","224","7");
s1.addParam("allowfullscreen","true");
s1.addVariable("file","test.mp4");
s1.addVariable("image","preview.jpg");
s1.addVariable("overstretch","none");
s1.addVariable("smoothing","false");
s1.write("player1");
</script>
In the same directory above code is residing, store
swfobject.js
,test.mp4
,preview.jpg
and mediaplayer.swf
.The result looks like this:
I don't understand yet when clicking on fullscreen, the video does not resize but that's probably an option of mediaplayer I have to enable. Also, I have the impression the movie is first downloaded before playback starts. I am quite sure the header atoms in
test.mp4
are in front of the file. So the movie should faststart. Here is an example where it does work. Any suggestions welcome in the comment.UPDATE:
leaving out the overstrech variable so that is get the default true value, stretches the movie to fullscreen in fullscreen mode. No problem now with the fast start. So the code becomes:
<script type="text/javascript" src="swfobject.js"></script>
<p id="player1">
<a href="http://www.macromedia.com/go/getflashplayer">
Get the Flash Player</a> to see this player.
</p>
<script type="text/javascript">
var s1 = new SWFObject("mediaplayer.swf","single","384","224","7");
s1.addParam("allowfullscreen","true");
s1.addVariable("file","test.mp4");
s1.addVariable("image","preview.jpg");
s1.write("player1");
</script>