I have enabled autoPlay=false in my player but I can't find what event is triggered so I can enable some other actions, I have listeners for:
but neither of them fire when the autoPlay is set to false, they fire normaly if I press play.
Thanks in advance.
Message was edited by: Mike_Dobs
autoPlay=false will trigger the load and ready events.
You can use something like this:
player = new MediaPlayer();
player.addEventListener(MediaPlayerStateChangeEvent.MEDIA_PLAYER_STATE _CHANGE, onPlayerStateChange);
private function onPlayerStateChange(event:MediaPlayerStateChangeEvent):void
//do something when finished loading the video
Does this help?
Well I have tried this, I'm actually listening for 3 events:
but still no luck, nothing seems to fire at least not before i press play.
I'm defining the playerInstance.mediaPlayer.autoPlay = false; before I define the source of the video, does this cause some kind of problem? So the events dont fire?
First and last events will not be triggered until playback starts.
autoplay=true will just trigger the playback when the asset has been loaded. setting it to false is ok before adding the medialelement.
Weren't you able to use my snippet of code to get the MediaPlayerState.READY?
And more important: what are you trying to accomplish?
Thanks for helping me out with this.
Yes you are correct I should mention my goal from the start. Well what I'm trying to do is auto pause the movie but at the same time to allow it, to fill the buffer.
I tried your snippet but no events seem to fire whatsoever..., when the playback started I only got "buffering" and then "playing".
the buffering event indicates that the playback is stopped and it has switched into buffering-only mode. This is used to allow a player to show a visual indicator that the playback is stalled due to buffering
Your movie is still buffering behind the scenes - take a look at the StrobeMediaPlayback buffering progress indicator for progressive media.
You could take the same approach: use a small inital buffer to speed up the loading of the movie and then to increase the buffer size after your own rules. SMP sets a value large enough to prevent playback interruption for normal network conditions, but you could use your own approach - e.g, when you reach the desired buffertime level and you still have memory and you still have bytes to download, you could increase the buffer again.
I would expect what you describe to happen but I also have : playerInstance.mediaPlayer.addEventListener(LoadEvent.BYTES_LOADED_CH ANGE,updateBuffer,false,0,true); I use this for the buffering mechanism.
However this does not fire either, so my buffering indicator (simply a Sprite filling with color) isn't increasing either. I have tried most of the OSMF events but almost none fire before the playback starts.
I'm not using SMP at the moment this is a custom player with the OSMF as its core.
Europe, Middle East and Africa