• Save
Standardize Your Flash with Adobe OSMF (0.9)
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Standardize Your Flash with Adobe OSMF (0.9)

on

  • 8,789 views

The brand spankin' new Adobe Open Source Media Framework (OSMF) is an amazingly powerful code library that can significantly assist your Flash development. ...

The brand spankin' new Adobe Open Source Media Framework (OSMF) is an amazingly powerful code library that can significantly assist your Flash development.

Just as Flex is a framework that supports and standardizes application-centric Flash, OSMF supports and standardizes your media-centric Flash experiences (which, when you actually think about it, is basically all non-application experiences in Flash).

OSMF was born from a desire to standardize Flash video players. Have you ever noticed that no two video players in Flash are built the same way? That makes it really hard to maintain and monetize your work. It means that you literally have to recreate the wheel (or the video player, or the image gallery, or whatever) each time! That's a tremendous waste.

Although perhaps most directly relevant to video players, OSMF actually adds value to any AS3/Flash Player 10+ project. With standards and definitions for advanced media handling (audio, video, text, SWF, bitmap -- all of it), layouts, playlists, plug-ins and even monetization, OSMF makes it much easier and faster for you to create media-based Flash work, to use open-source plug-ins to further assist your work, and for you to maintain that work over time, and integrate it into other projects.

In short, if you're sick of wasting time re-creating the wheel with each AS3 project, OSMF is for you.

Come learn how to get started with OSMF, and watch R as he builds a powerful, standards-driven experience, in front of you in under an hour.

Statistics

Views

Total Views
8,789
Views on SlideShare
7,723
Embed Views
1,066

Actions

Likes
15
Downloads
0
Comments
0

6 Embeds 1,066

http://labs.almerblank.com 855
http://www.slideshare.net 133
http://www.horidream.com 73
http://labs2.almerblank.com 3
http://www.zhuaxia.com 1
http://webcache.googleusercontent.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • download slides and all code @ rblank.com shortly after this talk <br />
  • <br /> about me ...> <br />
  • <br />
  • <br /> ...well what does that mean? <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • a framework - a bunch of code you can use out of the box <br /> <br /> why? <br />
  • ...what type of development? <br />
  • ...what type of development? <br />
  • ...what type of development? <br />
  • but where it will likely have the most immediate impact is video <br /> for reasons I will shortly explain <br /> but I want to reiterate how OSMF is for all media -- it&apos;s specifically built to be flexible in that way <br />
  • as I said, video is where OSMF will have the most immediate impact <br /> <br /> so much of web video is now Flash video <br /> so many sites have video players <br /> each video player is frustratingly unique <br /> <br /> not just playback controls <br /> but how the player works (e.g., when resized in different forms or in full-screen mode), how ads work, how metrics are tracked <br /> <br /> this: <br /> slows down developers/engineers <br /> increases production costs for content distributors <br /> confuses users (with different standards, interactions and controls) <br /> <br /> implementing a standard framework for the creation of these media-rich Flash Platform experiences has a lot of potential benefit for the entire world of digital content <br /> <br /> <br /> <br /> <br />
  • so just as the Flex Framework has helped standardize and accelerate the production of what we call RIAs, that&apos;s what OSMF is to media -- an ActionScript 3 framework to standardize the creation of media delivery experiences on the Flash Platform <br /> <br /> it&apos;s still in beta, but at Sprint 10, v0.93, much of the API has now been locked down, so it&apos;s gonna be a lot more fun to play and work with it <br /> <br /> no GUI components -- yet <br /> but nothing&apos;s stopping you! <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • 1) RSS media reader <br /> 2) closed captioning <br /> 3) akamai CDN integration <br />
  • <br />
  • <br />
  • download <br />
  • the source includes a ton of files -- go straight to this one <br /> <br /> also download the ASDocs for helpful reference, but those aren&apos;t required to work with it <br />
  • <br />
  • <br />
  • media player can contain one MediaElement at a time <br /> mediacontainers can multiple MediaElements at a time <br />
  • media player can contain one MediaElement at a time <br /> mediacontainers can multiple MediaElements at a time <br />
  • media player can contain one MediaElement at a time <br /> mediacontainers can multiple MediaElements at a time <br />
  • media player can contain one MediaElement at a time <br /> mediacontainers can multiple MediaElements at a time <br />
  • media player can contain one MediaElement at a time <br /> mediacontainers can multiple MediaElements at a time <br />
  • media player can contain one MediaElement at a time <br /> mediacontainers can multiple MediaElements at a time <br />
  • media player can contain one MediaElement at a time <br /> mediacontainers can multiple MediaElements at a time <br />
  • if you&apos;re used to coding on the timeline, you might not be used to using imports <br /> <br /> since OSMF is a framework that is not part of the Flash Player, you have to import all of the OSMF classes you work with <br /> <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • 6 lines of code <br /> <br /> and the same code works to stream video <br /> <br /> ...now that we have these basics in place, we can do a bit more...> <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • use of mediafactory is optional <br /> <br /> each specific type of media element has specific traits <br /> <br /> but if you use a mediafactory, you don&apos;t need to care about what specific type of MediaElement <br /> you require -- Flash will choose it for you automatically based on the media type <br /> <br /> use of plugins (which I&apos;m not covering today) requires using the mediafactory, precisely because it&apos;s agnostic on the specific type of MediaElement <br /> <br /> <br />
  • use of mediafactory is optional <br /> <br /> each specific type of media element has specific traits <br /> <br /> but if you use a mediafactory, you don&apos;t need to care about what specific type of MediaElement <br /> you require -- Flash will choose it for you automatically based on the media type <br /> <br /> use of plugins (which I&apos;m not covering today) requires using the mediafactory, precisely because it&apos;s agnostic on the specific type of MediaElement <br /> <br /> <br />
  • use of mediafactory is optional <br /> <br /> each specific type of media element has specific traits <br /> <br /> but if you use a mediafactory, you don&apos;t need to care about what specific type of MediaElement <br /> you require -- Flash will choose it for you automatically based on the media type <br /> <br /> use of plugins (which I&apos;m not covering today) requires using the mediafactory, precisely because it&apos;s agnostic on the specific type of MediaElement <br /> <br /> <br />
  • use of mediafactory is optional <br /> <br /> each specific type of media element has specific traits <br /> <br /> but if you use a mediafactory, you don&apos;t need to care about what specific type of MediaElement <br /> you require -- Flash will choose it for you automatically based on the media type <br /> <br /> use of plugins (which I&apos;m not covering today) requires using the mediafactory, precisely because it&apos;s agnostic on the specific type of MediaElement <br /> <br /> <br />
  • use of mediafactory is optional <br /> <br /> each specific type of media element has specific traits <br /> <br /> but if you use a mediafactory, you don&apos;t need to care about what specific type of MediaElement <br /> you require -- Flash will choose it for you automatically based on the media type <br /> <br /> use of plugins (which I&apos;m not covering today) requires using the mediafactory, precisely because it&apos;s agnostic on the specific type of MediaElement <br /> <br /> <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • mediaelements load media <br /> they do this using something called a NetLoader <br /> <br /> when you create a mediaelement (either directly, or through a mediafactory) you have the option of passing in a type of NetLoader <br /> if you don&apos;t, the MediaFactory will create the right one for you <br /> <br /> the plain vanilla NetLoader is useful in most cases...> <br />
  • mediaelements load media <br /> they do this using something called a NetLoader <br /> <br /> when you create a mediaelement (either directly, or through a mediafactory) you have the option of passing in a type of NetLoader <br /> if you don&apos;t, the MediaFactory will create the right one for you <br /> <br /> the plain vanilla NetLoader is useful in most cases...> <br />
  • but the netloader has three inheritors <br /> which give us some fun powers right away <br /> <br /> http streaming...> <br />
  • <br /> <br /> ... a more traditional type of streaming is RTMP <br /> you&apos;ve seen how easy it is to do streaming with OSMF -- it&apos;s the same exact code as progressive <br /> OSMF also makes dynamic streaming really easy <br /> <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • you don&apos;t generally create a CompositeElement directly <br /> you create one of two types of CompositeElements <br /> <br /> for playback management only -- not display <br /> still a one-to-one for mediaelements to the mediacontainer <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • compositeelements do not factor into the display at all <br /> <br /> technically layout metadata is optional, but almost certainly required when using parallelelements <br />
  • compositeelements do not factor into the display at all <br /> <br /> technically layout metadata is optional, but almost certainly required when using parallelelements <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • it&apos;s in the source files for this talk <br /> in order to start building any apps that work with OSMF, there just a few key items you&apos;re probably going to want to know <br /> a few properties and a few events on the MediaPlayer <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • read the tutorials and check the sample code <br /> there&apos;s a fair bit on Adobe Dev Center (linked from osmf page) <br /> also, there&apos;s a virtual Adobe User Group for OSMF, find out about it at osmf site <br /> <br /> google for other tutorials and blog posts -- which are becoming more plentiful <br />
  • <br />
  • <br />
  • <br />
  • <br />

Standardize Your Flash with Adobe OSMF (0.9) Presentation Transcript

  • 1. Standardize Your Flash with presented by R Blank Training Director | Rich Media Institute The Rich Media Institute | For other courses and much more visit: www.richmediainstitute.com
  • 2. What is OSM Framework?
  • 3. framework for creating Flash-based media experiences ©2004-2010 R Blank 4
  • 4. Delivery Platform
  • 5. Creation Tools Delivery Platform
  • 6. Content Creation Tools Delivery Platform
  • 7. Content Code Creation Tools Delivery Platform
  • 8. Content Code Application Framework Creation Tools Delivery Platform
  • 9. Content Code Application Framework Media Framework Creation Tools Delivery Platform
  • 10. Content Code Application Framework Media Framework Creation Tools Delivery Platform
  • 11. Content Code Application Framework Media Framework Creation Tools Delivery Platform
  • 12. Benefits of a Framework ©2004-2010 R Blank 14
  • 13. Benefits of a Framework Accelerate ©2004-2010 R Blank 14
  • 14. Benefits of a Framework Accelerate & Standardize ©2004-2010 R Blank 14
  • 15. Benefits of a Framework Accelerate & Standardize Development ©2004-2010 R Blank 14
  • 16. media ©2004-2010 R Blank 15
  • 17. Capabilities
  • 18. ©2004-2010 R Blank 19
  • 19. Load ©2004-2010 R Blank 19
  • 20. Load Play ©2004-2010 R Blank 19
  • 21. Load Play & Display ©2004-2010 R Blank 19
  • 22. Load Play & Display Media ©2004-2010 R Blank 19
  • 23. Supported Media Types Streaming audio mp3, AAC, Speex, and Nellymoser Streaming video FLV, F4V, MP4, MPEG-4: MP4, M4V, F4V, 3GPP Progressive audio mp3 Progressive video FLV, F4V, MP4, MP4V-ES, M4V, 3GPP, 3GPP2, QuickTime Images PNG, GIF, or JPG SWF files ©2004-2010 R Blank 20
  • 24. EVERY Flash supported media type ©2004-2010 R Blank 21
  • 25. Delivery Flash Player Quality of Service APIs (aka QoS) Digital Rights Management APIs (aka DRM) Server side HTTP Streaming (currently code-named Project Zeri) Flash Media Server Flash Media Manifest files (aka F4M) Digital Video Recorder functionality (aka DVR) ©2004-2010 R Blank 22
  • 26. Existing Standards Support Video Ad Serving Template (VAST) Media Abstract Sequencing Template (MAST) Media RSS (MRSS) Distribution Format Exchange Profile (DFXP) Synchronized Multimedia Integration Language (SMIL) ©2004-2010 R Blank 23
  • 27. Plugins Developed by 3d Parties Or you! ©2004-2010 R Blank 24
  • 28. Getting Started
  • 29. Installing in Flash
  • 30. adobe.com/go/osmf ©2004-2010 R Blank 27
  • 31. download 'source' in source folder, copy OSMF.swc Direct Link (not to SVN, but to zips): http://opensource.adobe.com/wiki/display/osmf/Downloads ©2004-2010 R Blank 28
  • 32. In Windows: Program FilesAdobeAdobe Flash CS4Common ConfigurationActionScript 3.0libs On the Macintosh: /Applications/Adobe Flash CS4/Common/ Configuration/ActionScript 3.0/libs ©2004-2010 R Blank 29
  • 33. The Simplest Possible OSMF Player
  • 34. Basic Structure of an OSMF Player
  • 35. Basic Structure of an OSMF Player MediaElement Any supported media type video images sound etc
  • 36. Basic Structure of an OSMF Player MediaElement Any supported media type or CompositeElement video Parallel or Serial images sound etc
  • 37. Basic Structure of an OSMF Player MediaElement Any supported media type or CompositeElement video Parallel or Serial images sound Tell this to load stuff etc
  • 38. Basic Structure of an OSMF Player MediaPlayer Control playback of a MediaElement MediaElement Any supported media type or CompositeElement video Parallel or Serial images sound Tell this to load stuff etc
  • 39. Basic Structure of an OSMF Player MediaPlayer Control playback of a MediaElement Tell this to play, stop, etc MediaElement Any supported media type or CompositeElement video Parallel or Serial images sound Tell this to load stuff etc
  • 40. Basic Structure of an OSMF Player MediaPlayer MediaContainer Control playback of a Display MediaElement(s) MediaElement on the Stage Tell this to play, stop, etc MediaElement Any supported media type or CompositeElement video Parallel or Serial images sound Tell this to load stuff etc
  • 41. Basic Structure of an OSMF Player MediaPlayer MediaContainer Control playback of a Display MediaElement(s) MediaElement on the Stage Add this to stage, tell it Tell this to play, stop, etc what element(s) to show MediaElement Any supported media type or CompositeElement video Parallel or Serial images sound Tell this to load stuff etc
  • 42. imports import org.osmf.containers.MediaContainer; import org.osmf.elements.VideoElement; import org.osmf.media.MediaPlayer; import org.osmf.media.URLResource; ©2004-2010 R Blank 32
  • 43. the MediaContainer import org.osmf.containers.MediaContainer; import org.osmf.elements.VideoElement; import org.osmf.media.MediaPlayer; import org.osmf.media.URLResource; // Create the container class that displays the media. var container:MediaContainer = new MediaContainer(); ©2004-2010 R Blank 33
  • 44. the MediaContainer import org.osmf.containers.MediaContainer; import org.osmf.elements.VideoElement; import org.osmf.media.MediaPlayer; import org.osmf.media.URLResource; var container = new MediaContainer(); //add the MediaContainer instance to the stage addChild(container); ©2004-2010 R Blank 34
  • 45. the MediaPlayer import org.osmf.containers.MediaContainer; import org.osmf.elements.VideoElement; import org.osmf.media.MediaPlayer; import org.osmf.media.URLResource; var container = new MediaContainer(); addChild(container); var videoElement=new VideoElement(new URLResource("my.flv")); //create the MediaPlayer instance var mediaPlayer:MediaPlayer = new MediaPlayer(); ©2004-2010 R Blank 35
  • 46. the MediaPlayer import org.osmf.containers.MediaContainer; import org.osmf.elements.VideoElement; import org.osmf.media.MediaPlayer; import org.osmf.media.URLResource; var container = new MediaContainer(); addChild(container); var videoElement=new VideoElement(new URLResource("my.flv")); container.addMediaElement(videoElement); var mediaPlayer = new MediaPlayer(); // Set the MediaElement on the MediaPlayer. //Because autoPlay defaults to true, playback begins immediately mediaPlayer.media=videoElement; ©2004-2010 R Blank 36
  • 47. Simplest OSMF Video Player import org.osmf.containers.MediaContainer; import org.osmf.elements.VideoElement; import org.osmf.media.MediaPlayer; import org.osmf.media.URLResource; var container = new MediaContainer(); addChild(container); var videoElement=new VideoElement(new URLResource("my.flv")); container.addMediaElement(videoElement); var mediaPlayer = new MediaPlayer(); mediaPlayer.media=videoElement; ©2004-2010 R Blank 37
  • 48. Controlling Playback
  • 49. Default Playback //set autoPlay to false on the MediaPlayer instance so that playback does not begin by default mediaPlayer.autoPlay=false; ©2004-2010 R Blank 39
  • 50. //listen for the click event on the stage stage.addEventListener( MouseEvent.CLICK , _onClick ); function _onClick( evt ):void { //if the MediaPlayer is playing if (mediaPlayer.playing) { //pause it mediaPlayer.pause( ); } else { //resume it mediaPlayer.play( ); } } ©2004-2010 R Blank 40
  • 51. Using More Features
  • 52. Media Factories
  • 53. MediaFactory
  • 54. MediaFactory Tell this to create MediaElements, with a URL
  • 55. MediaFactory Tell this to create MediaElements, with a URL MediaElement
  • 56. MediaFactory Tell this to create MediaElements, with a URL MediaElement VideoElement
  • 57. MediaFactory Tell this to create MediaElements, with a URL MediaElement ImageElement VideoElement
  • 58. MediaFactory Tell this to create MediaElements, with a URL MediaElement ImageElement VideoElement SoundElement
  • 59. the Media Factory import org.osmf.media.DefaultMediaFactory; //create the DefaultMediaFactory instance var mediaFactory = new DefaultMediaFactory(); //have the mediafactory create the VideoElement var mediaElement=mediaFactory.createMediaElement(ne w URLResource("my.flv")); ©2004-2010 R Blank 44
  • 60. Layouts
  • 61. MediaContainer MediaElement
  • 62. MediaContainer LayoutMetadata MediaElement
  • 63. MediaContainer LayoutMetadata Controls how a MediaElement is displayed in the MediaContainer MediaElement
  • 64. LayoutMetadata width height x y ... can be absolute or relative
  • 65. LayoutMetadata //create a LayoutMetadata object var layout = new LayoutMetadata(); //set the width and height of the LayoutMetadata object layout.width=640; layout.height=480; //tie the LayoutMetadata instance to the MediaElement instance mediaElement.addMetadata(LayoutMetadata.LAYOUT_ NAMESPACE, layout); ©2004-2010 R Blank 48
  • 66. NetLoader
  • 67. MediaElement
  • 68. MediaElement
  • 69. MediaElement NetLoader
  • 70. HTTPStreamingNetLoader RTMPDynamicStreamingNetLoader DVRCastNetLoader
  • 71. HTTPStreamingNetLoader NetLoader RTMPDynamicStreamingNetLoader DVRCastNetLoader
  • 72. change var videoElement:VideoElement = new VideoElement( resource ); to var videoElement:VideoElement = new VideoElement( resource , new RTMPDynamicStreamingNetLoader ( ) ); ©2004-2010 R Blank 52
  • 73. MediaElement
  • 74. MediaElement URLResource "some.flv"
  • 75. MediaElement DynamicStreamingResource Vector.<DynamicStreamingResourceItem> low medium high
  • 76. //create a new DynamicStreamingResource pointing to our FMS application var resource : DynamicStreamingResource = new DynamicStreamingResource ( RMTP_URL ) ; ©2004-2010 R Blank 55
  • 77. //create a Vector to store the DynamicStreaminingItem objects var vector : Vector.<DynamicStreamingItem> = new Vector.<DynamicStreamingItem> ( 3 ) ; ©2004-2010 R Blank 56
  • 78. //create 3 entries in the vector, each a DynamicStreamingItem, with a file name and a minimum bitrate vector [ 0 ] = new DynamicStreamingItem ( "2012_high" , 1500 ) ; vector [ 1 ] = new DynamicStreamingItem ( "2012_low" , 400 ) ; vector [ 2 ] = new DynamicStreamingItem ( "2012_medium" , 600 ) ; ©2004-2010 R Blank 57
  • 79. //set the streamItems property on the DynamicStreamingResource to our vector resource.streamItems = vector ; //create a new VideoElement, based on the resource var videoElement = new VideoElement( resource ) ; ©2004-2010 R Blank 58
  • 80. Dynamic Streaming in a few lines.... var resource = new DynamicStreamingResource ( RMTP_URL ) ; var vector = new Vector.<DynamicStreamingItem> ( 3 ) ; vector [ 0 ] = new DynamicStreamingItem ( "2012_high" , 1500 ) ; vector [ 1 ] = new DynamicStreamingItem ( "2012_low" , 400 ) ; vector [ 2 ] = new DynamicStreamingItem ( "2012_medium" , 600 ) ; resource.streamItems = vector ; var videoElement = new VideoElement( resource ) ; ©2004-2010 R Blank 59
  • 81. Composite Elements
  • 82. ParallelElement
  • 83. ParallelElement MediaElement MediaElement
  • 84. ParallelElement MediaElement MediaElement concurrently
  • 85. SerialElement MediaElement MediaElement consecutively
  • 86. Basic Structure of an OSMF Player with CompositeElements Playback MediaPlayer CompositeElement MediaElement MediaElement
  • 87. Basic Structure of an OSMF Player with CompositeElements Display MediaContainer MediaElement MediaElement
  • 88. Basic Structure of an OSMF Player with CompositeElements Display MediaContainer LayoutMetadata MediaElement MediaElement
  • 89. Basic Structure of an OSMF Player with CompositeElements Display MediaContainer LayoutMetadata LayoutMetadata MediaElement MediaElement
  • 90. create 2 MediaElements //use the mediaFactory to create two new MediaElement objects var mediaElement1=mediaFactory.createMediaElement(new URLResource(MEDIA_URL)); var mediaElement2=mediaFactory.createMediaElement(new URLResource(MEDIA_URL2)); ©2004-2010 R Blank 65
  • 91. Use two layouts for the container //create, size and position two LayoutMetadata objects var layout1 = new LayoutMetadata(); layout1.width=320; layout1.height=240; var layout2 = new LayoutMetadata(); layout2.width=320; layout2.height=240; //tie each LayoutMetadata object to one of the MediaElement objects mediaElement1.addMetadata(LayoutMetadata.LAYOUT_NAMESPACE , layout1); mediaElement2.addMetadata(LayoutMetadata.LAYOUT_NAMESPACE , layout2); ©2004-2010 R Blank 66
  • 92. the SerialElement //create a new SerialElement var serialElement = new SerialElement ( ); //add both MediaElement instances to the serialElement serialElement.addChild( mediaElement1 ); serialElement.addChild( mediaElement2 ); //set the media property of the mediaPlayer to the parallelElement mediaPlayer.media= serialElement; //add the parallelElement to the MediaContainer mediaContainer.addMediaElement(serialElement); ©2004-2010 R Blank 67
  • 93. Subclipping
  • 94. //create a resource pointing to MEDIA_URL1 from 0 seconds to 10 seconds var resource1=new StreamingURLResource(MEDIA_URL1,null,0,10); //add resource1 to the serialElement serialElement.addChild( new VideoElement( resource1 ) ); //create a (regular) resource pointing to (the whole) AD serialElement.addChild( new VideoElement( new URLResource( AD ) ) ); //create a resource pointing to MEDIA_URL1 from 20 seconds to 30 seconds var resource2=new StreamingURLResource(MEDIA_URL2,null,20,30); ©2004-2010 R Blank 69
  • 95. Full Basic Player
  • 96. MediaPlayer Properties ©2004-2010 R Blank 71
  • 97. MediaPlayer Properties duration ©2004-2010 R Blank 71
  • 98. MediaPlayer Properties duration time ©2004-2010 R Blank 71
  • 99. MediaPlayer Properties duration time autoPlay ©2004-2010 R Blank 71
  • 100. MediaPlayer Properties duration time autoPlay autoRewind ©2004-2010 R Blank 71
  • 101. Media Player Events TimeEvent.CURRENT_TIME_CHANGE ©2004-2010 R Blank 72
  • 102. _mediaPlayer.addEventListener ( TimeEvent.CURRENT_TIME_CHANGE , _onCurrentTimeChange ) ; function _onCurrentTimeChange ( evt : TimeEvent ) : void { trace ( "_onCurrentTimeChange () , evt.time : " + evt.time ) ; } ©2004-2010 R Blank 73
  • 103. Media Player Events MediaPlayerCapabilityChangeEvent. CAN_LOAD_CHANGE ©2004-2010 R Blank 74
  • 104. _mediaPlayer.addEventListener ( MediaPlayerCapabilityChangeEvent.CAN_LOAD_CHANGE , _onCanLoadChange ) ; function _onCanLoadChange ( evt : MediaPlayerCapabilityChangeEvent ) : void { trace ( "_onCanLoadChange () , evt.enabled : " + evt.enabled ) ; } ©2004-2010 R Blank 75
  • 105. Media Player Events MediaPlayerCapabilityChangeEvent. CAN_PLAY_CHANGE ©2004-2010 R Blank 76
  • 106. _mediaPlayer.addEventListener ( MediaPlayerCapabilityChangeEvent.CAN_PLAY_CHANGE , _onCanPlayChange ) ; function _onCanPlayChange ( evt : MediaPlayerCapabilityChangeEvent ) : void { trace ( "_onCanPlayChange () , evt.enabled : " + evt.enabled ) ; } ©2004-2010 R Blank 77
  • 107. Media Player Events MediaPlayerCapabilityChangeEvent. CAN_SEEK_CHANGE ©2004-2010 R Blank 78
  • 108. _mediaPlayer.addEventListener ( MediaPlayerCapabilityChangeEvent.CAN_SEEK_CHANGE , _onCanSeekChange ) ; function _onCanSeekChange ( evt : MediaPlayerCapabilityChangeEvent ) : void { trace ( "_onCanSeekChange () , evt.enabled : " + evt.enabled ) ; } ©2004-2010 R Blank 79
  • 109. Media Player Events MediaErrorEvent.MEDIA_ERROR ©2004-2010 R Blank 80
  • 110. _mediaPlayer.addEventListener ( MediaErrorEvent.MEDIA_ERROR , _onMediaError ) ; function _onMediaError ( evt : MediaErrorEvent ) : void { trace ( "_onMediaError () , evt.error : " + evt.error ) ; } ©2004-2010 R Blank 81
  • 111. Media Player Events MediaPlayerStateChangeEvent. MEDIA_PLAYER_STATE_CHANGE ©2004-2010 R Blank 82
  • 112. _mediaPlayer.addEventListener ( MediaPlayerStateChangeEvent.MEDIA_PLAYER_STATE_CHANGE , _onMediaPlayerStateChange ) ; function _onMediaPlayerStateChange ( evt : MediaPlayerStateChangeEvent ) : void { trace ( "_onMediaPlayerStateChange () , evt.state : " + evt.state ) ; } ©2004-2010 R Blank 83
  • 113. MediaPlayer State Values playing loading buffering uninitialized ready ©2004-2010 R Blank 84
  • 114. Next Steps adobe.com/go/osmf
  • 115. read the docs ©2004-2010 R Blank 86
  • 116. check sample files ©2004-2010 R Blank 87
  • 117. start working with it ©2004-2010 R Blank 88
  • 118. Thank You Training: richmediainstitute.com Production: almerblank.com Blog: rblank.com ©2004-2010 R Blank 89