<?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>Almer/Blank Labs &#187; OSMF</title>
	<atom:link href="http://labs.almerblank.com/tag/osmf/feed/" rel="self" type="application/rss+xml" />
	<link>http://labs.almerblank.com</link>
	<description>Blog of the Talent at Almer/Blank</description>
	<lastBuildDate>Mon, 19 Jul 2010 22:55:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Four New OSMF Adobe Cookbook Recipes</title>
		<link>http://labs.almerblank.com/2010/07/four-new-osmf-adobe-cookbook-recipes/</link>
		<comments>http://labs.almerblank.com/2010/07/four-new-osmf-adobe-cookbook-recipes/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 22:55:23 +0000</pubDate>
		<dc:creator>rblank</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Code & Samples]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flash video]]></category>
		<category><![CDATA[OSMF]]></category>

		<guid isPermaLink="false">http://labs.almerblank.com/?p=1533</guid>
		<description><![CDATA[Evenin&#039; all:
I posted four new OSMF recipes on Adobe&#039;s cookbook site this afternoon, and thought you might care to see &#039;em:
Playing Multiple Pieces of Media, Consecutively, with the OSMF ParallelElement
Playing Multiple Pieces of Media, Concurrently, with the OSMF ParallelElement
Dynamic Streaming with OSMF
HTTP Streaming in OSMF
And, as a reminder along these lines, I&#039;m teaching this year [...]]]></description>
			<content:encoded><![CDATA[<p>Evenin&#039; all:</p>
<p>I posted four new OSMF recipes on Adobe&#039;s cookbook site this afternoon, and thought you might care to see &#039;em:</p>
<p><a href="http://cookbooks.adobe.com/post_Playing_Multiple_Pieces_of_Media__Consecutively__w-17642.html">Playing Multiple Pieces of Media, Consecutively, with the OSMF ParallelElement</a><br />
<a href="http://cookbooks.adobe.com/post_Playing_Multiple_Pieces_of_Media__Concurrently__wi-17640.html">Playing Multiple Pieces of Media, Concurrently, with the OSMF ParallelElement</a><br />
<a href="http://cookbooks.adobe.com/post_Dynamic_Streaming_with_OSMF-17638.html">Dynamic Streaming with OSMF</a><br />
<a href="http://cookbooks.adobe.com/post_HTTP_Streaming_in_OSMF-17636.html">HTTP Streaming in OSMF</a></p>
<p>And, as a reminder along these lines, I&#039;m teaching this year at MAX, as a MAX Master, on &#039;Designing Custom Video Players with OSMF&#039; (you can <a href="http://max.adobe.com/sessions/catalog/" target="_blank">browse the catalog of talks and presentations</a> and then you can <a href="http://max.adobe.com/register" target="_blank">register here</a>).</p>
<p>Share and enjoy!</p>
<p>-r<span id="more-1533"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.almerblank.com/2010/07/four-new-osmf-adobe-cookbook-recipes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSMF Sample Player Update for 1.0</title>
		<link>http://labs.almerblank.com/2010/07/osmf-sample-player-update-for-1-0/</link>
		<comments>http://labs.almerblank.com/2010/07/osmf-sample-player-update-for-1-0/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 02:31:37 +0000</pubDate>
		<dc:creator>rblank</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Code & Samples]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[adob]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[max]]></category>
		<category><![CDATA[OSMF]]></category>

		<guid isPermaLink="false">http://labs.almerblank.com/?p=1518</guid>
		<description><![CDATA[I&#039;ve finally started work on my OSMF lab for MAX, &#039;Designing Custom Video Players with OSMF&#039; (you can browse the catalog of talks and presentations and then you can register here).
As you may know, OSMF 1.0 has been release, so one of the first tasks I set for myself was to test the code I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#039;ve finally started work on my OSMF lab for MAX, &#039;Designing Custom Video Players with OSMF&#039; (you can <a href="http://max.adobe.com/sessions/catalog/" target="_blank">browse the catalog of talks and presentations</a> and then you can <a href="http://max.adobe.com/register" target="_blank">register here</a>).</p>
<p>As you may know, OSMF 1.0 has been release, so one of the first tasks I set for myself was to test the code I wrote in April for OSMF 0.95 (which I posted, along with the screencasts of my talk at FITC, <a href="http://labs.almerblank.com/2010/04/new-intro-to-adobe-osmf-videos/">here</a>). And, lo and behold, all of them worked!</p>
<p>Well, all except one. The final demo file, the <cite>Full Sample Player</cite> was playing, but the video was invisible and all the controls were disabled. So I set out to figure out why. (For those who don&#039;t want to read to the end, you can <a href="http://labs.almerblank.com/wp-content/uploads/2010/07/Full-Basic-Player-Update_20100705.zip">download the updated project file, for Flash CS5, here</a>.)</p>
<p><span id="more-1518"></span>It wasn&#039;t long before I found the culprit. It turns out that the MediaPlayer in OSMF now dispatches the &#039;ready&#039; MediaPlayerStateChangeEvent when the video is ready to play for the first time &#8212; not just when it&#039;s ready to play again. So, the result of my last code sample, with OSMF 1.0, was to hide the video and disable the controls &#8212; at the start of the video playback! Not what I wanted.</p>
<p>So, if we just remove lines 157 and 158 (seen below), from the _onMediaPlayerStateChange function, the player will work.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;ready&quot;</span>:
	_disableControls <span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#41;</span> ;
	_cleanUpVideo <span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#41;</span> ;
	<span style="color: #b1b100;">break</span>;</pre></div></div>

<p>But now, when our video ends, the video doesn&#039;t get reset (or &#039;cleaned up&#039; or however you want to say it) &#8212; it looks ugly and doesn&#039;t behave how we would expect (because we just removed the code that&#039;s supposed to clean up these videos).</p>
<p>So, how do we clean up at the end of a video? Well, you can now listen for the TimeEvent.COMPLETE event on the MediaPlayer instance &#8212; when it&#039;s fired, the playback of your media is done.</p>
<p>So, if we add this line to the _setupOSMF() function:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">_mediaPlayer.<span style="color: #006600;">addEventListener</span> <span style="color: #66cc66;">&#40;</span> TimeEvent.<span style="color: #006600;">COMPLETE</span> , _onComplete , <span style="color: #000000; font-weight: bold;">false</span> , <span style="color: #cc66cc;">0</span> , <span style="color: #000000; font-weight: bold;">true</span> <span style="color: #66cc66;">&#41;</span> ;</pre></div></div>

<p>&#8230;and then declare the _onComplete function, adding back in those two lines we removed from the _onMediaPlayerStateChange function:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _onComplete <span style="color: #66cc66;">&#40;</span> evt : TimeEvent <span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
	_disableControls <span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#41;</span> ;
	_cleanUpVideo <span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#41;</span> ;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>One final note&#8230; Adobe added in string constants for all of the MediaPlayerStateChangeEvent types, grouped in the new MediaPlayerState class. So instead of comparing against the string, &#034;ready&#034;, you can now compare against the string constant of MediaPlayerState.READY. All of them are listed <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/org/osmf/media/MediaPlayerState.html" target="_blank">here</a> and have been included in the <a href="http://labs.almerblank.com/wp-content/uploads/2010/07/Full-Basic-Player-Update_20100705.zip">updated source files that accompany this post</a>.</p>
<p>See you in October at MAX in LA!</p>
<p>And, as always, share and enjoy!</p>
<p>-r</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.almerblank.com/2010/07/osmf-sample-player-update-for-1-0/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Free OSMF 1.0 Webcast, June 9th</title>
		<link>http://labs.almerblank.com/2010/05/free-osmf-1-0-webcast-june-9th/</link>
		<comments>http://labs.almerblank.com/2010/05/free-osmf-1-0-webcast-june-9th/#comments</comments>
		<pubDate>Mon, 17 May 2010 22:56:16 +0000</pubDate>
		<dc:creator>rblank</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flash video]]></category>
		<category><![CDATA[OSMF]]></category>
		<category><![CDATA[strobe]]></category>

		<guid isPermaLink="false">http://labs.almerblank.com/?p=1493</guid>
		<description><![CDATA[The OSMF team sent this to me to help get the word out, and I wanted to pass it along to you all.
On Wednesday, June 9th, Adobe will be hosting a FREE 90-minute session, run by Lisa Larson-Kelley, on the formal launch of the 1.0 version of the Adobe Open Source Media Framework (OSMF). Lisa [...]]]></description>
			<content:encoded><![CDATA[<p>The OSMF team sent this to me to help get the word out, and I wanted to pass it along to you all.</p>
<p>On Wednesday, June 9th, Adobe will be hosting a FREE 90-minute session, run by Lisa Larson-Kelley, on the formal launch of the 1.0 version of the Adobe Open Source Media Framework (OSMF). Lisa will also cover the beta release of  &#034;Strobe Media Playback,&#034; a pre-compiled SWF media player (including source code) based on OSMF.</p>
<p>The <a href="http://www.eventsadobe.com/osmflaunch/invite.html" target="_blank">invitation is here</a> and you may <a href="http://www.eventsadobe.com/osmflaunch/user_info.php" target="_blank">register here</a>.</p>
<p><span id="more-1493"></span>[blockquote]In this session, Lisa Larson-Kelley will introduce you to the fundamentals of Open Source Media Framework (OSMF), Adobe’s standard video player libraries for building playback experiences and monetizing video on the web. She’ll give you a high-level overview of why you’d want to use OSMF and what it can do, and then dive into its underlying structure and some simple sample code to get you started. This session is for beginner to intermediate programmers and web developers who want to gain a better understanding of OSMF, and how it can simplify media player development.[/blockquote]</p>
<p>Share and enjoy!</p>
<p>-r</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.almerblank.com/2010/05/free-osmf-1-0-webcast-june-9th/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Intro to Adobe OSMF Videos</title>
		<link>http://labs.almerblank.com/2010/04/new-intro-to-adobe-osmf-videos/</link>
		<comments>http://labs.almerblank.com/2010/04/new-intro-to-adobe-osmf-videos/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 04:30:06 +0000</pubDate>
		<dc:creator>rblank</dc:creator>
				<category><![CDATA[Code & Samples]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[flash cs4]]></category>
		<category><![CDATA[flash cs5]]></category>
		<category><![CDATA[flash media server]]></category>
		<category><![CDATA[flash video]]></category>
		<category><![CDATA[Open Source Media Framework]]></category>
		<category><![CDATA[OSMF]]></category>

		<guid isPermaLink="false">http://labs.almerblank.com/?p=1425</guid>
		<description><![CDATA[I tried to record my &#039;Standardize Your Flash with Adobe OSMF&#039; talk from FITC Toronto &#8212; and, lo and behold, it actually seems to have worked.
So I edited it down a bit (cutting out the Q&#38;A, which unfortunately was not audible on my microphone), chopped the sections down into individual videos, and posted them to [...]]]></description>
			<content:encoded><![CDATA[<p>I tried to record my &#039;<a href="http://www.fitc.ca/events/presentations/presentation.cfm?event=102&amp;presentation_id=1159" target="_talk">Standardize Your Flash with Adobe OSMF</a>&#039; talk from <a href="http://fitc.ca/toronto" target="_blank">FITC Toronto</a> &#8212; and, lo and behold, it actually seems to have worked.</p>
<p>So I edited it down a bit (cutting out the Q&amp;A, which unfortunately was not audible on my microphone), chopped the sections down into individual videos, and posted them to YouTube. I thought it might be a good reference if I embedded all of them in a single post, along with the source code you&#039;ll want for each lesson if you wish to follow along in Flash CS4 or CS5.</p>
<p>In this talk, I cover:<br />
- what is OSMF<br />
- OSMF capabilities<br />
- The basic structure of an OSMF player, including the MediaElement, MediaPlayer and MediaComposition<br />
- Dynamic Streaming (the files for that video also include HTTP Streaming)<br />
- Subclipping<br />
- The key MediaPlayer properties and events required to build a media player</p>
<p><span id="more-1425"></span></p>
<p>The talk and these files all use OSMF 0.9 from Sprint 10, which you can <a href="http://download.macromedia.com/pub/opensource/osmf/osmf_source_s093.zip" target="_blank">download here</a>.</p>
<h3>The Slides</h3>
<div id="__ss_3910236" style="width: 425px;"><object id="__sse3910236" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=standardizeyourflash20100427alive-100429224617-phpapp01&amp;stripped_title=standardize-your-flash-with-adobe-osmf-09" /><param name="name" value="__sse3910236" /><param name="allowfullscreen" value="true" /><embed id="__sse3910236" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=standardizeyourflash20100427alive-100429224617-phpapp01&amp;stripped_title=standardize-your-flash-with-adobe-osmf-09" name="__sse3910236" allowscriptaccess="always" allowfullscreen="true"></embed></object></div>
<h3>Part 1: Overview of Adobe OSMF</h3>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/KiPqaq-5kPg&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/KiPqaq-5kPg&amp;hl=en&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<h3>Part 2: Getting Started with OSMF in Adobe Flash</h3>
<p><span><em><a href="http://www.rblank.com/rfiles/osmf/toronto2010talk/SimpleBasicPlayer.zip">download the files to accompany this video</a></em></span></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/JwO7-xYG_t0&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/JwO7-xYG_t0&amp;hl=en&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<h3>Part 3: Dynamic Streaming with Adobe OSMF</h3>
<p><span><em><a href="http://www.rblank.com/rfiles/osmf/toronto2010talk/DynamicStreaming.zip">download the files to accompany this video</a></em></span></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/tEbiJ5OfMcQ&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/tEbiJ5OfMcQ&amp;hl=en&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<h3>Part 4: Composite Elements in Adobe OSMF</h3>
<p><span><em><a href="http://www.rblank.com/rfiles/osmf/toronto2010talk/CompositeElements.zip">download the files to accompany this video</a></em></span></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/DIOOoMrOiMs&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/DIOOoMrOiMs&amp;hl=en&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<h3>Part 5: Subclipping</h3>
<p><span><em><a href="http://www.rblank.com/rfiles/osmf/toronto2010talk/Subclipping.zip">download the files to accompany this video</a></em></span></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/pTncFKS8SwE&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/pTncFKS8SwE&amp;hl=en&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<h3>Part 6: Key MediaPlayer Properties And Events in OSMF</h3>
<p><span><em><a href="http://www.rblank.com/rfiles/osmf/toronto2010talk/FullBasicPlayer.zip">download the files to accompany this video</a></em></span></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/vUGZmzoEcag&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/vUGZmzoEcag&amp;hl=en&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.almerblank.com/2010/04/new-intro-to-adobe-osmf-videos/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Dynamic Streaming in OSMF 10</title>
		<link>http://labs.almerblank.com/2010/04/dynamic-streaming-in-osmf-10/</link>
		<comments>http://labs.almerblank.com/2010/04/dynamic-streaming-in-osmf-10/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 00:50:05 +0000</pubDate>
		<dc:creator>rblank</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Code & Samples]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[flash video]]></category>
		<category><![CDATA[OSMF]]></category>

		<guid isPermaLink="false">http://labs.almerblank.com/?p=1394</guid>
		<description><![CDATA[I'm writing some new sample files for OSMF in preparation for my presentation, '<a href="http://www.fitc.ca/events/presentations/presentation.cfm?event=102&#038;presentation_id=1159">Standardize Your Flash with Adobe OSMF</a>,' which I'll be giving on April 27th at <a href="http://fitc.ca/toronto">FITC Toronto</a>.
...
So, since I wrote it as one of the sample files for my talk, I figured I would post the code to run dynamic streaming with OSMF v0.93.

[...]
]]></description>
			<content:encoded><![CDATA[<p>I&#039;m writing some new sample files for OSMF in preparation for my presentation, &#039;<a href="http://www.fitc.ca/events/presentations/presentation.cfm?event=102&#038;presentation_id=1159">Standardize Your Flash with Adobe OSMF</a>,&#039; which I&#039;ll be giving on April 27th at <a href="http://fitc.ca/toronto">FITC Toronto</a>.</p>
<p>Last time I checked (February), OSMF was in Sprint 9 (and I updated my sample files at that time, <a href="http://www.rblank.com/2010/02/04/osmf-0-9-updated-flash-cs4-sample/">posted here</a>). Now, it&#039;s in Sprint 10, specifically version 0.93. And Adobe appears to have done a lot to lock down the API, which is definitely an exciting and positive development.</p>
<p>But, of course, there are some significant changes since the Sprint 9 OSMF framework &#8212; so even the files I posted just two months ago are no longer valid. So, since I wrote it as one of the sample files for my talk, I figured I would post the code to run dynamic streaming with OSMF v0.93.</p>
<p>Here is a Flash CS4 document class, assuming you already have your OSMF SWC in your library path.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package 
<span style="color: #66cc66;">&#123;</span> 
    <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>; 
&nbsp;
	<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">osmf</span>.<span style="color: #006600;">media</span>.<span style="color: #006600;">MediaPlayer</span>;
	<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">osmf</span>.<span style="color: #006600;">containers</span>.<span style="color: #006600;">MediaContainer</span>;
	<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">osmf</span>.<span style="color: #006600;">media</span>.<span style="color: #006600;">URLResource</span>;
	<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">osmf</span>.<span style="color: #006600;">net</span>.<span style="color: #006600;">NetLoader</span>;
	<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">osmf</span>.<span style="color: #006600;">elements</span>.<span style="color: #006600;">VideoElement</span>;
	<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">osmf</span>.<span style="color: #006600;">utils</span>.<span style="color: #0066CC;">URL</span>;
	<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">osmf</span>.<span style="color: #006600;">net</span>.<span style="color: #006600;">DynamicStreamingResource</span> ;
	<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">osmf</span>.<span style="color: #006600;">net</span>.<span style="color: #006600;">DynamicStreamingItem</span> ;
&nbsp;
    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MyPlayer <span style="color: #0066CC;">extends</span> Sprite 
    <span style="color: #66cc66;">&#123;</span> 
&nbsp;
		<span style="color: #0066CC;">private</span> const RTMP_URL : <span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;rtmp://myhost&quot;</span> ;
&nbsp;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> MyPlayer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> 
        <span style="color: #66cc66;">&#123;</span> 
			player = <span style="color: #000000; font-weight: bold;">new</span> MediaPlayer <span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#41;</span> ;
			container = <span style="color: #000000; font-weight: bold;">new</span> MediaContainer <span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#41;</span> ;
			addChild <span style="color: #66cc66;">&#40;</span> container <span style="color: #66cc66;">&#41;</span> ;
			<span style="color: #808080; font-style: italic;">//set the player to play videos only once by default</span>
			player.<span style="color: #006600;">autoRewind</span>=<span style="color: #000000; font-weight: bold;">false</span>;
			<span style="color: #000000; font-weight: bold;">var</span> resource : DynamicStreamingResource = <span style="color: #000000; font-weight: bold;">new</span> DynamicStreamingResource <span style="color: #66cc66;">&#40;</span> RTMP_URL <span style="color: #66cc66;">&#41;</span> ;
			<span style="color: #000000; font-weight: bold;">var</span> vector : Vector.<span style="color: #66cc66;">&lt;</span>DynamicStreamingItem<span style="color: #66cc66;">&gt;</span> = <span style="color: #000000; font-weight: bold;">new</span> Vector.<span style="color: #66cc66;">&lt;</span>DynamicStreamingItem<span style="color: #66cc66;">&gt;</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">3</span> <span style="color: #66cc66;">&#41;</span> ;
			vector <span style="color: #66cc66;">&#91;</span> <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">&#93;</span> = <span style="color: #000000; font-weight: bold;">new</span> DynamicStreamingItem <span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;myMovie_high&quot;</span> , <span style="color: #cc66cc;">1500</span> <span style="color: #66cc66;">&#41;</span> ; 
			vector <span style="color: #66cc66;">&#91;</span> <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span> = <span style="color: #000000; font-weight: bold;">new</span> DynamicStreamingItem <span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;myMovie_low&quot;</span> , <span style="color: #cc66cc;">400</span> <span style="color: #66cc66;">&#41;</span> ; 
			vector <span style="color: #66cc66;">&#91;</span> <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#93;</span> = <span style="color: #000000; font-weight: bold;">new</span> DynamicStreamingItem <span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;myMovie_medium&quot;</span> , <span style="color: #cc66cc;">600</span> <span style="color: #66cc66;">&#41;</span> ; 
			resource.<span style="color: #006600;">streamItems</span> = vector ;
			videoElement = <span style="color: #000000; font-weight: bold;">new</span> VideoElement<span style="color: #66cc66;">&#40;</span> resource <span style="color: #66cc66;">&#41;</span> ;
			player.<span style="color: #006600;">media</span> = videoElement ;
			container.<span style="color: #006600;">addMediaElement</span> <span style="color: #66cc66;">&#40;</span> videoElement <span style="color: #66cc66;">&#41;</span> ;
        <span style="color: #66cc66;">&#125;</span> 
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> player:MediaPlayer;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> container:MediaContainer;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> videoElement : VideoElement ;
&nbsp;
    <span style="color: #66cc66;">&#125;</span> 
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Share and enjoy!</p>
<p>-r</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.almerblank.com/2010/04/dynamic-streaming-in-osmf-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSMF Sample Player Update</title>
		<link>http://labs.almerblank.com/2010/02/osmf-sample-player-update/</link>
		<comments>http://labs.almerblank.com/2010/02/osmf-sample-player-update/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 22:36:05 +0000</pubDate>
		<dc:creator>rblank</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Code & Samples]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[OSMF]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://labs.almerblank.com/?p=1317</guid>
		<description><![CDATA[Some of you may have checked out the courses I posted over on the Adobe Developer Connection on building <a href="http://www.adobe.com/devnet/flash/articles/video_osmf.html" target="_blank">progressive</a> and <a href="http://www.adobe.com/devnet/flash/articles/video_osmf_streaming.html" target="_blank">streaming video players</a> with the Adobe Open Source Media Framework (OSMF).

Unfortunately, even those courses are relatively new, the code in them no longer works, because OSMF has advanced a few sprints. We're now at OSMF sprint 9, and the framework continues to shift quite a bit.

Because there are almost no examples on the web of using OSMF with Flash (as opposed to Flex), and I've had several people email me asking if I had time to update the code.

And, so, finally I did. At least for the progressive player. So you can download the <a href="http://www.adobe.com/devnet/flash/articles/video_osmf/osmf9_progressive_players_cs4.zip" target="_blank">Flash CS4 source code to build an OSMF player with the Sprint 9 framework</a> from the <a href="http://www.adobe.com/devnet/flash/articles/video_osmf.html" target="_blank">article on Building progressive video players in Flash with OSMF</a>.

Share and enjoy!

]]></description>
			<content:encoded><![CDATA[<p>Some of you may have checked out the courses I posted over on the Adobe Developer Connection on building <a href="http://www.adobe.com/devnet/flash/articles/video_osmf.html" target="_blank">progressive</a> and <a href="http://www.adobe.com/devnet/flash/articles/video_osmf_streaming.html" target="_blank">streaming video players</a> with the Adobe Open Source Media Framework (OSMF).</p>
<p>Unfortunately, even those courses are relatively new, the code in them no longer works, because OSMF has advanced a few sprints. We&#039;re now at OSMF sprint 9, and the framework continues to shift quite a bit.</p>
<p>Because there are almost no examples on the web of using OSMF with Flash (as opposed to Flex), and I&#039;ve had several people email me asking if I had time to update the code.</p>
<p>And, so, finally I did. At least for the progressive player. So you can download the <a href="http://www.adobe.com/devnet/flash/articles/video_osmf/osmf9_progressive_players_cs4.zip" target="_blank">Flash CS4 source code to build an OSMF player with the Sprint 9 framework</a> from the <a href="http://www.adobe.com/devnet/flash/articles/video_osmf.html" target="_blank">article on Building progressive video players in Flash with OSMF</a>.</p>
<p>Share and enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.almerblank.com/2010/02/osmf-sample-player-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multi-bitrate Streaming in Adobe OSMF</title>
		<link>http://labs.almerblank.com/2009/12/multi-bitrate-streaming-in-adobe-osmf/</link>
		<comments>http://labs.almerblank.com/2009/12/multi-bitrate-streaming-in-adobe-osmf/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 19:31:53 +0000</pubDate>
		<dc:creator>rblank</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Code & Samples]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[training]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[flash video]]></category>
		<category><![CDATA[OSMF]]></category>

		<guid isPermaLink="false">http://labs.almerblank.com/?p=1299</guid>
		<description><![CDATA[My new online video course on Dynamic Multi-bitrate Streaming with Adobe Open Source Media Framework (OSMF) has just gone live on Adobe Developer Connection.
It&#039;s 35 minutes across five lessons and takes you through the process of converting the progressive OSMF video player (which we create in the first installment of this course on Building Progressive [...]]]></description>
			<content:encoded><![CDATA[<p>My new online video <a href="http://www.adobe.com/devnet/flash/articles/video_osmf_streaming.html" target="_blank">course on Dynamic Multi-bitrate Streaming with Adobe Open Source Media Framework</a> (OSMF) has just gone live on Adobe Developer Connection.</p>
<p>It&#039;s 35 minutes across five lessons and takes you through the process of converting the progressive OSMF video player (which we create in the first installment of this course on <a href="http://www.adobe.com/devnet/flash/articles/video_osmf.html" target="_blank">Building Progressive Video Players with Adobe OSMF</a>, into a dynamic multi-bitrate streaming player. Multi-bitrate streaming occurs when you program your Flash to deliver the highest quality video a viewer can see (dependent on their bandwidth). *<strong>Dynamic</strong>* multi-bitrate streaming is similar, with the additional feature of having your player constantly meters the bandwidth throughout viewing, to adjust the playback between multiple videos seamlessly, as the viewer&#039;s bandwidth may fluctuate.<span id="more-1299"></span></p>
<blockquote><p><strong>Please note:</strong> that the first course on progressive video players was built with OSMF Sprint 5. The second course on streaming with OSMF was built with OSMF Sprint 7. I spend the first lesson of the new course updating the progressive player to work with Sprint 7, and I wrote a few notes about <a href="http://www.rblank.com/2009/11/10/quick-note-on-osmf-0-7/" target="_blank">the major differences between OSMF 0.5 and 0.7 in a post on my personal blog</a> last month. Also note that, by the time the course was published by Adobe, OSMF had already moved forward to Spring 8.</p></blockquote>
<p>When I wrote the first course on building a progressive video player with OSMF, I was struck by two things:<br />
1) OSMF is clean &#8212; really clean &#8212; and it just works well in ways that the AS3 video API does not &#8212; for instance, with OSMF setting volume is a matter of talking to the volume property of the MediaPlayer<br />
2) OSMF felt like a bit of overkill &#8212; you need a lot of imports and classes (a MediaPlayer, a MediaElement, a NetLoader and a URLResource) just to build the simplest of progressive video players &#8212; that would be simple enough, requiring seven lines of code with raw AS3 if you knew it</p>
<p>But, I had a hunch that #2 above was due to the fact that I was using approximately 0.05% of this powerful framework &#8212; like trying to use a nuclear bomb when a shovel would do just fine.</p>
<p>Well, when I started learning how to write the code to build dynamic multi-bitrate streaming player, I quickly learned that my hunch was right. The benefits of OSMF really kick in once you do anything beyond the most basic video player.</p>
<p>In the case of streaming, to convert your progressive OSMF video player to a streaming OSMF video player, all you do is change the URL! Seriously, that&#039;s it. OSMF is smart enough to know that when you try to load a video from an RTMP server, you&#039;re trying to stream &#8212; and it takes care of the rest.</p>
<p>That was pretty neat. But the benefits really kicked in when I beefed my regular streaming OSMF video player to one that supports dynamic multi-bitrate streaming. All it took was just a few extra lines of code to turn my regular video player into one that supports dynamic multi-bitrate streaming. If you want to learn those lines of code, I&#039;d recommend checking out the course.</p>
<p>As I say, I&#039;m still just barely cracking the surface of OSMF, and I&#039;m really looking forward to digging deeper into its support for layouts, playlists and monetization. But, even with this second course, the massive time, workflow and standardization features of OSMF are already revealing themselves.</p>
<p>Share and enjoy!</p>
<p>-r</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.almerblank.com/2009/12/multi-bitrate-streaming-in-adobe-osmf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intro to Open Source Media Framework and Flash</title>
		<link>http://labs.almerblank.com/2009/10/intro-to-open-source-media-framework-and-flash/</link>
		<comments>http://labs.almerblank.com/2009/10/intro-to-open-source-media-framework-and-flash/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 18:24:05 +0000</pubDate>
		<dc:creator>rblank</dc:creator>
				<category><![CDATA[Code & Samples]]></category>
		<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[Open Source Media Framework]]></category>
		<category><![CDATA[OSMF]]></category>

		<guid isPermaLink="false">http://www.rblank.com/?p=367</guid>
		<description><![CDATA[I have recently completed a course on working with the Adobe Open Source Media Framework. Introduction to the Adobe Open Source Media Framework for Flash, which is 90 minutes of video-based online training, has been posted to the Adobe Developer Connection, and to the Rich Media Institute.
OSMF is relatively new, and if you haven't yet [...]]]></description>
			<content:encoded><![CDATA[<a href="http://www.opensourcemediaframework.com/"><img class="alignleft size-full wp-image-369" title="Adobe OSMF" src="http://www.rblank.com/wp-content/uploads/2009/10/ishot-4.png" alt="Adobe OSMF" width="181" height="53" /></a>

I have recently completed a course on working with the <a href="http://www.opensourcemediaframework.com/">Adobe Open Source Media Framework</a>. <em>Introduction to the Adobe Open Source Media Framework for Flash</em>, which is 90 minutes of video-based online training, has been posted to the <a href="http://www.adobe.com/devnet/flash/articles/video_osmf.html">Adobe Developer Connection</a>, and to the <a href="http://richmediainstitute.com/ondemand/intro_to_flash_and_open_source_media_framework">Rich Media Institute</a>.

OSMF is relatively new, and if you haven't yet heard about it, you should check it out. I have been building video players in Flash for over eight years, and almost no two players are ever built the same way. OSMF is an attempt at standardizing the way that such players are built into Flash. Incorporating basic functionality (which we cover in this course), as well as more advanced behaviors like playlists, overlays and integrated advertising, OSMF is a set of classes available for Flash Platform development.

In this course, we cover the basics of working with OSMF in Adobe Flash CS4 -- coding on the timeline to build a fully-functional video player, step-by-step.

And, of course, it's <strong><em>FREE</em></strong>, so you really don't have an excuse. Check it out!

<strong>Title</strong>: Introduction to the Adobe Open Source Media Framework for Flash
<strong>Duration</strong>: 90 minutes
<strong>Price</strong>: FREE
<a href="http://www.adobe.com/devnet/flash/articles/video_osmf.html">View Course at Adobe Developer Connection</a>
<a href="http://richmediainstitute.com/ondemand/intro_to_flash_and_open_source_media_framework">View Course at the Rich Media Institute</a> (eligible for certificate of completion)
<strong>Description</strong>: This course covers all the basic functionality and concepts required to build progressive video players in Flash CS4 with the Adobe Open Source Media Framework. We start from the basics, and work our way to a fully-functioning video player, authored from scratch, using OSMF and Flash CS4.

OSMF is Adobe's community-centered approach to standardizing the way that media players (and, in particular, video players) are built on the Adobe Flash Platform. Although still in prelease, OSMF encompasses media playback functionality, playlists, branding, advertising, and other monetization aspects, and represents a powerful and comprehensive attempt to standardize a huge portion of the work currently executed in Flash.

<strong>Who this Course is For</strong>: This course is useful for two sets of students looking to get up to speed with OSMF:
<ul>
	<li>Low-to-intermediate level Flash ActionScripters, comfortable coding on the timeline, who want to learn the raw ActionScript, as well as the underlying concepts, required to work with OSMF</li>
	<li>Higher level coders, using Adobe Flash or Flex, who want a quick run-down of the core classes utilized when building an OSMF video player</li>
</ul>
<strong>Outline</strong>:
<ul>
	<li>Introduction: Brief Overview of OSMF and Installing the SWC ( 5:44 )</li>
	<li>Lesson 1 : Basics of Video Playback with OSMF ( 6:46 )</li>
	<li>Lesson 2 : Handling Changes in View State ( 7:04 )</li>
	<li>Lesson 3: Adding a Pause Toggle Button ( 8:55 )</li>
	<li>Lesson 4: Sizing the Video ( 9:56 )</li>
	<li>Lesson 5: Adding Volume Control ( 5:56 )</li>
	<li>Lesson 6: Adding a Progress Bar ( 13:58 )</li>
	<li>Lesson 7: Adding Seek Functionality ( 10:43 )</li>
	<li>Lesson 8: Cleaning Up After a Video ( 8:26 )</li>
	<li>Lesson 9 : Playing Multiple Videos ( 11:05 )</li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://labs.almerblank.com/2009/10/intro-to-open-source-media-framework-and-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
