4 Replies Latest reply on Nov 12, 2010 1:43 PM by everythingelsewastakentoo

    best way to change seeking experience in a custom netstream

    everythingelsewastakentoo

      Hi,

       

      I have a custom netstream class that works by downloading pre-defined chunks of the video and using append bytes (basically a modified pseudostreaming approach).  Right now, I am still using osmf 1.0.  I do not want to upgrade yet, unless this will be significantly easier or is only possible with version 1.5.  The controls are handled using the chrome package from the 1.0gm branch.  Currently, I have the seek set up so that it mimics the default approach and will do the "frame by frame"-ish previews as the user drags the scrub bar by seeking through the video.  This works very well for progressive files, but it wastes a lot of bandwidth for the streaming style I am using.  Typically, these chunks are around 5 seconds of video and depending on the bitrate can be quite large to download just to show a screencap for seeking.  I want to alter the way the seeking screencaps are generated.  I think the best method for this will be to provide some sort of image manifest (probably a timed smil sequence or something... but that is irrelevent to this question) and then to display the image that corresponds to the seek time.  I think that images are most appropriate for this because I can have a nice screencap for roughly 5-30kb where the video chunk can be much much larger.

       

      My question is, what is the best way to implement this.  I would prefer to be able to implement this in the netstream code, but I cannot figure out how to determine a way to seperate actual seeks and when the user is just scrubbing through the video to find the correct time.

       

      If you were trying to implement this... where would you start/how would you go about doing it?  I am kinda stuck.

       

      Thanks.

        • 1. Re: best way to change seeking experience in a custom netstream
          weizhangstrobe Level 2

          Hi,

           

          It seems that there are two issues that you are dealing with. The first one is a seek-preview. This is more Flex UI related which is not my forte. However, I image that you can listen to SliderEvent, which has THUMB_DRAG, THUMB_PRESS and THUM_RELEASE to help you figure out when to do the preview and when to do the actual seek.

           

          The second issue is about the performance of preview. You are on the right track of using a separate set of frames for preview. I want to point out that you may consider adopting Adobe's Zeri Http streaming solution instead of implementing your own pseudo streaming.

           

          -Wei Zhang

          Senior Computer Scientist

          Adobe Systems, Inc.

          weizhang@adobe.com

          • 2. Re: best way to change seeking experience in a custom netstream
            everythingelsewastakentoo Level 1

            Weizhangstrobe,


            Thanks for the fast response.  Listening for the events is exactly what I need.  How can I access them from inside the netstream?  That is the difficulty I am running into.  I want to be able to handle this completely inside the netstream.

             

            I did look into the Zeri project but it does not work in my particular enviornment.  It is a very nice solution, it just does not fit my project.

             

            Thanks.

            • 3. Re: best way to change seeking experience in a custom netstream
              weizhangstrobe Level 2

              Since you are writing your own net stream, here is what you can do:

               

              1. Create your own implementation of NetLoader, a derived class. In particular, you need to override the createNetStream method such that you can use your own net stream implementation.

              2. In your application, you need to register your MediaFactoryItem, which uses your derived class of NetLoader, to the media factory you use.

              3. You need to get a hold on the slider object within your application. Once you have that, you can pass the slider to your net stream object. Your net stream object can be accessed from NetStreamLoadTrait. If you use MediaPlayer in your application, you may want to listen to "canPlayChange" event to introduce the slider to the net stream object at the "right" moment.

               

              Please let me know if you have further questions.

               

               

              --Wei Zhang

              Senior Computer Scientist

              Adobe Systems, Inc.

              weizhang@adobe.com

              • 4. Re: best way to change seeking experience in a custom netstream
                everythingelsewastakentoo Level 1

                Weizhangstrobe,

                 

                Thanks.  I already have a working netstream with all of the elements and such created.  I am just trying to modify the default way seeking was shown to the user.  I was trying to figure out if it was possible to reference the slider only from the netstream though.  But passing the slider widget into the netstream will work and is easy enough.