Skip to main content
Participant
8월 22, 2012 10:47 오전 UTC
공지사항

Air 3.4 official release - stageVideo.attachCamera doesn't display anything

Hello everybody,

since Air 3.4 in no longer in beta phase I've decided to write post about stageVideo.attachCamera method which should work but it just doesn't.

Here's source code:

          [SWF(frameRate="60", width="480", height="800")]

          public class AttachVideoTest extends Sprite {

                    private var _camera:Camera;

                    private var _stageVideo:StageVideo;

                    public function AttachVideoTest() {

                              stage.scaleMode = StageScaleMode.NO_SCALE;

                              stage.align = StageAlign.TOP_LEFT;

                              initCamera();

                              stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, stageVideoAvailabilityHandler);

                    }

                    private function initCamera():void{

                              _camera = Camera.getCamera();

                              _camera.setMode(320, 240, 10, false);

                    }

                    private function stageVideoAvailabilityHandler(event:StageVideoAvailabilityEvent=null):void {

                              if(event.availability == StageVideoAvailability.AVAILABLE && stage.stageVideos){

                                        trace("stageVideoAvailabilityHandler, stage.stageVideos: " +  stage.stageVideos);

                                        _stageVideo = stage.stageVideos[0];

                                        _stageVideo.viewPort = new Rectangle(0, 0, 320, 240);

                                        _stageVideo.attachCamera(_camera);

                              }

                    }

          }


The result is just white screen.
I've tested it on
- Samsung Galaxy i9100 with Android 4.0.4 (original rom from samsung, without any mods)

- Nexus S Android 4.0.1

Thank you very much for any he

이 주제는 답변이 닫혔습니다.

1 답변

Participant
11월 8, 2012 7:57 오전 UTC

me.. toooooo -_-

번역