thefoundationhttp://www.thefoundation.de2010-07-16T19:13:28Z(c) 2012 Michael Kurze, Aachen, Germany1LIVE - Dein Leben Lang2010-07-16T19:13:28ZMatthias Schulzhttp://www.thefoundation.de/about/matthias1live-dein-leben-lang<p>In January the <a href="http://bildundtonfabrik.de">BTF Team</a> produced a two minutes commercial for <a href="http://einslive.de">1LIVE</a> - the largest german youth radio station</p><object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=9859295&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=9859295&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object><p><a href="http://vimeo.com/9859295">1LIVE - Dein Leben Lang</a> from <a href="http://vimeo.com/bildundtonfabrik">bildundtonfabrik</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>
This film was the fastest project we ever worked on. From beginning to public release we only had two weeks. We shot on the <a href="http://red.com">RED One</a> and did the editing with Final Cut Pro. Typography and animation was added with After Effect and 3d Studio Max.
</p>
The <a href="http://www.einslive.de/medien/html/1live/2010/02/01/1live-dein-leben-lang.xml">spot</a> on the 1LIVE Website.QuickTime Reference Movies in Python2010-07-01T22:53:07ZDavid Murmannhttp://www.thefoundation.de/about/davidquicktime-reference-movies-python<p>HTML5 video is on its way, and Apple likes to use reference movies to
send different versions of movies to different clients. So, how do
you generate these if you don't have OSX handy (for example on a
server)?
</p><p>This is pretty much the premise of a little tool I wrote to generate
QuickTime reference movies. It is written in Python, because it is to
be used in a Django app that handles video uploads and encodes. Well,
that and because I <em>love</em> Python! There isn't much else to say, so here
is the code if you are interested:</p>
<p><code class="block">hg clone http://bitbucket.org/dmurmann/root pyqtref</code></p>
<p class="annotation notice center">This is very much alpha software, it may fail horribly for you!</p>
<p>The simplest possible example, generating a reference movie to 'content.mov' looks like this:</p>
<p><code class="block">from pyqtref import *
ref_mov = Movie(ReferenceMovie(Descriptor(
DataReference('content.mov')))).to_bytes()</code></p>
<p>The boilerplate is necessary, because the API is pretty close to the <a href="http://developer.apple.com/mac/library/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-25756">Quicktime File Format Specification</a>.</p>
Björk »Wanderlust« in 3D2009-03-17T18:37:26ZMatthias Schulzhttp://www.thefoundation.de/about/matthiasbjork-wanderlust-3d<p><a href="http://bjork.com/">Björk's</a> music video of her single »Wanderlust« was produced stereoscopic and can be watched only in the internet.</p><p>
This is already some time ago, but I decided to post this here anyway. Since we are planning to do some of our future project stereoscopic, we studied a lot about stereoscopic imagery and motion picture during the last few month.
</p>
<p>
You can watch the video <a href="http://www.wired.com/entertainment/music/news/2008/04/bjork_wanderlust_3d_video">here</a>.
</p>
To watch the video you need to have a pair of red/cyan (blue) glasses, otherwise the two embedded images will not separate properly. You can get those glasses on <a href="http://shop.ebay.com/items/?_nkw=3d+glasses&_sacat=0&_fromfsb=&_trksid=p3286.m270.l1313&_odkw=stereo+glasses&_osacat=0">ebay</a>.
<p>
<h2>The Making of »Wanderlust«</h2>
</p>
<p>
<youtube id="nmaPLKerqOA" />
</p>
Cheonan Architecture Visualization2009-01-15T00:01:16ZMatthias Schulzhttp://www.thefoundation.de/about/matthiascheonan-architecture-visualization<p>With Lichtkunstlicht we worked on an animated visualization of a complex, two layered media facade of a new Galleria store in Cheonan, South Korea.</p><p>
Daniel, David, Julian and me met at our new production studio in Cologne. We had to complete the project within six days, so we had to start immediately. Fortunately Julian already worked on the 3d model of the building so we didn't lose too much time during our main production phase.
</p>
<p>
The idea was to previsualize a facade concept of the light design agency <a href="http://www.lichtkunstlicht.de">Licht Kunst Licht</a>. The architects from <a href="http://www.unstudio.com/">UNStudio</a> designed a facade consisting of two layers. Each layer has its own structural bearing so that the facade seems to be transforming while the spectator changes his perspective. <a href="http://www.lichtkunstlicht.de">LichtKunstLicht's</a> concept was to seamlessly integrate an invisible media facade between the two layers. <abbr title="Light Emitting Diode">LEDs</abbr>, placed on the inner side of the outer facade layer, projected their light onto the milky inner layer. Over the main entrances of the building a high resolution facade is also seamlessly composed into the architecture. There is also a smooth transition between the high resolution and the low resolution parts of the facade.
</p>
<p>
It was very important for the design concept that the integration of the facade would serve the art of the architecture rather than operating as a screen for information or advertisement.
</p>
<p>
<gallery slug="cheonan-production">CHEONAN production team</gallery>
</p>
<h2>The final visualization:</h2>
<p>
<youtube id="UIHbZe2MFMw" />
</p>
AERenderer and its flaws2008-11-01T19:24:45ZDaniel Beckerhttp://www.thefoundation.de/about/danielaerenderer-and-its-flaws<p>The render system coming with <a href="http://www.adobe.com/products/aftereffects/">After Effects</a> provides a sophisticated set of configuration dialogs. Be careful using these options!</p><p>Working for the illuminated facade of the <a href="http://www.sparda-hessen.de/">Spardabank Hessen e.G.</a> headquarter in <a href="http://maps.google.de/maps?hl=de&q=osloer+stra%C3%9Fe+1+frankfurt&ie=UTF8&ll=50.108456,8.654931&spn=0.008284,0.022745&z=16&g=osloer+stra%C3%9Fe+1+frankfurt&iwloc=addr">Frankfurt</a> we have several giant (up to about 7000 pixels wide) After Effects compositions. Some of these setups take hours and hours in the process of rendering.<br />Due to different needs, we do not always need the full resolution. Fortunately the AERenderer has this small dialog to reduce the actual size a composition is rendered at: <code>Render every [n]th pixel.</code> Unfortunately this will not work as expected in every composition!</p>
<p>One would presume, that the rendering of just every umpteenth pixel works like a pre-rendering-resizing and besides speeds up the whole process because the pixels in between are not computed.<br />Not knowing exactly what causes errors at this step, I presume that there is a incompatibility of some plug-ins with this functionality of the renderer. Which is especially irksome, since some of the most performance-consuming effects will cause errors in the final display, <abbr title="exempli gratia">e. g.</abbr> the glow effect.</p>
<p>The last composition I had to render wanted to have about 50 hours of full power from my MacBook Pro (2.33 gigahertz, 2 gigabyte RAM) in full resolution. The rendering of every twentieth pixel resulted in a way darker image, than the full resolution rendering. Large parts of the composition are lightened by the mentioned glow effect. In the end I decided to render full resolution in low quality. This took about twenty hours.</p>
<p>Maybe Adobes hands are tied since some plug-ins are programmed by third parties, but at least the default effects supplied by Adobe should work properly. Perhaps this option is not used frequently, so that there is low interest in solving this problem. Perhaps just few people know about this possibility. Anyhow Adobe should improve the rendering process as soon as possible.</p>Music Video »Wolke - Kleine Lichter«2008-10-04T16:10:02ZMatthias Schulzhttp://www.thefoundation.de/about/matthiasmusic-video-wolke-kleine-lichter<p>Together with <a href="http://www.korati.de/">Dino Korati</a> and Reto Gnad I created this low budget video clip for the Cologne based band <a href="http://www.wolke-koeln.de/">Wolke</a>.</p><youtube id="DJsqw2xts2U" />
<h2>Making the Video:</h2>
<p>The title of the song means <cite>small lights</cite> so we came to the idea to work with video projections of the <a href="http://www.wolke-koeln.de/">two singers</a> on walls around the city. Starting with miniature projections we wanted to let them grow during the video until they fill entire buildings. <br/>
We shot the projection video for our location shoot in the <a href="http://www.khm.de">KHM</a> studio. The two singers <a href="http://www.wolke-koeln.de/">Oliver and Benedikt</a> performed in white suits in front of black, so our projection will not have borders where the projection ends.<br/>
We shot two days at night in Düsseldorf and we were equipped with a 220V generator, a video projector, a macbook to play back our videos and DV Camcorder. Several location later we had a lot of footage of our band performing across walls, pipes, etc. .<br/>
The postproduction of this videos was actually very easy because we only had to edit it. People keep asking me about the amount of work, because it looks like a lot of tracking and compositing work. It's actually all captured directly with the camcorder, except the last three shots, where the singers perform on large buildings.
</p>
The Foundation Showreel 20082008-09-21T01:42:13ZMatthias Schulzhttp://www.thefoundation.de/about/matthiasreel-2008<p>This <cite>showreel</cite> represents our visual effects and animation work of the past 3 years. It includes 3d work from <a href="/david/">David</a> and <a href="/on/animation/" title="articles on animation">animation</a> and <a href="/on/compositing/" titles="articles on compositing">compositing</a> work from <a href="/daniel/">Daniel</a> and me. </p><youtube id="41RT9SCHZB8" />
<p>
In April I edited this <cite>showreel</cite> with nearly all the projects we finished during the past years. From short school projects to recent <a href="/on/compositing/" titles="articles on compositing">compositing</a> jobs. It mainly contains non commercial work we did, but work with our most creative output.<br/>
I especially thank Jan for his crazy intro sound mix for my title displace animation. Excluded of this <cite>showreel</cite> are short films and recent projects we are working on right now. I hope to soon find the time to update this <cite>showreel</cite> because there are several visually interesting projects nearly finished.
</p>Integrating a plug-in into JW-Player 2008-09-20T02:06:41ZDaniel Beckerhttp://www.thefoundation.de/about/danielintegrating-plugin-jw-player<p>If you spent time watching web videos in the popular <abbr title="Flash Video"><a href="http://www.adobe.com/devnet/flash/articles/video_guide.html">FLV</a></abbr> format you might have stumbled upon the <a href="http://www.jeroenwijering.com/?item=JW_FLV_Media_Player">Jeroen Wijering player</a>. Version 4.1 features a plug-in interface – which I found pretty much undocumented.</p><p>In the following article I will try to give you a short insight on how to integrate plug-ins into the free and open-source Flash video player by <a href="http://www.jeroenwijering.com/">Jeroen Wijering</a>. All techniques described in this article worked with version 4.1.</p>
<h2>JW-Player plug-ins</h2>
<p class="annotation notice center">There are some restrictions for commercial use of the player. You have to apply for a commercial license at <a href="http://www.jeroenwijering.com/?page=order">http://www.jeroenwijering.com/?page=order</a></p>
<h3>What is JW-Player?</h3>
<p>In my eyes this player is a masterpiece in structured programming regarding the <abbr title="Model-View-Controller"><a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC</a></abbr> architectural pattern. The source is as modular as possible so it can easily modified to fit new requirements. As an example it can be adapted to display videos from other sources (<abbr title="exempli gratia">e. g.</abbr> <a href="http://youtube.com/">YouTube</a>) by adding a new class as a <q>submodel</q>. The player allows <a href="http://code.jeroenwijering.com/trac/wiki/FlashSkinning">skinning</a> and provides a wide range of <a href="http://code.jeroenwijering.com/trac/wiki/FlashVars">settings</a> as well as an useful <a href="http://code.jeroenwijering.com/trac/wiki/FlashAPI">JavaScript interface</a>. While the majority of possibilities is documented in the <a href="http://code.jeroenwijering.com/trac">Wiki</a> I could not find any helpful information about the plug-ins. Maybe due a lack of time, perhaps because this possibility could be used to emulate the functionality of <a href="">longtail video</a> – a side project of Jeroen Wijering.<br />But this is just speculation so let us start over! This article will not give you turnkey sources nor will it be a full tutorial on how this or that could be realized with the JW-Player. I presume that you have already been dealing with Adobe Flash in a basic matter, so you can use my depictions as foundation for your own projects.</p>
<h3>How to integrate plug-ins</h3>
<p class="annotation warning left">You will need to have the <a href="http://www.miniml.com/">kroeger 05/63</a> pixel font installed / activated to not break the default player skin layout!</p><p>First you should get the source files and create an <abbr title="HyperText Markup Language">HTML</abbr> file which loads the JW-Player in order to set up a test-bench. In the next step we will create a Adobe Flash file to house our plug-in functionality. First and foremost the size and frame rate does not matter, however I suggest you to choose a size around 300x200 pixels – which should be <del>both, somewhat around the default as well as </del><ins>slightly smaller than the default size and </ins>the smallest display, the video player should be used with. This way you can layout your plug-in and perhaps add a script for scalable display later. Wether you will use scripts or not, you need to define a function called <q>initialize</q>. Otherwise the player will throw an error!<br />The plug-in <abbr title="ShockWave File"><a href="http://www.adobe.com/devnet/swf/">swf</a></abbr> should be published somewhere relative to your test <abbr title="HyterText Markup Language">HTML</abbr> file at best similar to later production environments. In the following code snippets I will assume, that the plug-in is placed in a subdirectory <q>media/flash/plugins/</q> and is called <q>plug-in.swf.</q><br />We will now pass some values to the JW-Player swf making use of the so-called flashvars. (I am sorry, I really tried to find some information about flashvars on the official sites of Adobe. I could not find anything helpful even in the <a href="http://livedocs.adobe.com/flash/9.0/">livedocs</a>. Except some outdated samples for <a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16417">Flash 6</a> and the use with <a href="http://www.adobe.com/livedocs/flash/9.0/main/wwhelp/wwhimpl/js/html/wwhelp.htm?href=00000887.html">ActionScript 2.0</a> which in this case are best of a basic use to understand what we are talking about. Perhaps someone can help out here? As there are several common ways to implement Adobe Flash in todays webpages I will attach a short paragraph containing samples of flashvar use at the end of this article.) Let us give the JW-Player a hint where to look for the plug-in. Add the flashvar <code>plugin</code> with the relative path to our plug-in as value, in our case <code>media/flash/plugins/plug-in.swf</code>. Your <abbr title="HyperText Markup Language">HTML</abbr> code should look somewhat like this:</p><code class="block"><object type="application/x-shockwave-flash"
data="player.swf"
width="300px"
height="200px" >
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<em><param name="flashvars" value="plugins=media/flash/plugins/plug-in.swf" /></em>
<param name="quality" value="high" />
<p>Please get the Adobe Flash Player!</p>
</object>
</code>
<p class="annotation notice right">Be sure to use the relative path originated at the <abbr title="HyperText Markup Text">HTML</abbr> document – not the <abbr title="ShockWave File"><a href="http://www.adobe.com/devnet/swf/">swf</a></abbr>!</p><p>Yes, it is as easy as that! Now your plug-in should be loaded automatically. But wait! Offline everything works fine, but the Flash player is not able to find the plug-in on the server. After some investigation, we know why there are troubles: We have to navigate through the ActionScript package of the JW-Player to the main view class (com → jeroenwijering → player → View.as). Just at the end of the class header there is a private string <q>directory</q> with an <abbr title="Uniform Resource Locator"><a href="http://en.wikipedia.org/wiki/URL">URL</a></abbr> assigned as value: <q>http://plugins.longtailvideo.com/</q>. Perhaps this is a hint at how the plug-in interface usually gains utilization. If you set the <q>directory</q> value to be an empty string (like this <code>private var directory:String = "";</code>) the whole thing should work online. (Better way to solve this problem would be, <q>take the deep dive into this piece of code and understand what really is happening here</q> before removing some hardcoded value.)<br />From now on the rest is just some ActionScript wherewith we can do some magic! Since the code of the video player is well-structured and nearly every event you could imagine is dispatched all you have to do is: listen to the certain part (Model, View, Controller) and invoke some action!</p>
<h3>The fun part – ActionScript!</h3>
<p>Here we go: Include the View-class and declare a variable to hold the reference to the players View-instance:</p>
<code class="block"> // includes
import com.jeroenwijering.player.View;
// variables
// Reference to View-instance of video player
var v_player:View;
</code>
<p class="annotation note right">At this point, lazy guys, there is no short version, no <q>init</q>, no programmers stenography!</p><p>And again, Jeroen Wijering made life with plug-ins easy. If you set up a function called <q>initialize</q> it will be called as soon as your plug-in is properly loaded by the player:</p>
<code class="block">…
// Called after loading of plugin is completed
function initialize( par_playerView:View ) {
v_player = View( par_playerView );
trace( "do something useful" );
}
</code>
<p>The simple call to do something does not help much. I will give you an example of what could come next. For example it would be handy if the plug-in content would be centered if the player is resized! Let us assume we have a movie clip containing a graphic (<code>mc_content</code>, movie clip registration point should be on the top left) which should be horizontally centered and positioned somewhere above the vertical center (since there is this nice button to start the playback). But this graphic should disappear on playback start. We have to start with adding some lines to our plug-ins code <q>header</q>, furthermore we will instantiate a transition manager to handle a nice fade out of our plug-in content:</p>
<code class="block"> // imports
// video player stuff
import com.jeroenwijering.player.View;
import com.jeroenwijering.events.ModelEvent;
import com.jeroenwijering.events.ModelStates;
import com.jeroenwijering.events.ControllerEvent;
// eye candy
import fl.transitions.Fade;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.Transition;
import fl.transitions.TransitionManager;
// variables
// Reference to View-instance of video player
var v_player:View;
// Transition manager
var trnsmngr_content:TransitionManager = new TransitionManager( mc_content );
// functions
// Configure standard transitions used to fade plugin content in and out
var obj_contentFadeOut:Object = new Object();
obj_contentFadeOut.type = Fade;
obj_contentFadeOut.direction = Transition.OUT;
obj_contentFadeOut.duration = .7;
obj_contentFadeOut.easing = Regular.easeOut;
var obj_contentFadeIn:Object = new Object();
obj_contentFadeIn.type = Fade;
obj_contentFadeIn.direction = Transition.IN;
obj_contentFadeIn.duration = .7;
obj_contentFadeIn.easing = Regular.easeOut;
…
</code>
<p>Now we have to set up some functions to handle the positioning of the content elements and kick-off the vanishing of this content element on playback.</p>
<code class="block">…
// Invoked on resize
function onPlayerResize( par_arg ) {
alignContent( Number( par_arg.data.width ), Number( par_arg.data.height ) );
}
// Align content movie clip
function alignContent( par_width:Number, par_height:Number ) {
mc_content.x = Number( par_width / 2 - mc_content.width / 2 );
mc_content.y = Number( par_height / 2 - ( mc_content.height + 40 ) );
}
// Invoked on status change of video player
// - if playback has finished: fade in plugin content
// - if playback is (re-)started: hide plugin content
function onPlayerStateChange( par_arg ) {
if( par_arg.data.newstate == "COMPLETED" ) {
trnsmngr_content.startTransition( obj_contentFadeIn );
}else if( par_arg.data.newstate == "PLAYING" && par_arg.data.oldstate == "COMPLETED" ) {
trnsmngr_content.startTransition( obj_contentFadeOut );
}
}
…
</code>
<p>Obviously, the next thing to care about: event listeners! The listeners are registered in our <q>initialize</q> function:</p>
<code class="block">…
// Called after loading of plugin is completed
function initialize( par_playerView:View ) {
v_player = View( par_playerView );
v_player.addControllerListener( ControllerEvent.RESIZE, onPlayerResize );
v_player.addModelListener( ModelEvent.STATE, onPlayerStateChange );
alignContent( v_player.config.width, v_player.config.height );
}
</code>
<p>Now everything should work fine. The content will be realigned if the player should ever be resized on runtime (not very likely) and faded out on playback start or in respectively on playback end. To initially align the content, there is one line added, which calls <code>alignContent</code>. For convenience, the whole clump of code:</p>
<code class="block"> // imports
// video player stuff
import com.jeroenwijering.player.View;
import com.jeroenwijering.events.ModelEvent;
import com.jeroenwijering.events.ModelStates;
import com.jeroenwijering.events.ControllerEvent;
// eye candy
import fl.transitions.Fade;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.Transition;
import fl.transitions.TransitionManager;
// variables
// Reference to View-instance of video player
var v_player:View;
// Transition manager
var trnsmngr_content:TransitionManager = new TransitionManager( mc_content );
// functions
// Configure standard transitions used to fade plugin content in and out
var obj_contentFadeOut:Object = new Object();
obj_contentFadeOut.type = Fade;
obj_contentFadeOut.direction = Transition.OUT;
obj_contentFadeOut.duration = .7;
obj_contentFadeOut.easing = Regular.easeOut;
var obj_contentFadeIn:Object = new Object();
obj_contentFadeIn.type = Fade;
obj_contentFadeIn.direction = Transition.IN;
obj_contentFadeIn.duration = .7;
obj_contentFadeIn.easing = Regular.easeOut;
// Invoked on resize
function onPlayerResize( par_arg ) {
alignContent( Number( par_arg.data.width ), Number( par_arg.data.height ) );
}
// Align content movie clip
function alignContent( par_width:Number, par_height:Number ) {
mc_content.x = Number( par_width / 2 - mc_content.width / 2 );
mc_content.y = Number( par_height / 2 - ( mc_content.height + 40 ) );
}
// Invoked on status change of video player
// - if playback has finished: fade in plugin content
// - if playback is (re-)started: hide plugin content
function onPlayerStateChange( par_arg ) {
if( par_arg.data.newstate == "COMPLETED" ) {
trnsmngr_content.startTransition( obj_contentFadeIn );
}else if( par_arg.data.newstate == "PLAYING" && par_arg.data.oldstate == "COMPLETED" ) {
trnsmngr_content.startTransition( obj_contentFadeOut );
}
}
// Called after loading of plugin is completed
function initialize( par_playerView:View ) {
v_player = View( par_playerView );
v_player.addControllerListener( ControllerEvent.RESIZE, onPlayerResize );
v_player.addModelListener( ModelEvent.STATE, onPlayerStateChange );
alignContent( v_player.config.width, v_player.config.height );
}
</code>
<p>There are some additional things you should know while working with this nice player and its plug-in possibilities. Let me give you some arbitrary dodges!</p>
<dl>
<dt><code>v_player.config.[any name]</code></dt>
<dd>If you pass your own flashvars to the JW-Player, you can get the value of certain variables by this path plus your variable name at the end. It would be easy to display the videos title if you pass the flashvar <q>title</q>. You just need a textfield and assign the value <code>v_player.config.title</code>.</dd>
<dt><code>v_player.config.volume</code>, <code>v_player.config.width</code>, <code>v_player.config.height</code>, <code>v_player.config.fullscreen</code></dt>
<dd>There is a bunch of information in the config object of the View-instance. Here you can get the current value, width and height of the player, as well the configuration wether fullscreen is allowed and implemented or not (Nevertheless you cannot alter the state of fullscreen here! See below). To get information about the current display state watch <code>v_player.skin.stage[ "displayState" ]</code><br />If you want to know more, have a look in the Player class' (com → jeroenwijering → player → Player.as) <q>defaults</q> object!</dd>
<dt><code>v_player.sendEvent( [event], [value] )</code></dt>
<dd>Using the function <q>sendEvent</q> you can take control of various parts of the player. Set volume to 50 % by using following code: <code>v_player.sendEvent( "VOLUME", 50 )</code>, set player into fullscreen mode: <code>v_player.sendEvent( "FULLSCREEN", true )</code> or seek to closest keyframe to second two: <code>v_player.sendEvent( "SEEK", 2 )</code>.</dd>
<dt><code>v_player.addViewListener</code>, <code>v_player.addModelListener</code>, <code>v_player.addControllerListener</code></dt>
<dd>Like shown in the sample, you have the possibility to add listeners to every part of the player (Model, View, Controller). For further information about the various events, have a look at the <q>events</q> part of the player class package (com → jeroenwijering → events → *).</dd>
</dl>
<p class="annotation hint center">In the above samples, I assume you work in the plug-in of this tutorial. Otherwise the <code>v_player</code> has to be replaced by your reference to the View-instance of the JW-Player!</p><p>This article is not meant as a full featured tutorial to a full working this-and-that-performing plug-in, rather an insight on the different parts of plug-in programming for JW-Player with some short examples.</p>
<p class="annotation warning center">I am not quite sure about the legal matters on the use of JW-Player with altered code. So please check the information on <a href="http://www.jeroenwijering.com/">Jeroen Wijerings homepage</a> or contact him to assure you are not cracking anything besides the legal regulations here!</p>
<h2>Flashvars in todays webpages</h2>
<p>As mentioned before, there are several ways of integrating Flash files into webpages. Today a lot of people use JavaScript to embed Flash movies, there is the famous <a href="http://code.google.com/p/swfobject/">swfobject</a> as well as the Standard Adobe Flash way to use <a title="Not exactly what I wanted, but for sure interesting further reading for the use of AC_FL_Content." href="http://www.adobe.com/devnet/activecontent/articles/devletter.html">AC_FL_RunContent</a>. One main reason to use JavaScript is the outline rectangle the InternetExplorer shows up and which forces you to click on the Flash movie once, before you can interact with the movie. Moreover there is a check if the correct version of Adobe Flash Player is installed on the client machine.<br />Next we have the former standard way using markup with <code>object</code>- and <code>embed</code>-tags to integrate flash. Finally there is one possibility, first shown in an <a href="http://www.alistapart.com/articles/flashsatay/">A List Apart</a> article (for more information please visit: <a href="http://latrine.dgx.cz/how-to-correctly-insert-a-flash-into-xhtml">http://latrine.dgx.cz/how-to-correctly-insert-a-flash-into-xhtml</a>) to integrate Flash XHTML-Strict valid with markup and without the <code>embed</code>-tag which is in fact a relic from times with Netscape.<br />For each of these methods I will give you a short code snippet on how to pass Flashvars. This is known and far from being new, but get this as a compact reference for the most popular ways to integrate Flash.</p>
<h3>Flashvars and markup methods for Flash integration</h3>
<p>First the markup methods, in the following example the former standard way:</p>
<code class="block"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com
/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
width="300px"
height="200px" >
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<param name="movie" value="player.swf" />
<em><param name="flashvars" value="plugins=media/flash/plugins/plug-in.swf&title=A%20shortfilm" /></em>
<embed src="player.swf"
<em>flashvars="plugins=media/flash/plugins/plug-in.swf&title=A%20shortfilm"</em>
quality="high"
width="300px"
height="200px"
allowScriptAccess="sameDomain"
allowFullScreen="true"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
<param name="quality" value="high" />
<p>Please get the Adobe Flash Player!</p>
</object>
</code>
<p>In this example we pass the variables <q>plugin</q> and <q>title</q> to the <abbr title="ShockWave File"><a href="http://www.adobe.com/devnet/swf/">swf</a></abbr>. You can append as much variables as you needed, as long as you keep the pattern: seperate the variables using the ampersand <q>&</q>, assign value by using the equal sign <q>=</q>: <code>&[variable name]=[value]</code>.<br />Now for the XHTML-Strict compatible method. Analogue to the sample at the beginning of this article, passing Flashvars would look like this:</p>
<code class="block"><object type="application/x-shockwave-flash"
data="player.swf"
width="300px"
height="200px">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<em><param name="flashvars" value="plugins=media/flash/plugins/plug-in.swf&title=A%20shortfilm" /></em>
<param name="quality" value="high" />
<p>Please get the Adobe Flash Player!</p>
</object>
</code>
<p class="annotation notice right">Variable names must not contain any special characters (as usual in ActionScript), the values should be <a href="http://www.w3schools.com/TAGS/ref_urlencode.asp"><abbr title="Uniform Resource Locator">URL</abbr>-encoded</a>.</p><p>In the first example you have to declare the variables and values <u>twice</u> to assure, that every browser (using either the <code>object</code>- or the <code>embed</code>-tag) gets the correct values!</p>
<h3>The JavaScript way</h3>
<p>Since the JavaScript methods are kinda proprietary, you have to find the correct solution for every specific JavaScript Flash integration. So, the following examples feature specific code for the <q>AS_FL_RunContent</q> (first) and the <q>swfobject</q> (second) method:</p>
<code class="block"><script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires \"AC_RunActiveContent.js\".");
} else {
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
'width', '300',
'height', '200',
'src', 'player',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'id', 'player',
'name', 'player',
'allowFullScreen', 'true',
'allowScriptAccess','sameDomain',
'movie', 'player',
<em>'FlashVars', 'plugin=media/flash/plugins/plug-in.swf&title=A%20shortfilm'</em>
); //end AC code
}
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
width="300"
height="200"
id="player"
align="middle" >
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<param name="movie" value="player.swf" />
<em><param name="flashvars" value="plugins=media/flash/plugins/plug-in.swf&title=A%20shortfilm" /></em>
<embed src="player.swf"
<em>flashvars="plugins=media/flash/plugins/plug-in.swf&title=A%20shortfilm"</em>
quality="high"
width="300"
height="200"
name="player"
allowScriptAccess="sameDomain"
allowFullScreen="true"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
<param name="quality" value="high" />
<p>Please get the Adobe Flash Player!</p>
</object>
</noscript>
</code>
<p>Be sure to pass the Flashvars in the JavaScript code, as well as in the <code>object</code>-tag as <code>param</code>-tag and in the <code>embed</code>-tag as attribute <q>flashvars</q>.<br />Finally, the <q>swfobject</q> method:</p>
<code class="block"><script type="text/javascript" src="swfobject.js"></script>
<div id="playerContainer">
This is a flash video player.
</div>
<script type="text/javascript">
var so = new SWFObject("player.swf", "player", "300", "200", "9");
<em>so.addVariable("plugin", "media/flash/plugins/plug-in.swf");
so.addVariable("title", "A shortfilm");</em>
so.write("playerContainer");
</script>
</code>
<h2>Sample sources</h2>
<p>The Flash source codes are uploaded here:<br /><a href="/files/daniel/sources/jwplayer-plugin.zip">ZIP file containing plugin.fla</a><br />Set up an <abbr title="HyperText Markup Language">HTML</abbr> document with flashvars <q>plugins</q> and <q>title</q>:</p>
<code class="block">plugins=[path to plug-in.swf without extension]&title=[video title]</code>
<p>Outcome should be a headline showing the video title on the JW-Player <q>splash screen</q>.</p>