Copy link to clipboard
Copied
Is it possible to play or pause a video by clicking on the video itself than using the control bar's play and stop buttons ? If yes then how can we do it ?
When you define the video object, simply add an event listener like:
myVideo.addEventListener(MouseEvent.CLICK, toggleVideoPlayback);
private function toggleVideoPlayback(e:MouseEvent):void {
//if playing, pause
//if paused, play
}
Copy link to clipboard
Copied
Just add an event listener to the video display object itself. Are you building your own playback or using something prepackaged?
Copy link to clipboard
Copied
Building own playback with movieclips and buttons. Can you please help me with the code ?
Copy link to clipboard
Copied
When you define the video object, simply add an event listener like:
myVideo.addEventListener(MouseEvent.CLICK, toggleVideoPlayback);
private function toggleVideoPlayback(e:MouseEvent):void {
//if playing, pause
//if paused, play
}
Copy link to clipboard
Copied
Thanks...In case I had used the pre packaged flv player would I had to write the same code ?
Copy link to clipboard
Copied
The component player has its own listeners built in, I believe.
FLVPlayback - Adobe ActionScript® 3 (AS3 Flash) API Reference
Copy link to clipboard
Copied
Ok Thanks.