2 Replies Latest reply on Oct 10, 2009 3:04 PM by bringrags

    Media Container

    cayennecode Level 1

      Looking at the "basics of video playback" example here:  http://www.adobe.com/devnet/flash/articles/video_osmf.html

      With comments, blank lines removed, there are 24 lines of code.

       

      When we can trim it down to 9-10, and the MediaPlayer is truly a media player; being able to handle, image, video, or sound, then I'll be excited.  I've my own implementation of a media-container, that unifies the code to load, display, and control these 3 media types.  If I can be of any assistance, I'd love to help.  It is really easy to do, and has greatly improved my dev-time when building interactive media-based apps.  The code to load, display, and control an image, is the same as a video, is the same as sound.  Of course an image doesn't necessarily utilize play/pause/seek events, but you can attach functions if for example you want an image to fade in/out on play/stop events.

       

      import flash.events.*;

      import cayennecode.media.MediaObject;

      var url:String = 'rsrc/someFile.mp4';

      var player:MediaObject = new MediaObject({autoRewind:false});

           player.addEventListener(ProgressEvent.PROGRESS, progressHandler);

           player.addEventListener(Event.COMPLETE, completeHandler);

      addChild(player);

           player.load(url);

        • 1. Re: Media Container
          cayennecode Level 1

          Just peeked at the OSMF API Reference and saw the Audio/Image classes.  Glad you guys are doing more than just video with OSMF.

           

           

          With my own media-container implementation; if you're loading a media-file through a gateway, you load the resource like this.

           

          import flash.events.*;

          import cayennecode.media.MediaObject;

           

          var url:String = 'media/gateway.php';

          var player:MediaObject = new MediaObject({autoRewind:false});

           

               player.addEventListener(ProgressEvent.PROGRESS, progressHandler);

               player.addEventListener(Event.COMPLETE, completeHandler);

          addChild(player);

               player.load(url, {filename:someFile.mp4, key:someKeyReceivedOnLogin});

          • 2. Re: Media Container
            bringrags Level 4

            See the Building a Hello World app blog post for an OSMF example that's just three lines of code.