2 Replies Latest reply on Apr 8, 2009 4:15 AM by gianiaz

    Display a video with adobe air

      Hi, I'm developing an html/ajax app on adobe air.

       

      In this app that runs in fullscreen I have 3 blocks where I show 3 different swf files. In one of this blocks I have to display a video.

       

      In a first attempt I wrote a little swf that loads an flv file locally (the file has been downloaded previously), but with an flv file of about 5 minutes (20Mb) the video is displayed slowly and the cpu jumps till 80/90%.

       

      I've thinked about display an mp4 file using this syntax, but It seems it doesn't work:

       

       

       

      <object width="480" height="208"
        classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
        codebase="http://www.apple.com/qtactivex/qtplugin.cab">
        <param name="src" value="../episodeIII_trl1_480x208.mp4">
        <param name="controller" value="true">
        <param name="autoplay" value="false">
      </object>

       

      Any idea?

       

      Thank you :-)

       

      Bye

        • 1. Re: Display a video with adobe air
          Joe ... Ward Level 4

          I can't say what is causing the slow down while playing your FLV, but as to the second part of your question, plug-ins such as Quicktime are not supported in AIR. Only Flash and PDF content can be embedded.

          • 2. Re: Display a video with adobe air
            Level 1

            Hi, first thank you for your answer.

             

            Regarding the flv player, I'm not a flash/actionscript programmer, I wrote the following code in the actionscript, do you see something wrong?

             

            var url;


            if(LoaderInfo(this.root.loaderInfo).parameters.url != undefined) {
              url = LoaderInfo(this.root.loaderInfo).parameters.url;
            }

             

            var customClient:Object = new Object();
            customClient.onMetaData = metaDataHandler;

            var nc:NetConnection = new NetConnection();
            nc.connect(null);

            var ns:NetStream = new NetStream(nc);
            ns.client = customClient;
            ns.play(url);

            var myVideo:Video = new Video();
            myVideo.attachNetStream(ns);
            addChild(myVideo);

            function metaDataHandler(infoObject:Object):void {
              if(LoaderInfo(this.root.loaderInfo).parameters.w == undefined) {
                myVideo.width = 300;
              } else {
                myVideo.width = LoaderInfo(this.root.loaderInfo).parameters.w;
              }
              if(LoaderInfo(this.root.loaderInfo).parameters.h == undefined) {
                myVideo.height = 200;
              } else {
                myVideo.height = LoaderInfo(this.root.loaderInfo).parameters.h;
              }