thefoundationhttp://www.thefoundation.de2009-10-20T22:41:22Z(c) 2012 Michael Kurze, Aachen, GermanyiTunes Library Management2009-10-20T22:41:22ZDaniel Beckerhttp://www.thefoundation.de/about/danielitunes-library-management<p>iTunes does a great job in playing music. Once your library is set up iTunes works like charm, at least on a mac. But when you want to keep a custom folder structure or manage unsorted or badly tagged mp3 files iTunes really sucks.</p><p>There is a whole bunch of mp3 files with really bad ID3 tags in my music folder (which by the way is from a time when <a href="http://www.winamp.com/">Winamp</a> was almost the only way to playback mp3 files). Then some <abbr title="Compact Disc">CDs</abbr> were ripped without connection to the <a href="http://en.wikipedia.org/wiki/CDDB">CDDB</a>, thus have only the artist and album field tagged. Furthermore the aforementioned <a href="http://www.winamp.com/">Winamp</a> does a great job displaying files which do not contain any ID3 data. Which of course results in files without any data in iTunes – especially if you simply drop them into iTunes without switching off library management! Bad idea.</p>
<p>Since quite a while now I am working on cleaning up my iTunes library. I am following a strategy of small steps. Every time I stumble upon a badly or incompletely tagged file I take my time to correct and complete all the data.</p>
<p>On my way to the pedanticly uncluttered library I came across some helpers which saved me a lot of time – perhaps you already know them, they were new to me!</p>
<h3>TriTag</h3>
<p><a href="http://www.feedface.com/software/tritag.html">TriTag</a> converts filenames to ID-Tags and vice versa. You can define a pattern which then will be translated into ID3 tags. Before you apply your pattern you will get a preview, even a Pattern builder is included (though you won't need it)! This tool is so damn helpful, I can hardly imagine how I managed managing my music all these years without having a tool like this at hand.</p>
<p>Get the tool at the developers site:<br />
<a href="http://www.feedface.com/software/tritag.html">http://www.feedface.com/software/tritag.html</a></p>
<h3>MP3 Scan+Repair</h3>
<p>Some of my mp3 files were rejected by iTunes, no matter wether I tried importing them via file menu or just dropped them into my library. Re-encoding of mp3 files is no solution, since you're loosing sound quality. Finder and VLC played the affected files just fine, but my <span title="/Applications/Utilities/Console.app">Console</span> caught an error thrown by VLC during playback of the bad files: <code>org.videolan.vlc: [mp3 @ 0x8b7a10]Header missing</code><br />The fact that obviously my files were missing some important information, suggested to alter my search pattern from <q>blaming iTunes for rejecting my files</q> to <q>how to repair mp3 files</q>.<br />This finally led me to <a href="http://triq.net/mac/mp3-validator-mac-os-x">MP3 Scan+Repair</a> (previously named MP3 Validator) which solved the problem faster than I could imagine.</p>
<p>Get MP3 Scan+Repair at the developer's site:<br />
<a href="http://triq.net/mac/mp3-validator-mac-os-x">http://triq.net/mac/mp3-validator-mac-os-x</a></p>
<h3>Get Lyrical</h3>
<p>Okay, this last one is not really needed, but it does a great job completing your meta information! <a href="http://shullian.com/get_lyrical.php">Get Lyrical</a> automatically fetches lyrics from <a href="http://lyrics.wikia.com/">http://lyrics.wikia.com/</a> and saves them in the lyrics field of iTunes. This is especially nice if you own an iPhone which displays the lyrics on your standby screen during playback!</p>
<p><a href="http://shullian.com/get_lyrical.php">Get Lyrical</a> is available at:<br /><a href="http://shullian.com/get_lyrical.php">http://shullian.com/get_lyrical.php</a></p>
<p class="annotation notice center">You can download the three tools for free. Please consider to make a donation to the developers. In particular as these tools might save you quite a lot of time!</p>Avast! Everybody talk pirate now!2009-09-29T22:47:41ZDaniel Beckerhttp://www.thefoundation.de/about/danieleverybody-talk-pirate-now<p><p>Having <a href="http://en.wikipedia.org/wiki/Piracy_in_Somalia" title="Piracy in Somalia - Wikipedia, the free encyclopedia">dangerous incidents</a>, the <a href="http://www.talklikeapirate.com/" title="International Talk Like A Pirate Day – September 19th p.a.">International Talk Like A Pirate Day</a>, <a href="http://web.piratenpartei.de/" title="Piratenpartei Deutschland – especially topical with regards to the german parliamentary elections" lang="de">political parties</a> and some <a href="http://en.wikipedia.org/wiki/BitTorrent_%28protocol%29" title="BitTorrent (protocol) - Wikipedia, the free encyclopedia">web technology</a> piracy is pretty topical nowadays. After all <a href="http://www.facebook.com/">facebook</a> is on its journey to piracy, too.</p></p><p>Likely, you are aware of it already, but for me it was big news: our number one social network <q><a href="http://www.facebook.com/">facebook</a></q> talks pirate! Once you are logged in (this one is essential) to <a href="http://www.facebook.com/">facebook</a> you can <a href="http://www.facebook.com/ajax/intl/language_dialog.php" title="Facebook | Choose your language">switch the language</a> at the bottom left of each site (scroll down). There is a new translation in beta mode now: Pirate, arrrrr!
Discover ya new <a href="http://www.facebook.com/">facebook</a>, me hearties!</p>
<p class="annotation center notice">If you encounter problems switching back to your native tongue, visiting <a href="http://www.facebook.com/editaccount.php?language">http://www.facebook.com/editaccount.php?language</a> might help. Choose your language from the drop-down menu, after a page reload everything should be back to normal again!</p>Die Klimaschützer2009-07-06T17:28:16ZDaniel Beckerhttp://www.thefoundation.de/about/danieldie-klimaschutzer<p>Start using green energy – install the <a href="http://apps.facebook.com/dieklimaschuetzer/">Carbon Clock</a> on your Facebook-Profile or homepage!</p><p>Finally the <a href="http://apps.facebook.com/dieklimaschuetzer/">Carbon Clock</a> is online! The Layout was created by <a href="http://www.widjet.de/">widjet</a>, my task was the Flash and programming stuff. It is my first <a href="http://facebook.com">Facebook</a>-Application! After some struggle with the <a href="http://developers.facebook.com/">API</a> the application works fine – needless to say, I am a bit proud!<br />Depending on the installs of this application, the Carbon Clock shows how many carbon dioxide is prevented from emitting by users of green energy.</p>
<div style="width:184px;height:250px;text-align:center"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="184" height="225" id="CarbonClock" align="middle"> <param name="allowScriptAccess" value="always" /> <param name="allowFullScreen" value="false" /> <param name="movie" value="http://klima.stromauskunft.de/application/media/main.swf?wid=4a4dfaa1d1b04826&pid=4a5214a7bd60dc6b" /> <param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /> <param name="flashvars" value="wid=4a4dfaa1d1b04826&pid=4a5214a7bd60dc6b&getAppUrl=http://www.clearspring.com/widgets/4a4dfaa1d1b04826" /> <embed src="http://klima.stromauskunft.de/application/media/main.swf?wid=4a4dfaa1d1b04826&pid=4a5214a7bd60dc6b" flashvars="wid=4a4dfaa1d1b04826&pid=4a5214a7bd60dc6b&getAppUrl=http://www.clearspring.com/widgets/4a4dfaa1d1b04826" quality="high" bgcolor="#ffffff" width="184" height="225" name="CarbonClock" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object><a href="http://www.stromauskunft.de/de/html/oekostrom/klimaschuetzer.html" style="font-size:12px;color:#6198C2;font-family:Helvetica,Arial,sans;display:block;padding-top:4px">Mach mit! Werde Klimaschützer!</a></div>
<p>Click the <q>Wer macht mit?</q>-Button to <a href="http://www.clearspring.com/widgets/4a4dfaa1d1b04826">install the widget</a> on your homepage or go to <a href="http://apps.facebook.com/dieklimaschuetzer/">the Facebook-Application</a> and install <q>Die Klimaschützer</q> to your profile!</p>
<p>Since I felt lost sometimes during the development, I soon will write down my experiences and techniques in a short article.</p>
<p>
<script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US"></script>
<script type="text/javascript">FB.init("590725159c942c465f24ecb1efdc2d2d");</script>
<fb:fan profile_id="69907595492" stream="" connections="" width="400"></fb:fan>
</p>How to bring AS3 Tweens to an end2009-03-24T19:28:52ZDaniel Beckerhttp://www.thefoundation.de/about/danielhow-bring-as3-tweens-end<p>Have you ever assigned a tween to a local variable? Have you ever detected non-determining tweens, tweens which do not start at all? Blame ActionScript 3.0's ruthless garbage collector!</p><p>Back then in the old days of ActionScript 2.0 scripts like the following were just as easy as useful to program sequences of animations (<abbr title="exempli gratia">e. g.</abbr> assembling animations for site sections):</p>
<code class="block">
function transitionToolTip():void {
var toolTipAlpha:Tween = new Tween( toolTip, "alpha", Regular.easeOut, 0, 1, .75, true );
toolTipAlpha.addEventListener( TweenEvent.MOTION_FINISHED, handleToolTipTransition );
}
function handleToolTipTransition( e:TweenEvent ):void { … }
</code>
<p class="annotation notice right">Just to make things clear: The ActionScript 3.0 garbage collector does a good job in deleting these local variables. Obviously the ActionScript 2.0 garbage collector should have done this way, too.</p><p>In most cases one does not want to stop or modify tweens after firing them, thus one won't need a reference to the exact tween ever again. The next function would be triggered after the tween has finished. Great!<br />But, nowadays things are different. ActionScript 3.0's garbage collector seriously and unrelentingly works on what it is supposed to work: deleting everything with a lack of relation. In the sample case, shown above, this clearly means that the variable <code>toolTipAlpha</code>, declared with local scope of function <code>transitionToolTip</code> will be deleted – taking along our tween if the garbage collection cycle is awkward. In consequence our tween will not play to its end.</p>
<p>One solution would be the declaration of a class level or global variable to store the reference to the tween. This would look something like this:</p>
<code class="block">
var toolTipAlpha:Tween;
function transitionToolTip():void {
toolTipAlpha = new Tween( toolTip, "alpha", Regular.easeOut, 0, 1, .75, true );
toolTipAlpha.addEventListener( TweenEvent.MOTION_FINISHED, handleToolTipTransition );
}
function handleToolTipTransition( e:TweenEvent ):void { … }
</code>
<p class="annotation notice center">All the samples are in short form and not taken from real-life ActionScript 3.0 projects thus may not work properly. They are inserted for illustration purposes to show up possible problematics.</p>
<p>A far more elaborated description of the coexistence of tweens, variables and the garbage collector can be found on <a title="Scott Morgan – LA Flash and Flex Developer" href="http://www.scottgmorgan.com/">Scott Morgan's</a> <a href="http://www.scottgmorgan.com/blog/">blog</a> in the article <a title="AS3 Garbage Collection, the reason your tweens are ending early." href="http://www.scottgmorgan.com/blog/index.php/2007/11/18/as3-garbage-collection-the-reason-your-tweens-are-ending-early/">AS3 Garbage Collection, the reason your tweens are ending early.</a></p>
<p><a hreF="http://www.scottgmorgan.com/blog/index.php/2007/11/18/as3-garbage-collection-the-reason-your-tweens-are-ending-early/">via Scott Morgan's blog – http://www.scottgmorgan.com/</a></p><p class="annotation notice center">Sorry! Our Ping- and Trackback is not yet working.</p>Stuck for gift ideas?2008-12-17T00:35:30ZDaniel Beckerhttp://www.thefoundation.de/about/danielstuck-gift-ideas<p>Santa will help you out! Get some great last minute tipps from <a href="http://www.myspace.com/thewidjetsanta">Santa</a> himself directly on your own homepage!</p><h2>Santa's Last Minute Tipps</h2>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="100%" height="330" id="Santa" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="http://widjet.de/santa/santaWidget/santaWidget.swf" />
<param name="quality" value="high" /> <param name="wmode" value="transparent" />
<embed src="http://widjet.de/santa/santaWidget/santaWidget.swf" quality="high" width="100%" height="330" name="Santa" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" />
</object>
<h2>Get Santa on your homepage!</h2>
<p>This widget was programmed using the <a href="http://www.clearspring.com/">Clearspring</a> <a href="http://www.clearspring.com/services/launchpad/in-widget">In-Widget-<abbr title="application programming interface">API.</abbr></a> The layout of <a href="http://www.myspace.com/thewidjetsanta">Santa's MySpace-Site</a> and the widget was created by <a href="http://widjet.de/">widjet</a> – a cologne based agency, focused on <a href="http://en.wikipedia.org/wiki/Widget_engine">widget-development.</a><br />My part was the implementation of the widget in <a href="http://www.adobe.com/products/flash/">Adobe Flash.</a> After being doomed with the <a href="http://www.clearspring.com/services/launchpad/in-widget">Clearspring-<abbr title="application programming interface">API</abbr></a> I had fun animating Santa and his Tipps!</p>
<p>You can really look forward to see Santa's next Tipps – and be sure not to miss a single one!</p>Production days: Spardabank Frankfurt2008-11-04T21:20:23ZDaniel Beckerhttp://www.thefoundation.de/about/danielproduction-days-spardabank-frankfurt<p>Again we are having some working days in Frankfurt to finally set up the illumination of the Spardabank-Hessen e.G. headquarters' facade.</p><p><a title="Matthias Schulz" href="/matthias/">Matthias</a>, <a title="David Murmann" href="/david/">David</a> and me are sharing a room in the <a href="http://www.moevenpick-hotels.com/de/pub/ihre_hotels/worldmap/frankfurt_city/uebersicht.cfm?CFID=1710177&CFTOKEN=44466986">luxury Mövenpick Hotel</a> next to the <a href="http://www.messefrankfurt.com/corporate/en/">Frankfurt Trade Fair</a> and – determining this choice – <span title="French: literally »face to face«" lang="fr">vis-à-vis</span> with the <a href="http://www.sparda-hessen.de/">Spardabank-Hessen e.G.'s</a> <a href="http://maps.google.de/maps?hl=de&q=osloer+stra%C3%9Fe+1+frankfurt&ie=UTF8&z=16&g=osloer+stra%C3%9Fe+1+frankfurt&iwloc=addr">headquatres</a>!</p>
<photo slug="production-days-spardabank-frankfurt-2" size="display">Elevator crammed with equipment</photo>
<p>After arriving on last sunday afternoon, we built up our tentative office in the top floors room 737. All together we have five computers, including two notebooks and one PC serving as main render client. This way we are able to keep on working, while our creations get rendered.
Our daily routine includes working on <a href="http://www.adobe.com/products/aftereffects/">AfterEffects</a>-compositions till afternoon, <span lang="fr" title="French: literally »in passing«">en passant</span> rendering new and final compositions as well as test screens. During todays blue hour we took some footage of the building gaining the hindmost, steelblue sunbeams of this wonderful autumn day.</p>
<photo slug="production-days-spardabank-frankfurt-4" size="display">David, working</photo>
<p>Night is the time to check out how our work takes effect on the facade. From the roof garden of our hotel, we document which parts of our animation need to be altered and which geometric shapes are recognizable or not. Nearly every sequence of moving lines, dots, shapes and colors has to be altered again and again to get this last little dodge, which makes most of the capabilities of the LED-lightened facade. In the end there should exist a looped <q>movie</q>, shown on the facade from dawn till midnight.</p>
<photo slug="production-days-spardabank-frankfurt-6" size="display"></photo>
<photo slug="production-days-spardabank-frankfurt-10" size="display"></photo>
<p>We have two days left to get some new themes running on the <a href="http://www.sparda-hessen.de/">Spardabank's</a> facade. I am looking forward to show you some video footage of the facade, up to now this footage is still waiting to be edited. Maybe this article will see an update with video soon!</p>
<gallery slug="production-days-spardabank-frankfurt">Production Days: Spardabank Frankfurt</gallery>
<p>By the way we are following the first predictions of the <q><abbr title="short for »President of the United States«">Potus</abbr></q> elections, presented by <a href="http://ard.de/"><abbr title="Arbeitsgemeinschaft der öffentlich-rechtlichen Rundfunkanstalten der Bundesrepublik Deutschland">ARD</abbr></a> on the giant, muted flatscreen dangling off the wall right beside my workstation! Exciting!</p>Test your color IQ2008-11-03T02:07:47ZDaniel Beckerhttp://www.thefoundation.de/about/danieltest-your-color-iq<p>Have you ever tested your perceptivity of color? An interesting test can be passed at the <a href="http://www.xrite.com/custom_page.aspx?PageID=77">xrite color <abbr title="intelligence quotient">IQ</abbr> test</a>.</p><p>Somehow I was fascinated. The <a href="http://www.xrite.com/custom_page.aspx?PageID=77">test</a> was fun to do and cost me several minutes – dragging and tossing each color field from left to right and <span lang="la" title="from Latin: the other way around">vice versa</span>. I ended up, getting this screen:</p>
<photo slug="color-iq-test" size="display" />
<p>Needless to say, I am a bit proud. Nonetheless, I see the problems with this method of testing ones <q>color <abbr title="intelligence quotient">IQ</abbr></q>.<br />This little test maybe a fun game to train your perception of colors. But it is unsuitable to compare the results with other peoples ability to sort little motley squares – unless you perform the test at the identical display! A display calibrated with high contrast should make it easier to score well in this test.</p>
<p>Furthermore, this test does not tell anything about a persons ability to chose suitable, harmonic colors or to deal with color composition, which would be the real <q>intelligence of colors.</q></p><p>Despite all these aspects, the interaction with this small application was kind of enlightening for me: As a designer (or artist) I should be able to handle the <q>technical part</q> of colors. I should be able to sort colors in matters of hue, saturation, brightness. Otherwise I will not be able to work reliable and reasonable with this important segment of design!</p><p class="annotation notice center">Persons working in the area of screen and/or print media should know the basics about color models like the <a title="Have a look at the very detailed and revealing article at Wikipedia" href="http://en.wikipedia.org/wiki/Rgb"><abbr title="short for red, green, and blue">RGB-</abbr></a> or <a title="Have a look at the very detailed and revealing article at Wikipedia" href="http://en.wikipedia.org/wiki/Cmyk"><abbr title="short for cyan, magenta, yellow, and key (black)">CMYK</abbr></a> color models.</p>
<p><a hreF="http://www.qxm.de/digitalewelt/081013-1019/farb-iq">via Michael Preidel's <q>esse est percipi</q> – http://qxm.de/</a></p><p class="annotation notice center">Sorry! Our Ping- and Trackback is not yet working.</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>SSH Tunnel Manager icon2008-10-20T19:06:16ZDaniel Beckerhttp://www.thefoundation.de/about/danielssh-tunnel-manager-icon<p>If you ever worked in a non-optimal development environment, which required the setup of several <abbr title="Secure Shell"><a href="http://en.wikipedia.org/wiki/Ssh">SSH</a></abbr>-tunnels, you probably fell back on using the <a href="http://projects.tynsoe.org/en/stm/">SSH Tunnel Manager</a>, and very likely you got irritated by the pinkish and stylized sketch of a tunnel and flower which appeared in your <a href="http://en.wikipedia.org/wiki/Mac_OS_X_Dock">Dock</a>.</p><photo slug="ssh-tunnel-manager-icon-previews-2" size="display">Sketch of the icon</photo>
<p>Opening Photoshop, dusting my <a href="http://www.wacom.com/intuos/">Wacom-Tablett</a> were the first things I did, after extensively working on a project, assisted by this tiny and incredibly helpful application called <q><a href="http://projects.tynsoe.org/en/stm/">SSH Tunnel Manager.</a></q> This application really sped things up and I really appreciate <a href="http://tynsoe.org/">Yann Bizeuls</a> work although I am getting to love the bash more and more these days! To make peace between my Dock and the SSH Tunnel Manager I sketched a small image of a mole. This image is only restricted suitable as an application icon – but far more pleasant to the eye, than this tunnel. Just my 2¢.<br />Perhaps I will find time to improve this icon a bit. Nonetheless, from a realistic point of view I can promise: it will never fit the correct guidelines and detailed style guides, <a title="Apple Human Interface Guidelines: Icons" href="http://developer.apple.com/documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGIcons/chapter_15_section_1.html">Apple</a> released! Sorry for that.</p>
<photo slug="ssh-tunnel-manager-icon-previews-1" size="display">The final icon</photo>
<h2>Changing the icon</h2>
<h3>Reclaim your <a href="http://en.wikipedia.org/wiki/Mac_OS_X_Dock">Dock</a>!</h3>
<p>This is easy. Select the <q>mole.icns</q> from the attached <a href="/files/daniel/images/Icon_SSH-Tunnel-Manager.zip">ZIP-file</a> (see below) and hit <span title="COMMAND - c">⌘ – c</span>. Now open the <code>Get Info</code> (<span title="COMMAND - i">⌘ &ndash i</span>) inspector for <a href="http://projects.tynsoe.org/en/stm/">SSH Tunnel Manager</a> from your <a href="http://www.apple.com/macosx/features/finder.html">Finder's</a> Application window. Click on the small icon in the upper left (there should be a blue glow around) and hit <span title="COMMAND - v">⌘ – v</span>. The old icon should be replaced by the mole.</p>
<h3>This is for you, hard-boiled <abbr title="Graphical User Interface">GUI</abbr> fetishists</h3>
<p class="annotation left warning">Any changes will be at your own risk. The author of this text will not be liable for any damages, direct or consequential.</p><p>If the <a href="http://en.wikipedia.org/wiki/Mac_OS_X_Dock">Dock</a> icon is not enough for you and the icon in the application interface also should be replaced by the curious blind mole, there is a way. Promise to be careful. Then navigate to your application folder in <a href="http://www.apple.com/macosx/features/finder.html">Finder</a> (or wherever you installed the SSH Tunnel Manager) and right-click <code>Show package content</code>. Navigate through the hierarchy <code>Contents → Resources</code> and replace the two files <q>stm.icns</q> and <q>stm.tif</q> with the two in the attached <a href="/files/daniel/images/Icon_SSH-Tunnel-Manager.zip">ZIP-file</a> (see below). Now (re-)start your SSH Tunnel Manager – you should be done!</p>
<h2>Download the icon</h2>
<p><a title="Download the icon compressed as ZIP-file here!" href="http://www.thefoundation.de/files/daniel/images/Icon_SSH-Tunnel-Manager.zip">http://www.thefoundation.de/files/daniel/images/Icon_SSH-Tunnel-Manager.zip</a></p>
<p><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/de/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/3.0/de/88x31.png" /></a><br /><span xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/StillImage" property="dc:title" rel="dc:type">SSH Tunnel Manager Icon</span> von <a xmlns:cc="http://creativecommons.org/ns#" href="http://thefoundation.de/daniel/" property="cc:attributionName" rel="cc:attributionURL">Daniel J. Becker</a> steht unter einer <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/de/">Creative Commons Namensnennung-Keine kommerzielle Nutzung-Weitergabe unter gleichen Bedingungen 3.0 Deutschland Lizenz</a>.<br />Beruht auf einem Inhalt unter <a xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://www.thefoundation.de/files/daniel/images/Icon_SSH-Tunnel-Manager.zip" rel="dc:source">www.thefoundation.de</a>.</p>
Operation e-mail2008-10-20T14:51:04ZDaniel Beckerhttp://www.thefoundation.de/about/danieloperation-email<p>E-mail communication is great …if everybody plays by the rules! A synopsis why encrypting is important and html e-mails are evil.</p><h2>Why the e-mail is dying</h2>
The communication medium e-mail's advantages is the fast and easy delivery – nowadays actual worldwide. Also as a mode of group communication e-mail has great potential which in practice is rarely exploited. Though modern spam filters and mail applications made progress in handling our mail routines undesired mails still bother. In this case I do not want to constrain <q>undesired</q> to spam mails, also newsletters or mailing list mails may be of low interest in our daily routines.
<h2>Ways to improve our e-mail workflows</h2>
<p>Todays mail applications (online as well as offline) have powerful possibilities to filter and sort out incoming mail. This way you can create various <q>inboxes</q> to sort out priorities – at least for the moment. Furthermore you can organize your newsletters in subfolders. As for me, I am subscribed to several interesting newsletters but, honestly I read them sporadically and stacked. The smart filter capabilities are also useful to sort out e-mails of certain topics in mailing lists.</p>
<p><abbr title="Internet Message Access Protocol"><a href="http://en.wikipedia.org/wiki/Imap">IMAP</a></abbr> is a nice way to keep your e-mails available everywhere. Maybe you have the possibility to redirect all your mails to one <i>central mail account</i>. This way you have all your e-mails gathered at one place, automatically filtered by recipient and moved into certain folders you have the possibility to keep different inboxes for different e-mail accounts. <a href="www.mozilla.com/thunderbird/" title="Thunderbird – Reclaim your inbox">Thunderbird</a> and <a href="http://www.apple.com/macosx/features/mail.html">Apple Mail</a> as well as the web-based e-mail application <a href="http://www.horde.org/">Horde</a> additionally provide the feature of identity management!</p><p class="annotation right">But, pst, do not tell anyone so nobody will play fast and loose with it!</p></p> Sounds a bit like conspiracy and agents! This way you are able to send e-mails from one account but use different e-mail addresses. Every mail is stored in one <abbr title="Internet Message Access Protocol"><a href="http://en.wikipedia.org/wiki/Imap">IMAP</a></abbr> sent folder – no recipient will ever notice you using another e-mail address!</p>
<h3>Fine, but where can I configure these <q>identities</q>?</h3>
<p>Just a short overview on how to configure these so-called identities in: <a href="www.mozilla.com/thunderbird/" title="Thunderbird – Reclaim your inbox">Thunderbird</a>, <a href="http://www.apple.com/macosx/features/mail.html">Apple Mail</a>, <a href="http://www.horde.org/">Horde</a>.</p>
<dl>
<dt><a href="www.mozilla.com/thunderbird/" title="Thunderbird – Reclaim your inbox">Thunderbird</a></dt>
<dd>In the menu choose <code>Tools → Account Settings → [account name] → Manage Identities → Add</code>. The rest should be pretty self explanatory.</dd>
<dt><a href="http://www.apple.com/macosx/features/mail.html">Apple Mail</a></dt>
<dd>Again use the main menu to choose <code>Preferences → Accounts → [account name] → Account Information → e-mail address</code> and insert here a comma separated list of the different e-mail addresses you are going to use.</dd>
<dt><a href="http://www.horde.org/">Horde</a></dt>
<dd>After logging in into your web front-end of <a href="http://www.horde.org/">Horde mail</a> select <code>Options → Personal Information → Edit your Identities</code>. Again, the rest should be self explanatory.</dd>
</dl>
<h3>Who is interested in your e-mail?</h3>
<p>e-mails provide a lot of possibilities to address e-mails to recipients. There is the <code>to</code> field, the <code>carbon copy</code>- and the <code>blind carbon copy</code> field. Make use of them! It is very convenient, knowing to be directly addressed by an e-mail or just be informed what is going on – be it the <q>scheming</q> way or be it the normal carbon copy way!</p>
<h2>HTML e-mails are evil</h2>
<p>Some people apparently have giant displays with outrageous low resolution, or they are using magnifying glasses sitting in front of their screens. Otherwise I cannot tell why this <q>Comic Sans</q> comes so damn small and blurry onto my display! There are other <q>useful</q> purposes for <abbr title="HyperText Markup Language">HTML</abbr> in e-mails! Background images and tables – oh, how we all love them.<br />More than ever I can hardly see any need for markup in e-mails. Like mentioned before, e-mail should stay a fast medium of getting message from A to B, <abbr title="HyperText Markup Language">HTML</abbr> just bloats the <q>filesize</q> thus slows down the transfer. Also there may be problems in quoting <abbr title="HyperText Markup Language">HTML</abbr> mails. I guess colorful text decreases readability in almost 100 % of the cases and markup in general potentially breaks the correct display when viewed with another e-mail client. Attached e-mails are shown inline at the end of the e-mail in most of today's e-mail clients, which besides is convenient concerning scaled display on smaller or larger screens respectively.</p><p class="annotation notice right">No, <a href="http://theappleblog.com/2007/10/31/how-to-create-edit-your-own-mail-stationery/">Apple Mail stationaries</a> did not make that any better!</p><p>But there is another reason: many companies try to pep up their services and products by sending newsletters and spam mails containing <abbr title="HyperText Markup Language">HTML</abbr> which – at least for me – resulted in a subtle presumption to have one or another kind of unwanted or not-so important e-mail when receiving <abbr title="HyperText Markup Language">HTML</abbr> e-mails. Of course images are pretty useful for junk mail because possible text cannot be analyzed by any filter. You get the point!</p>
<h2>Privacy</h2>
<p>There are several reasons why you definetely should encrypt your e-mails. Although nowadays it seems, that personal communication is kinda public interest – everything is communicated using ubiquituous online interfaces, everything is twittered, everybody shows off in facebook or some of its derivations. As if this would have any public benefit! But not enough, the web features more possibilities to promote yourself. Just like the network platforms the blogosphere is stage of vanitas, …uhm, what did I say? Vanity? Guess, both! And despite the many interesting blogs about politics, web development and gadgets the majority of blogs is attended as <q>personal journal</q> – which is a periphrasis for <q>diary.</q></p>
<blockquote cite="http://en.wikiquote.org/wiki/Banksy">I think Andy Warhol got it wrong: in the future, so many people are going to become famous that one day everybody will end up being anonymous for 15 minutes.</blockquote><cite><a href="http://www.banksy.co.uk/">Banksy</a> – graffiti artist<br />Bristol, UK</cite>
<p>Why has nobody anything to conceal from anybody? I do not want everybody to know everything about me, neither do I want to know most things about people surrounding me. Alright, it is a bit different with my friends. But what about neighbors, fellow students and co-workers? It is really of <em>no</em> interest, which movie I am watching right now, who I am seeing, what I am writing, where I am surfing, which drink I am having at the very moment! In particular, of no interest for my boss or perhaps any kind of administrative authority.<br />That is one point: politics and administrative bodies. Nowadays we have the special situation of the <q><a href="http://en.wikipedia.org/wiki/War_on_terror">war on terror</a>.</q> Gosh, I just googled <q>terrorism</q> in order to get this <a href="http://wikipedia.org/">Wikipedia</a> link! Hopefully, nobody will recognize and suspect me to have any sympathy for things like that!</p>
<blockquote cite="Forrest Gump">[…] but Mama said it was just a little white lie, it wasn't hurting nobody.</blockquote><cite><a href="http://www.imdb.com/title/tt0109830/">Forrest Gump</a></cite>
<p>Although you got nothing to conceal, you may not want people watching you watching <abbr title="Television">TV</abbr> or doing this and that now and then. Or why do you ever draw your curtains? Sometimes the idea creeps up to me, that people just do not understand what they are telling <u>everybody</u> on webpages and what they are chatting to <u>individuals</u> on any chatting application! Most people do not seem to have the faintest idea that the internet is <em>public</em> indeed. Moreover nobody knows if we are attending the dawning of a new (perhaps even dark) age during these days of economic crisis and global terrorism. Thus nobody has any clue what will be appropriate in the future and you know <q><a href="http://en.wikipedia.org/wiki/Miranda_warning" title="Miranda warning!">anything you say can and will be used against you!</a></q></p>
<h3>Signing and encrypting</h3>
<p>The free encrypting software <a href="http://gnupg.org/index.en.html">GNU Privacy Guard (below GnuPG)</a> uses <a href="http://en.wikipedia.org/wiki/Asymmetric_encryption" title="If you want to take the deep dive into asymmetric encryption have a look at Wikipedias article on this topic!">asymmetric encryption</a> which for you results in having two different keys (public and private key) needed to encrypt something. With <a href="http://gnupg.org/index.en.html">GnuPG</a> you are able to encrypt files as well as texts. Let us presume we only want to encrypt our e-mail correspondence for this time. Along with your keys you will need the recipients public key for every instance of encrypting. One will need your public key as well, if he or she wants to encrypt something for you! While your public key consequently should be accessible for potential interlocutor of yours, your private key <em>has to be kept as save as possible</em> and only accessible for you, the owner of this key!<br />Supplemental to the encryption you can sign your e-mails with <a href="http://gnupg.org/index.en.html">GnuPG</a>, <abbr lang="la" title="from Latin: id est = that is">i. e.</abbr> everybody may verify if a particular e-mail has been sent from you. If you do not have a receiver's public key, this person would at least be able to check if your e-mail is authentic – <i>if</i> he or she knows what to do with <a href="http://gnupg.org/index.en.html">GnuPG</a> signatures!</p>
<h3><abbr lang="la" title="from Latin, literally: for, on behalf of">Pros</abbr> and <abbr lang="la" title="from Latin: contra = against">cons</abbr></h3>
<p>Yes, encrypting is great and outclassing. But it also has a dark side. Let me give you some arguments about the merits and demerits:</p>
<h4>Advantages</h4>
<ul class="inline">
<li>Verification of the e-mails sender</li>
<li>Verification if the e-mail has been altered on the way through the web</li>
<li>Even if your e-mail account gets hacked – your correspondence is save</li>
<li>Nowadays ease of use with various mail clients and plug-ins</li>
</ul>
<h4>Disadvantages</h4>
<ul class="inline">
<li>Without a running <a href="http://gnupg.org/index.en.html">GnuPG</a> system you are not able to read your mail</li>
<li>Do not loose your private key or you will not be able to read your mails ever again</li>
<li>Your e-mail client is not able to search for specific text in your e-mail archive (however you are still able to search for recipients and senders)</li>
<li>You will not be able to read your e-mails online in your webmail's interface</li>
</ul>
<p class="annotation notice right">There is no standard routine how to exchange the public keys, thus to verify the public keys you receive. Best practice would be a personal exchange. One concept to ensure public keys are valid is the <a title="Introduction to Web of trust at Wikipedia" href="http://en.wikipedia.org/wiki/Web_of_trust">Web of trust</a>, which allows you to sign public keys.</p><p>It is up to you to appraise these arguments. Since not everybody is using <a href="http://gnupg.org/index.en.html">GnuPG</a> you will not be able to send all your messages encrypted anyways. Personally, I try to use it as often as possible – especially for personal data (accounts or access data).</p>
<h3>GPG-encrypted mail with ease – Installing GnuPG</h3>
<p>Since there is a bunch of very good and detailed tutorials I leave it at redirecting you to some of them:</p>
<dl class="inline">
<dt><a href="http://macgpg.sourceforge.net/index.html">http://macgpg.sourceforge.net/index.html</a></dt>
<dd>Home of <a href="http://gnupg.org/index.en.html">GnuPG</a> for Mac OS X</dd>
<dt><a href="http://www.sente.ch/software/GPGMail/English.lproj/GPGMail.html">http://www.sente.ch/software/GPGMail/English.lproj/GPGMail.html</a></dt>
<dd><a href="http://gnupg.org/index.en.html">GnuPG</a> plug-in for <a href="http://www.apple.com/macosx/features/mail.html">Apple Mail</a></dd>
<dt><a href="http://fiatlux.zeitform.info/en/instructions/pgp_macosx.html">http://fiatlux.zeitform.info/en/instructions/pgp_macosx.html</a></dt>
<dd>Various detailed information on <a href="http://gnupg.org/index.en.html">GnuPG</a> usage on Mac OS X</dd>
<dt><a href="http://enigmail.mozdev.org/home/index.php">http://enigmail.mozdev.org/home/index.php</a></dt>
<dd>Website for the <a href="www.mozilla.com/thunderbird/" title="Thunderbird – Reclaim your inbox">Thunderbird</a> plug-in <cite>Enigmail.</cite></dd>
<dt><a lang="de" href="http://www.macnotes.de/2007/01/23/tutorial-sicherer-e-mailverkehr-mit-gnupg-mail/">http://www.macnotes.de/2007/01/23/tutorial-sicherer-e-mailverkehr-mit-gnupg-mail/</a></dt>
<dd>Detailed german tutorial with a lot of screenshots.</dd>
<dt><a href="http://entouragegpg.sourceforge.net/">http://entouragegpg.sourceforge.net/</a></dt>
<dd><a href="http://www.microsoft.com/mac/products/entourage2008/default.mspx">Microsoft Entourage</a> plug-in.</dd>
</dl>
<p>These steps are definitely worth the effort, not just, that it is safer to communicate in times of dragnet investigation, perhaps we are able to get rid of these fatuous footer, which tells hundred things to do, if you are accidently chosen as recipient. At least in germany this form of <q>contract</q> is not valid at all. Rescue e-mail&nbps;– keep this medium of mass communication fast, simple and safe.</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>