1/***************************************************** 2* 3* Copyright 2009 Adobe Systems Incorporated. All Rights Reserved. 4* 5***************************************************** 6* The contents of this file are subject to the Mozilla Public License 7* Version 1.1 (the "License"); you may not use this file except in 8* compliance with the License. You may obtain a copy of the License at 9* http://www.mozilla.org/MPL/ 10* 11* Software distributed under the License is distributed on an "AS IS" 12* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 13* License for the specific language governing rights and limitations 14* under the License. 15* 16* 17* The Initial Developer of the Original Code is Adobe Systems Incorporated. 18* Portions created by Adobe Systems Incorporated are Copyright (C) 2009 Adobe Systems 19* Incorporated. All Rights Reserved. 20* 21*****************************************************/ 22package org.osmf.events 23{ 24 import flash.events.Event; 25 26 /** 27 * A MediaPlayer dispatches this event when its <code>state</code> property changes. 28 * 29 * @see org.osmf.media.MediaPlayerState 30 * 31 * @langversion 3.0 32 * @playerversion Flash 10 33 * @playerversion AIR 1.5 34 * @productversion OSMF 1.0 35 * @productversion FLEXOSMF 4.0 36 */ 37 public class MediaPlayerStateChangeEvent extends Event 38 { 39 /** 40 * The MediaPlayerStateChangeEvent.MEDIA_PLAYER_STATE_CHANGE constant defines the value 41 * of the type property of the event object for a mediaPlayerStateChange 42 * event. 43 * 44 * @eventType MEDIA_PLAYER_STATE_CHANGE 45 * 46 * @langversion 3.0 47 * @playerversion Flash 10 48 * @playerversion AIR 1.5 49 * @productversion OSMF 1.0 50 * @productversion FLEXOSMF 4.0 51 */ 52 public static const MEDIA_PLAYER_STATE_CHANGE:String = "mediaPlayerStateChange"; 53 54 /** 55 * Constructor. 56 * 57 * @param type Event type. 58 * @param bubbles Specifies whether the event can bubble up the display list hierarchy. 59 * @param cancelable Specifies whether the behavior associated with the event can be prevented. 60 * @param state New MediaPlayerState of the MediaPlayer. 61 * 62 * @langversion 3.0 63 * @playerversion Flash 10 64 * @playerversion AIR 1.5 65 * @productversion OSMF 1.0 66 * @productversion FLEXOSMF 4.0 67 */ 68 public function MediaPlayerStateChangeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, state:String=null) 69 { 70 super(type, bubbles, cancelable); 71 72 _state = state; 73 } 74 75 /** 76 * New MediaPlayerState of the MediaPlayer. 77 * 78 * @langversion 3.0 79 * @playerversion Flash 10 80 * @playerversion AIR 1.5 81 * @productversion OSMF 1.0 82 * @productversion FLEXOSMF 4.0 83 */ 84 public function get state():String 85 { 86 return _state; 87 } 88 89 /** 90 * @private 91 */ 92 override public function clone():Event 93 { 94 return new MediaPlayerStateChangeEvent(type, bubbles, cancelable, _state); 95 } 96 97 private var _state:String; 98 } 99}