6 Replies Latest reply on Aug 3, 2010 4:50 AM by flexJu

    Deploy application on Linux

    flexJu

           Hello,

      I'm currently deploying an Air application on a Ubuntu distribution and the behaviour of this application slightly differs from its behaviour on Windows.

       

      On most of the problems, I could find a solution but it remains two issues I can't fix.

      First one, the load function for MP3. When I load a MP3 in order to get the metadata especially the length of the mp3, my Windows app succeed but in ubuntu, the load is never dne, and even the complete event of the load never launched.

       

      Second one, the camera. I attach a webcam to a videodisplay and visualize it on my screen. In Windows, i can put my video up to 1600x1200 in resolution but in Ubuntu, the same code doesn't allow me to get a resolution better than 320x240. WHen I force it to a 640x480, the image stills stand in a ugly 320x240 pixels.

       

      What can I do to avoid these deploying issue.

      I m working witth flash builder with flex 4.0 and AIR 2.0.

      My ubuntu is 9.1 with a linux kernel 2.6.31.

      Thanks in advance for those who have an answer.

      Regards

      Julien

        • 1. Re: Deploy application on Linux
          Romil Mittal Adobe Employee

          Hi Julien,

           

          Camera resolution issue is a known bug on AIR Linux, and we are working on it.

           

          Regarding loading of MP3, we are still trying to reproduce the issue at our end. Does it happen with any MP3 file? We will get back to you as soon as we have any information.

           

          Thanks,

          -romil

          1 person found this helpful
          • 2. Re: Deploy application on Linux
            sameer_b

            Hi Julien,

             

            I am trying to reproduce the problem with the sound, Here's what I am doing and it works fine for me. I get the complete event and can display the length too.

             

            var s:sound = new Sound();

            s.addEventListener(Event.COMPLETE, function() : void{

                 l1.text = s.length.toString();                     // l1 is a label, I display the sound lenght in.

                 s.play();

            }

            s.load(new URLRequest(<path to your file>));

             

            It would be great if you could share a sample of the code and the mp3 file you are having trouble with.

             

            Thanks,

            Sameer

            1 person found this helpful
            • 3. Re: Deploy application on Linux
              flexJu Level 1

              First thanks for the replies,

              as you said that it works for you, I figure out that my problems came from my implementation, but still can't figure out where it is.

              I simplified my code in order to post it clearly:

               

              <?xml version="1.0" encoding="utf-8"?>
              <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
                               xmlns:s="library://ns.adobe.com/flex/spark"
                               xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300">
                      <fx:Script>
                              <![CDATA[
                                      import mx.controls.Alert;
                                      import mx.events.ListEvent;
                                      [Bindable]
                                      public var mp3Directory:File=new File(File.documentsDirectory.url+"/Briche/MP3");
                                      public var mp3:Sound;
                                      protected function MP3_changeHandler():void
                                      {
                                              mp3=new Sound();
                                              mp3.addEventListener(Event.COMPLETE, id3Handler);
                                              Alert.show(MP.selectedPath,"MP3");
                                              mp3.load(new URLRequest(MP.selectedPath));
                                              // TODO Auto-generated method stub
                                      }
                                      //getting the meta data from the mp3
                                      private function id3Handler(event:Event):void
                                      {
                                              var length:Number=mp3.length/1000;
                                              Alert.show(mp3.url,length.toString());
                                      }
                              ]]>
                      </fx:Script>
                      <fx:Declarations>
               
                      </fx:Declarations>
                      <mx:FileSystemTree id="MP"
                                                         width="180" height="400"
                                                         directory="{mp3Directory}"
                                                         enumerationMode="filesAndDirectories"
                                                         extensions="[mp3]"
                                                         borderAlpha="0"
                                                         dragEnabled="true"
                                                         dragMoveEnabled="true"
                                                         change="MP3_changeHandler()"/>
              </s:Group>

              So when I try this code on linux, I can do some stuff. If I try to load an mp3 I join with my application
              and which is present in /opt/.../share/, it succeeds. But if I try another mp3 located anywhere else on my computer, it fails.
              Here is where I am in my problem.

              Julien
              • 4. Re: Deploy application on Linux
                sameer_b Level 1

                Yes you are right, the sound clip does not load when dynamically setting the url. But, I see that when I hardcode the mp3 file in my urlrequest, I can load the file and I get the required events. Thanks for bringing this to our notice. I will get back to you on this.

                 

                Thanks,

                Sameer

                • 5. Re: Deploy application on Linux
                  sameer_b Level 1

                  Hi Julien,

                   

                  You would have to add "file:\\" to the path returned by FileSystemTree before calling load() on linux. Let me know if that doesn't work.

                   

                  Thanks,

                  Sameer

                  • 6. Re: Deploy application on Linux
                    flexJu Level 1

                    Hi Sameer,

                    thanks for your reply, it was really useful.

                    In fact it is not "file:\\" you have to add but "file://" and then everything works fine.

                    Thank you for your interest and your answers.

                     

                    Best

                    Julien