import org.osmf.display.*;
import org.osmf.events.MediaPlayerStateChangeEvent;
import org.osmf.media.MediaPlayerState;
private function testPlayerInit():void
{
application.testComp.testPlayer.addEventListener("mediaPlayerStateChange", mediaPlayerStateChangeHandler);
}
private function mediaPlayerStateChangeHandler(event:MediaPlayerStateChangeEvent):void
{
if (event.state == MediaPlayerState.READY)
application.testComp.testPlayer.dispatchEvent(new Event("mediaPlayerIsReady"));
else if (event.state == MediaPlayerState.PLAYING)
application.testComp.testPlayer.dispatchEvent(new Event("mediaPlayerIsPlaying"));
else if (event.state == MediaPlayerState.LOADING)
application.testComp.testPlayer.dispatchEvent(new Event("mediaPlayerIsLoading"));
}