Cast for two

Showing posts with label adobe. Show all posts
Showing posts with label adobe. Show all posts

Friday, August 31, 2007

Embedding MP4 in HTML with Flash 9 beta Moviestar

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>

Thursday, August 30, 2007

Drupal + Flex : Adobe becoming good netizen ?

Benevolent dictator of Drupal, Dries Buytaert, announced that he has tipped his tows into Adobe Flex technology. A bit surprising given Drupal's open source approach. It looks like Adobe is tipping their tows into open source because they contributed to Drupal as well. Adobe also announced and released their beta Flash player nicknamed moviestar that supports advanced MPEG-4 audio and video (the systems part (.mp4 files), the High Efficiency AAC and Advanced Video Coding AVC Part 10 to be more precisely). Meaning that within a year more then 90 percent of the browsers will be able to play video content based on a open standard. Something only Quicktime could do. The Quicktime player is ok but the implementation on Windows was always beyond standards with regards to performance. Maybe Adobe's move will force Apple to improve their Windows implementation. Fullscreen functionality that came with version 7.2 is already a step into the good direction. May the best win!

I've made a small test to embed a MPEG-4 file but no succes. The file is loaded but does not play with the beta player installed. For your reference, this is the code I used:


<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"

codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,18,0"

id="fullscreen" align="middle" height="224" width="384">

<param name="allowFullScreen" value="true">
<param name="movie" value="test.mp4">

<param name="bgcolor" value="#333333">

<embed src="test.mp4" allowfullscreen="true"

bgcolor="#333333" name="fullscreen" type="application/x-shockwave-flash"

pluginspage="http://www.macromedia.com/go/getflashplayer"

align="middle" height="224" width="384">

</object>

The file test.mp4 is in the same directory as the html page. Maybe the mime type is not ok ?