3 Replies Latest reply on Nov 7, 2012 6:30 AM by sinious

    MAC to PC Publishing as Projector - Changing Component Parameter source (FLVPlayback)

    Grant H Level 4

      Hello.

       

      (MAC - Flash Pro 11.5.1.349 "CS5.5")

       

      I have created a flash document with the intention of publishing it as a standalone projector. In it i have 3  (relatively large) FLV videos that need to load externally with the playback component.

       

      The source file path on my mac is lets say: /Volumes/Data Drive/Clients/shell/digitalKiosk/movies/movie1.flv

       

      I need to change this to the movie on the clients PC e.g.  C:\SHELL_MF\movies\movie1.flv

       

      I can see that I can change the source in the properties panel but it wont accept the PC syntax (well OBV I suppose)...  so, what is the correct way of doing this?

       

      kind regards

      Grant

        • 1. Re: MAC to PC Publishing as Projector - Changing Component Parameter source (FLVPlayback)
          sinious Most Valuable Participant

          Relative paths. If the EXE is in a folder which contains the "movies" folder then simply use:

           

          ./movies/movie1.flv

          1 person found this helpful
          • 2. Re: MAC to PC Publishing as Projector - Changing Component Parameter source (FLVPlayback)
            Grant H Level 4

            hi sinious.

             

            thanks for replying, yes relative path will work and I have already used it simply as for e.g. movie1.flv

             

            the problem is my client has other movies in other folders that the EXE would need to access. The simple solution would be to copy those files (movies etc) to the same folder but alas my client doesnt want to do that for some sound reasons and some not so much.

             

            So Couldnt i type in the path as such?

             

            C/SHELL_MF/movies/movie1.flv

             

             

            G

            • 3. Re: MAC to PC Publishing as Projector - Changing Component Parameter source (FLVPlayback)
              sinious Most Valuable Participant

              You can always directly type a path. If you resolve a File (object) path in AIR the .nativePath property will give you just that, a full OS path to your file like above: C:\SHELL_MF\movies\movie1.flv.

               

              Off the top of my head, the filesystems are so different between *nix and Windows you really can't solve it unless perhaps one of two things is an acceptible solution.

               

              1, Use one of the folders AIRs File object has access to so you can begin appending relative paths again. They are:

              • File.applicationStorageDirectory—a storage directory unique to each installed AIR application
              • File.applicationDirectory—the read-only directory where the application is installed (along with any installed assets)
              • File.desktopDirectory—the user's desktop directory
              • File.documentsDirectory—the user's documents directory
              • File.userDirectory—the user directory

               

              If you can agree to use any of those folders which are outside the applications directory then you have a unified way to access it via AIR. Just resolve the local path of the file like:

               

              var movie:File = File.documentsDirectory.resolvePath('movies/movie1.flv');

              trace(movie.nativePath);

               

              Each OS will trace a different path.

               

              2, Consider using a bridge. I almost always use XML files to provide external data to my applications. If your client wants to wildly use random paths then you can make an XML file that contains a full path to each and every file containing the differences for each OS.

               

              e.g.

              <?xml version="1.0" encoding="utf-8">

              <Files>

                   <File id="1">

                        <Windows>C:\SHELL_MF\movies\movie1.flv</Windows>

                        <Mac>/Volumes/Data Drive/Clients/shell/digitalKiosk/movies/movie1.flv</Mac>

                   </File>

                   <File id="2">

                        <!-- etc... -->

                   </File>

              </Files>

               

              Then you can wildly stick anything anywhere you want. Either use the nodes index or add a simple id attribute so you can call up the movie you want and grab the proper path for the OS.

               

              Otherwise I don't really see any way to develop the application in a unified way without specializing it for each OS and adding a bunch of hard coded paths. I'm not a fan of hard coding and I'm pretty sure you're not either. I don't like to recompile just to add a new movie.

               

              A potential third thing would be to simply agree on the name of the folder the client can put movies in and put it in root, e.g. C:\DATA\movies and /DATA/movies. But that doesn't appear to be the case here and it makes an "unknown" dependancy that will need to be remembered. Not really ideal.