0
votes

currently Iam Working on my Testapp Flash air 3.7 IOS IPAD.

MY app loads videos in h264 (mp4), it works fine in desktop but when I publish to my iPad or in Ipad Simulator the video is not visible. I habe packed the video files in IOS.

This is my function:

Please Help MAny Thanks

public function main()
        {
        stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onAvail);
    }

    private function onAvail(e:StageVideoAvailabilityEvent):void
    {
        stageVideoAvail = (e.availability == StageVideoAvailability.AVAILABLE);
        initVideo();
    }

    private function initVideo():void
    {
        var nc:NetConnection = new NetConnection();
        nc.connect(null);
        var ns:NetStream = new NetStream(nc);
        ns.client = this;

        if(stageVideoAvail)
        {
            sv = stage.stageVideos[0];
            sv.addEventListener(StageVideoEvent.RENDER_STATE, onRender);
            sv.attachNetStream(ns);
            trace('available');
        } 
        else 
        {
            var vid:Video = new Video(1371, 771);
            addChild(vid);
            vid.attachNetStream(ns);
            trace('not');
        }

        ns.play('cam9.mp4');
    }

private function onRender(e:StageVideoEvent):void
        {
            sv.viewPort = new Rectangle(0, 0, 1371, 771);
        }
2

2 Answers

0
votes

Are you adding the mp4 file to the included files list? (Flash Pro, Publish Settings, click on the target spanner button, General Tab, Included files)

0
votes

I know this is old but I've struggled with this same issue as of late, my videos were hiding behind the stage, as soon as i made all my displayObjects invisible, there was the video.

hope this helps someone out.

edit: I also did the above tutorial that crooksy suggested and again, the video was there, just behind everything else.