An abstract state player state that changes the functionality of the play, pause, stop, etc. methods depending on the player state.
import com.google.ads.studio.events.StudioVideoEvent;
import com.google.ads.studio.video.AbstractPlayerState;
import com.google.ads.studio.video.PlayingState;
import com.google.ads.studio.video.VideoController;
videoPlayer.addEventListener(
StudioVideoEvent.STATE_CHANGE,
function(event:StudioVideoEvent):void {
var controller:VideoController = (
videoPlayer.getCurrentVideoController());
var state:AbstractPlayerState = controller.getPlayerState();
if (state is PlayingState) {
playPauseButton.gotoAndStop(1);
} else {
playPauseButton.gotoAndStop(2);
}
});
Constructors
AbstractPlayerState(videoController:
VideoController)Creates a new AbstractPlayerState.
Instance Methods
Defined in com.google.ads.studio.video:AbstractPlayerState
getStateType()
:
String
Returns the player state as a string such as "InitialState",
"BufferingState", "LoadingState",
"PausedState", "PlayingState", or
"StoppedState". It is encouraged to use
videoController.getPlayerState() and match against the
relevant class using instanceof or is.
pause(alwaysPause:Boolean=false)
:
AbstractPlayerStateThe pause command implementation for the current state.
play()
:
AbstractPlayerStateThe play command implementation for the current state.
seek(time:Number)
:
AbstractPlayerStateThe seek command implementation for the current state.
stop()
:
AbstractPlayerStateThe stop command implementation for the current state.
- com.google.ads.studio
- com.google.ads.studio.configurable
- com.google.ads.studio.display
- com.google.ads.studio.events
- com.google.ads.studio.expanding
- com.google.ads.studio.localconnect
- com.google.ads.studio.video
- com.google.ads.studio.vpaid
