4 Replies Latest reply: Apr 15, 2010 2:54 PM by rfrishbe RSS

    Buffer size for spark video player

    rajdeeprath Community Member

      is there any way to control the buffer length in spark videoplayer component ?

        • 1. Re: Buffer size for spark video player
          Brian Riggs Community Member

          No, there currently isn't.

          • 2. Re: Buffer size for spark video player
            rfrishbe Community Member

            I think you should be able to access the videoDisplay's videoPlayer property (which gives you access to the OSMF MediaPlayer object).  It's mx_internal, meaning it's something that Flex provides access to for advanced users, but it's not a documented or officially support API.  However, try something like:

             

            import mx.core.mx_internal;

             

            myFlexVideoPlayer.videoDisplay.mx_internal::videoPlayer.bufferTime = XXX;

             

            Good luck,

            Ryan

            • 3. Re: Buffer size for spark video player
              rajdeeprath Community Member

              Hi ryan i tries but it throws a null object exception:

               

              can you confirm...

               

              myFlexVideoPlayer.videoDisplay.mx_internal::videoPlayer.bufferTime = XXX;

               

              this will work ?

              • 4. Re: Buffer size for spark video player
                rfrishbe Community Member

                Accessing the variable and setting it works for me.  Here's a simple example:

                 

                <s:VideoPlayer creationComplete="myFlexVideoPlayer.videoDisplay.mx_internal::videoPlayer.bufferTime" id="myFlexVideoPlayer" />

                 

                One thing to note is that videoDisplay isn't always around as it's part of the skin.  So I can access it at creationComplete time, but I can't access it at pre-initialize time.  To debug your particular null pointer exception, I'd have to see code, but my guess is it's with videoDisplay.  But you can hop in to the debugger and figure out what's null.  It's also a great way to figure out what properties are around and available to you.

                 

                Good luck,

                Ryan