问题
I am trying to record a time-limited video with Adobe AIR for iOS.
For example, I want to implement the following function. Start a one-minute timer before launching CameraUI to record video. When the timeout event happens after one minute, stop recording video, close the CameraUI view and obtain the video data so far.
I have several questions related to that.
How to stop recording video from outside the CameraUI view(in this case, from the timeout event handler) and then close the CemeraUI view? As far as I know, to close the CameraUI view, the only way is to press the [Use Video] button or the [Cancel] button from inside the CameraUI view. Is it possible to close it from outside?
Even if the first problem mentioned above is solved, then how can I get the video data so far(in this case, the video data before the timeout). I know that normally we can get a MediaPromise object from MediaEvent parameter of the complete handler, and read the video data from the MediaPromise object. But obviously in this case, we can not access the MediaPromise object just because the complete handler itself will not be executed since the [Use Video] button is not pressed.
Is it possible to add a stopwatch to show possible remaining recording time when CameraUI view is open? It seems that the CameraUI automatically uses the full screen of iOS device(in my case, iPad) and there is no extra space to show the stopwatch.
Are there any solutions or workarounds about the three problem above? I really appreciate it if anyone has any idea about this. Thanks in advance.
回答1:
I never worked with video specially on iOS, so I just putting down my thoughts on this issue, sorry if you find it useless.
- I suppose it's impossible to write video outside CameraUI (unless you write your own ANE for that), and I think it's a bad design why do you need that?
- Answer the same as 1.
- It impossible to add display objects at native windows (once again unless you write your own ANE)
In general if you want more freedom to work with video in AIR you can do it in three ways:
- Write you own ANE.
- To stream you video data to your own server, and do whatever you want with it.
- Least reliable way but you can try it. There is FLVRecorder library, I never tried it and even don't know does it work at all. Or you can try own approach (save you stage to bitmaps with some framerate and then encode it to video). It just suggestion I don't know will it work at all.
Hope my thoughts will help.
来源:https://stackoverflow.com/questions/29428148/how-to-record-a-time-limited-video-with-adobe-air-for-ios