3 Replies Latest reply on Mar 8, 2010 10:55 AM by mattparisi

    Issue when media stops playing

    mattparisi

      Hi everyone.  I've been trying for too long to figure out what is happening with my video player.  Whenever I call MediaPlayer.stop() or the video finishes playing, it automatically jumps to it's intrinsic size while everything else remains the same size.  Anyone know why this would be happening??  I'm using OSMF in a Flex application.  I can provide more info if needed.

       

      Thanks in advance.

        • 1. Re: Issue when media stops playing
          mattparisi Level 1

          I've traced the problem to the following function in NetStreamDisplayObject.as:

           

          private function onMetaData(info:Object):void

          {      

              if (!isNaN(info.width) &&

                  !isNaN(info.height))

              {    

              displayObject.removeEventListener(Event.RENDER, onRender);

              displayObject.removeEventListener(Event.ADDED_TO_STAGE, onStage);

              displayObject.width = info.width;

              displayObject.height = info.height;

             

               setMediaSize(info.width, info.height);

              }

          }

           

          Why would this be called when the media has stopped playing?  It's just forcing the media size to the intrinsic values.  How do we get around this?  It seems like incorrect behavior.

           

          Thanks.

           

          Matt

          • 2. Re: Issue when media stops playing
            RyanOConnell Level 2

            I see the problem.  These two lines might be reseting your layout once metadata arrive (if the moov atom is somewhere near the end of the file):

             

            displayObject.width = info.width;

            displayObject.height = info.height;

             

            This is definitley a bug.  Thanks for the report.

             

            -Ryan

            • 3. Re: Issue when media stops playing
              mattparisi Level 1

              Glad I could help!

               

              Thanks

               

              Matt