Created
September 8, 2016 06:42
-
-
Save marchbold/c9f9e4eb01f552d933a1a5632ee7af89 to your computer and use it in GitHub Desktop.
Capture a Video using the Camera UI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CameraUI.service.addEventListener( CameraUIEvent.COMPLETE, cameraUI_completeHandler ); | |
CameraUI.service.addEventListener( CameraUIEvent.CANCEL, cameraUI_cancelHandler ); | |
var options:CameraUIOptions = new CameraUIOptions(); | |
options.videoQuality = QualityType.TYPE_HIGH; | |
CameraUI.service.launch( MediaType.VIDEO, options ); | |
... | |
private function cameraUI_completeHandler( event:CameraUIEvent ):void | |
{ | |
// Here you can use the event.path to access the media file as you require | |
// For example using the distriqt MediaPlayer: | |
MediaPlayer.service.createPlayer( event.path, 0, 0, 640, 480, true ); | |
MediaPlayer.service.addEventListener( MediaPlayerEvent.COMPLETE, function(e:MediaPlayerEvent):void { | |
MediaPlayer.service.removeEventListener( MediaPlayerEvent.COMPLETE, arguments.callee ); | |
MediaPlayer.service.removePlayer(); | |
}); | |
} | |
private function cameraUI_cancelHandler( event:CameraUIEvent ):void | |
{ | |
trace( "user cancel" ); | |
} | |
// com.distriqt.CameraUI |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment