Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

14.6. Hello World Example

Let's take a look at a simple implementation of the framework provided by Adobe. We created this example using OSMF build 0.9. The example creates a video player that plays a video using progressive download as an ActionSctipt 3.0 project:

package
{
     import flash.display.Sprite;

     import org.osmf.display.MediaPlayerSprite;
     import org.osmf.media.URLResource;
     import org.osmf.net.NetLoader;
     import org.osmf.utils.URL;
     import org.osmf.video.VideoElement;

     /**
      * The simplest OSMF application possible.
      *
      * The metadata sets the SWF size to match that of the video.
      **/
     [SWF(width="640", height="352")]
     public class OSMFHelloWorld extends Sprite
     {
          public function OSMFHelloWorld()
          {
               // Create the Sprite class that holds our MediaPlayer.
               var sprite:MediaPlayerSprite = new MediaPlayerSprite();
               addChild(sprite);


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint