2 Replies Latest reply on Mar 29, 2010 2:47 AM by richardpietsch

    OSMF - How to control Buffering


      Hello, i hope someone is able to help me:


      I've programmed an OSMF-Videoplayer in Flash(AS3).


      I pass the Video by flashVars (no streaming..), and everything works just fine - but the problem is, that i don't want the player to begin buffering right from the start - the user first should click on the play button, and then buffering should begin. (But it also would be great if the first frame of the video would be visible)


      Is there a posibility to control that with OSMF? I'ver searched the API and tried everything that came to my mind (onViewable, onDurationChange-Events)..


      Is there an easy solution for my problem? Thanks

        • 1. Re: OSMF - How to control Buffering
          bringrags Level 4

          By default, the player doesn't auto-buffer, it should not begin to download the bytes of the video until play() is called.  Are you seeing otherwise?


          To display the first frame of the video, there are various options:

          1. Do a play-pause sequence.  The downside is that this will cause the video to auto-buffer, which is probably not what you want.  (The other downside is that it's fairly complicated to implement right, in that you should do a seek(0) after the pause, and ensure the volume is muted until the sequence completes, then unmuted afterwards.)  We don't have an API for this, since most web players use poster frames for the first frame-to-show, which brings me to:

          2. Use a poster frame, i.e. a separate image file that is shown up front.  The advantage here is that you can show any image you want (often the first frame of the video isn't that interesting).  We have a few examples showing how to integrate a poster frame directly into your MediaElement (see "Poster Frame" here: http://opensource.adobe.com/svn/opensource/osmf/trunk/apps/samples/framework/ExamplePlayer /org/osmf/examples/AllExamples.as), or you can choreograph the image and the video yourself (i.e. separately).

          1 person found this helpful
          • 2. Re: OSMF - How to control Buffering
            richardpietsch Level 1

            Thanks for your answer. I've just deleted all those seek(), pause() and play()-Statements. But as soon as i say

            player.element = new VideoElement( new NetLoader(), urlResource );

            The Player starts buffering. I think i should update the Player to the current version of the OSMF (i use the 0.7 version for the player) and then try again, but it seems there are a lot of differences between the old and the new OSMF versions... means a lot of extra work.. any other ideas, or has someone any idea where there could be a mistake in my thoughts? Thank you