<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Serge Jespers &#187; dock</title>
	<atom:link href="http://www.webkitchen.be/tag/dock/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webkitchen.be</link>
	<description>Life as an Adobe platform evangelist</description>
	<lastBuildDate>Tue, 31 Jan 2012 17:35:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Play video in your dock with AIR</title>
		<link>http://www.webkitchen.be/2008/03/07/play-video-in-your-dock-with-air/</link>
		<comments>http://www.webkitchen.be/2008/03/07/play-video-in-your-dock-with-air/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 07:05:27 +0000</pubDate>
		<dc:creator>Serge Jespers</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[dock]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[nativeapplication.nativeapplication.icon]]></category>
		<category><![CDATA[systemtray]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.webkitchen.be/2008/03/07/play-video-in-your-dock-with-air/</guid>
		<description><![CDATA[A while back I was thinking if it would be possible to play video in the dock icon with AIR. Then I heard Lee Brimelow ask the same question during his FITC Amsterdam presentation. Last week I had a free moment during the Zurich AIR camp to give it a try and yes&#8230; it does [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F03%2F07%2Fplay-video-in-your-dock-with-air%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F03%2F07%2Fplay-video-in-your-dock-with-air%2F&amp;source=sjespers&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f11b21ad05448f9b4029b73b124e8d0e&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://www.webkitchen.be/wp-content/uploads/2008/03/dockvid.jpg" alt="dockvideo screenshot" align="left" />A while back I was thinking if it would be possible to play video in the dock icon with AIR. Then I heard <a href="http://theflashblog.com" title="Lee Brimelow's site" target="_blank">Lee Brimelow</a> ask the same question during his FITC Amsterdam presentation. Last week I had a free moment during the Zurich AIR camp to give it a try and yes&#8230; it does work.</p>
<p>First of all let&#8217;s think about use-cases for this. Imagine having a video player and when you minimize the app, you can continue watching your video in the dock. Obviously, this will still use the resources needed to actually play the video but I think it&#8217;s really cool and wouldn&#8217;t actually mind seeing this in an application like the Adobe Media Player. You could even have the user set this option in a prefs panel etc&#8230;<span id="more-27"></span></p>
<p>Not many people know this but you can programatically set the icon of your AIR application. <a href="http://weblogs.macromedia.com/cantrell/" target="_blank">Christian Cantrell</a>&#8216;s TimeSlide application demo&#8217;s how this is done. The source code for that application is available on <a href="http://code.google.com/p/timeslide/" target="_blank">Google Code</a> but I&#8217;ll give you the basics here. I&#8217;m sure you&#8217;ll be surprised of how easy this is.</p>
<p>To change the dockIcon, you just have to set the NativeApplication.nativeApplication.icon.bitmaps object.</p>
<blockquote><p>AIR creates the NativeApplication.nativeApplication.icon object automatically. The object type is either DockIcon or SystemTrayIcon, depending on the operating system. You can determine which of these InteractiveIcon subclasses that AIR supports on the current operating system using the NativeApplication.supportsDockIcon and NativeApplication.supportsSystemTrayIcon properties. The InteractiveIcon base class provides the properties width, height, and bitmaps, which you can use to change the image used for the icon.</p></blockquote>
<p>In this case, all I do is change that bitmap &#8220;onEnterFrame&#8221; by first drawing the video in a BitmapData object and then adding that BitmapData object to NativeApplication.nativeApplication.icon.bitmaps :</p>
<pre lang="actionscript">var iconData:BitmapData = new BitmapData(128, 128, true, 0x00000000);
iconData.draw(myVid);
NativeApplication.nativeApplication.icon.bitmaps = [iconData];</pre>
<p>The Windows equivalent to the dock icon, is the system tray icon&#8230; and yes&#8230; it is possible to play video in there too. But it&#8217;s obvious that a 16x16px view of your video is somewhat harder to see compared to the 128x128px icon on the Mac.</p>
<p>I&#8217;m still polishing the app and I&#8217;m going to add some controls etc but I do plan on releasing both the app and source right here next week. One other thing I want to try also is to make the icon bounce to a beat of say a music video I played in the player&#8230; That sounds cool to me :D So stay tuned&#8230;</p>
<iframe id="basic_facebook_social_plugins_likebutton" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.webkitchen.be%2F2008%2F03%2F07%2Fplay-video-in-your-dock-with-air%2F&amp;layout=standard&amp;show_faces=true&amp;width=500&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:500px; height:75px"></iframe>]]></content:encoded>
			<wfw:commentRss>http://www.webkitchen.be/2008/03/07/play-video-in-your-dock-with-air/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

