Skip to main content
Known Participant
May 11, 2011
Question

Android / IOS Record Video and play with it ?

  • May 11, 2011
  • 3 replies
  • 5174 views

Is it possible to record video in Air 2.6 to mobile ?
I know I can getCamera... but after it, can I record ?

My goal is to make App that record video with the camera and push effect on it.

Tank you!

This topic has been closed for replies.

3 replies

Inspiring
October 23, 2014

FW_demo1.jpg

You might want to test my library and let me know - you can make apps such as this in AIR (for iOS definitely in this version), record camera plus any number of layers on top ^^

Shameless promo (but the lib is free for noncommerical use): Flash/AIR record videos of your apps and games: Rainbow Creatures

Shane Hoffa
Participant
April 11, 2012

Has anyone gotten this to work yet? I have a project where I need to capture video with the camera, play it back, and upload it to a server. Needs to run om iOS. Any solutions for this yet?

Thanks!

Participant
July 5, 2012

Hi Shane,

Have you had any luck with this? Trying to solve the same problem.

Participating Frequently
July 5, 2012

Nope, haven't succseded, I haven't tried to see how it works on the new ICS yet with the latest air sdk. Anyways good luck

May 11, 2011

You can definitely record video on both and have the data at your disposal.  As far as I know you cannot select a video from the "video roll" though so you will have to edit only the video you just recorded:

private var cameraRoll:CameraRoll = new CameraRoll();

private var dataSource:IDataInput;

        private var eventSource:IEventDispatcher;

vid_btn.addEventListener(MouseEvent.CLICK, openVideo);

private function openVideo(evt:MouseEvent):void{

deviceCameraApp = new CameraUI();

if( CameraUI.isSupported )

               {

                log( "Initializing camera..." );

                deviceCameraApp.addEventListener( MediaEvent.COMPLETE, videoSelected );

                deviceCameraApp.addEventListener( Event.CANCEL, captureCanceled );

                deviceCameraApp.addEventListener( ErrorEvent.ERROR, cameraError );

                deviceCameraApp.launch( MediaType.VIDEO );   //Changing this to IMAGE will make it take a picture

               }

               else

               {

                log( "Camera interface is not supported.");

               }

}

private function videoSelected( event:MediaEvent ):void

        {

            log( "Media selected..." );

            var videoPromise:MediaPromise = event.data;

            dataSource = videoPromise.open();

            if( videoPromise.isAsync )

            {

                log( "Asynchronous media promise." );

                eventSource = dataSource as IEventDispatcher;

                log( eventSource );

                eventSource.addEventListener( Event.COMPLETE, onVideoDataComplete );               

            }

}

**At this point, when the onVideoDataComplete function fires, you will have access to the bytes of the movie:

private function onVideoDataComplete(evt:Event):void

        {

            var videoBytes:ByteArray = new ByteArray();

            dataSource.readBytes( imageBytes );

            //the rest of this is just testing what we actually read

            log(videoBytes.length);

            videoBytes.position = 0;

            var string:String = videoBytes.readUTFBytes( 300 );

            log( string );

        }

**You can then do whatever you want with the bytes, such as save it to your local storage directory as a .mp4 and load it into flash

Does that help?

Participating Frequently
May 12, 2011

Does anybody know how to set the camera quality to High profile, flash sets it by default to Low quality profile and when it saves the 3gp the file cannot be played in flash