15 Replies Latest reply on Jul 11, 2008 7:54 AM by Newsgroup_User

    Getting flv info from Director

    Level 7
      I have a swf file with only an flv file in it. How, through Lingo, can I
      access the file duration, current time and issue start and stop commands.

      Thanks for your help.

      Craig


        • 1. Re: Getting flv info from Director
          robdillon Most Valuable Participant
          Use an FLVPlayback component without a skin. Name the component instance and set the path for the flv to be used. Save the swf and link it to the Director movie. Then in Director you can use a behavior for each of the buttons that you make to play and stop the flv. Similarly, you can get the playheadPercentage and the totalTime property values to tell you the progress of the video.
          • 2. Re: Getting flv info from Director
            Level 7
            womp wrote:

            > I have a swf file with only an flv file in it. How, through Lingo, can I
            > access the file duration, current time and issue start and stop commands.

            Hi Craig,

            Have a look at my Director and Flash Video Tutorial at:
            http://www.deansdirectortutorials.com/FlashVideo/

            At the bottom of the page I have template files including:
            * Director file with swf member that can be dynamically linked to an external
            FLV. There is a behavior that lets you set the FLV the swf sprite will load.
            Also includes behaviors to stop, play and rewind the FLV, and wait until the
            end of the FLV

            * FLA file showing setup in Flash.

            regards
            Dean

            Director Lecturer / Consultant / Director Enthusiast
            http://www.deansdirectortutorials.com/
            http://www.multimediacreative.com.au
            email: d.utian@unsw.edu.au

            • 3. Re: Getting flv info from Director
              Level 7
              Dean,

              That is PERFECT. Between you and mediamacros, my week of suffering is over.
              THANKS SO MUCH (and yes, I'm yelling that)

              My approach was to create all the controls in Director and just have an AS2
              programmer create methods in a Flash MC to start and stop the FLV, set the
              flv time and read back the flv time and set the volume. Then I'd create the
              object like your or Chuck's code does and call those methods from Director.
              But the AS2 programmer I had wasn't able to do what I needed quickly. So
              with what you've offered, it will be easy.

              Thanks again

              Craig

              "Dean Utian" <d.utian@unsw.edu.au> wrote in message
              news:4865A4C2.68BA0D7E@unsw.edu.au...
              > womp wrote:
              >
              >> I have a swf file with only an flv file in it. How, through Lingo, can I
              >> access the file duration, current time and issue start and stop commands.
              >
              > Hi Craig,
              >
              > Have a look at my Director and Flash Video Tutorial at:
              > http://www.deansdirectortutorials.com/FlashVideo/
              >
              > At the bottom of the page I have template files including:
              > * Director file with swf member that can be dynamically linked to an
              > external
              > FLV. There is a behavior that lets you set the FLV the swf sprite will
              > load.
              > Also includes behaviors to stop, play and rewind the FLV, and wait until
              > the
              > end of the FLV
              >
              > * FLA file showing setup in Flash.
              >
              > regards
              > Dean
              >
              > Director Lecturer / Consultant / Director Enthusiast
              > http://www.deansdirectortutorials.com/
              > http://www.multimediacreative.com.au
              > email: d.utian@unsw.edu.au
              >


              • 4. Re: Getting flv info from Director
                Level 7
                Dean,

                The Flash developer I'm working with says that all of the controls within
                Flash are compiled and packaged and can't be changed. I thought, "Wow, Dean
                has this great stuff, all we need to do is go in and change the look of the
                buttons and their size and we're set" but then I noticed that 3 or four
                files are .swf that we can't edit. The Flash developer says that Adobe
                provides options for this stuff but you can't make your own unless you start
                from scratch and do everything, including the code, from scratch.

                Is there a way to use what I downloaded and completely customize the look
                without altering any of the code?

                Craig



                "Dean Utian" <d.utian@unsw.edu.au> wrote in message
                news:4865A4C2.68BA0D7E@unsw.edu.au...
                > womp wrote:
                >
                >> I have a swf file with only an flv file in it. How, through Lingo, can I
                >> access the file duration, current time and issue start and stop commands.
                >
                > Hi Craig,
                >
                > Have a look at my Director and Flash Video Tutorial at:
                > http://www.deansdirectortutorials.com/FlashVideo/
                >
                > At the bottom of the page I have template files including:
                > * Director file with swf member that can be dynamically linked to an
                > external
                > FLV. There is a behavior that lets you set the FLV the swf sprite will
                > load.
                > Also includes behaviors to stop, play and rewind the FLV, and wait until
                > the
                > end of the FLV
                >
                > * FLA file showing setup in Flash.
                >
                > regards
                > Dean
                >
                > Director Lecturer / Consultant / Director Enthusiast
                > http://www.deansdirectortutorials.com/
                > http://www.multimediacreative.com.au
                > email: d.utian@unsw.edu.au
                >


                • 5. Re: Getting flv info from Director
                  Production Monkey Level 3
                  If you are a Lingo programmer, then you don't need to rely on a clueless and/or lazy flash developer to create anything in flash to playback flash video in Director. You can build all your buttons and controls in Director using Lingo.

                  Here's an old post to get you started: http://director-online.com/forums/read.php?2,26461,26473#msg-26473
                  • 6. Re: Getting flv info from Director
                    Level 7
                    That appears to be exactly what I was looking for from the start. Although
                    Dean's method is one option, it appears to not offer the graphic flexibility
                    I'm looking for.

                    Thanks

                    Craig

                    "Production Monkey" <webforumsuser@macromedia.com> wrote in message
                    news:g46613$hj0$1@forums.macromedia.com...
                    > If you are a Lingo programmer, then you don't need to rely on a clueless
                    > and/or
                    > lazy flash developer to create anything in flash to playback flash video
                    > in
                    > Director. You can build all your buttons and controls in Director using
                    > Lingo.
                    >
                    > Here's an old post to get you started:
                    > http://director-online.com/forums/read.php?2,26461,26473#msg-26473
                    >


                    • 7. Re: Getting flv info from Director
                      Level 7
                      That Flash developer asked me whether I wanted a FLV component or some other
                      gibberish. The article says empty video object but he didn't seem to relate
                      to what that was. Do you know specifically what that means? I can make
                      that swf probably when I get back to my computer that has Flash on it on
                      Monday but for now I have to go to him to get the swf.

                      Craig

                      "Production Monkey" <webforumsuser@macromedia.com> wrote in message
                      news:g46613$hj0$1@forums.macromedia.com...
                      > If you are a Lingo programmer, then you don't need to rely on a clueless
                      > and/or
                      > lazy flash developer to create anything in flash to playback flash video
                      > in
                      > Director. You can build all your buttons and controls in Director using
                      > Lingo.
                      >
                      > Here's an old post to get you started:
                      > http://director-online.com/forums/read.php?2,26461,26473#msg-26473
                      >


                      • 8. Re: Getting flv info from Director
                        Production Monkey Level 3
                        Send him to the link and have him follow the instructions I provide for creating an empty video object inside a swf.

                        You will probably find a copy of the AS2 language reference useful: http://livedocs.adobe.com/flash/9.0/main/flash_as2_language_reference.pdf

                        Over the last hour I looked into retreiving some of the metadata you were interested in. Upon loading/buffering the video, a metadata event is generated. To retreive that data, add this line at the end of the Play() method.

                        pMe.setCallback(pNetStream, "onMetaData", #metaCallback, me)

                        And create a new method for the callback:

                        on metaCallback me, Info, Event
                        put Info.time
                        put Info.duration
                        end metaCallback

                        Put a break point inside this method to see what properties "Info" contains. On the test video I used the "duration" property is void, but the docs say it exists.

                        If you want to know the duration so that you can respond to the end of the video, then use the CallBack feature. That is the best approach. Just pass in the object you want called and the method to call when the video is stopped. Generally this would be a instance of a control object parent script, but a sprite behavior will work just as well. i.e.

                        on mouseUp me
                        pFlashVideoSprite.play("SummerVacation.flv", [#Ob:sprite(me.spriteNum), , #Method:#videoDone])
                        end

                        on videoDone me, VideoSprite
                        -- do something
                        end


                        And this may be helpful.

                        on exitframe me
                        put pNetStream.currentFps
                        put pNetStream.time
                        end


                        • 9. Re: Getting flv info from Director
                          Level 7
                          Well, I followed the instructions on how to create a swf with a video object
                          named VidRef. I saved the fla and published the swf.

                          I imported the swf, dropped the behavior from the post below and set the
                          .flv filename and folder it is in.

                          I played the Director movie and nothing plays. I get no errors but nothing
                          plays. I traced the beginsprite handler and the path name to the video is
                          correct.

                          Can you suggest any solutions?

                          Craig

                          "Production Monkey" <webforumsuser@macromedia.com> wrote in message
                          news:g46613$hj0$1@forums.macromedia.com...
                          > If you are a Lingo programmer, then you don't need to rely on a clueless
                          > and/or
                          > lazy flash developer to create anything in flash to playback flash video
                          > in
                          > Director. You can build all your buttons and controls in Director using
                          > Lingo.
                          >
                          > Here's an old post to get you started:
                          > http://director-online.com/forums/read.php?2,26461,26473#msg-26473
                          >


                          • 10. Re: Getting flv info from Director
                            Level 7
                            and by the way, i'm using director 11 and flash cs3. I created an fla for
                            AS2

                            Craig

                            "WOMP" <forums@wordofmo.com> wrote in message
                            news:g4bb4t$9ph$1@forums.macromedia.com...
                            > Well, I followed the instructions on how to create a swf with a video
                            > object named VidRef. I saved the fla and published the swf.
                            >
                            > I imported the swf, dropped the behavior from the post below and set the
                            > .flv filename and folder it is in.
                            >
                            > I played the Director movie and nothing plays. I get no errors but
                            > nothing plays. I traced the beginsprite handler and the path name to the
                            > video is correct.
                            >
                            > Can you suggest any solutions?
                            >
                            > Craig
                            >
                            > "Production Monkey" <webforumsuser@macromedia.com> wrote in message
                            > news:g46613$hj0$1@forums.macromedia.com...
                            >> If you are a Lingo programmer, then you don't need to rely on a clueless
                            >> and/or
                            >> lazy flash developer to create anything in flash to playback flash video
                            >> in
                            >> Director. You can build all your buttons and controls in Director using
                            >> Lingo.
                            >>
                            >> Here's an old post to get you started:
                            >> http://director-online.com/forums/read.php?2,26461,26473#msg-26473
                            >>
                            >
                            >


                            • 11. Re: Getting flv info from Director
                              Production Monkey Level 3
                              Try "putting" the event code in the statusCallback handler.

                              on statusCallback me, Info, Event
                              put Event.code
                              ......

                              If information is sent to the message window, then your video is playing. Director just doesn't like your codec. I have not tried playing a video using an H.264 codec. I would be surprised if that worked.

                              Try this video:
                              Set the video name to " http://www.helpexamples.com/flash/video/water.flv"
                              Set the folder name to "".

                              If that video plays fine then there is something wrong with your flash video. Otherwise you are going to have to step through the program. Set a break point at the begining of the Play() handler. Step through each line until something comes back void or just doesn't look right.
                              • 12. Re: Getting flv info from Director
                                Level 7
                                thanks, I'll give it a try

                                "Production Monkey" <webforumsuser@macromedia.com> wrote in message
                                news:g4dm7f$jb$1@forums.macromedia.com...
                                > Try "putting" the event code in the statusCallback handler.
                                >
                                > on statusCallback me, Info, Event
                                > put Event.code
                                > ......
                                >
                                > If information is sent to the message window, then your video is playing.
                                > Director just doesn't like your codec. I have not tried playing a video
                                > using
                                > an H.264 codec. I would be surprised if that worked.
                                >
                                > Try this video:
                                > Set the video name to " http://www.helpexamples.com/flash/video/water.flv"
                                > Set the folder name to "".
                                >
                                > If that video plays fine then there is something wrong with your flash
                                > video.
                                > Otherwise you are going to have to step through the program. Set a break
                                > point
                                > at the begining of the Play() handler. Step through each line until
                                > something
                                > comes back void or just doesn't look right.
                                >
                                >


                                • 13. Re: Getting flv info from Director
                                  Level 7
                                  womp wrote:

                                  > That appears to be exactly what I was looking for from the start. Although
                                  > Dean's method is one option, it appears to not offer the graphic flexibility
                                  > I'm looking for.

                                  Hi Craig,

                                  Sorry for the delay in replying. I didn't see the replies. My link does provide
                                  the FLA file where you can can change the look of the swf that calls the FLV. Is
                                  that what you're after or something else?

                                  regards
                                  Dean

                                  Director Lecturer / Consultant / Director Enthusiast
                                  http://www.deansdirectortutorials.com/
                                  http://www.multimediacreative.com.au
                                  email: d.utian@unsw.edu.au


                                  • 14. Re: Getting flv info from Director
                                    Level 7
                                    Dean,

                                    It may very well be. I'm sorry I didn't see the fla. I will check it out.

                                    Craig

                                    "Dean Utian" <d.utian@unsw.edu.au> wrote in message
                                    news:487043C9.84D6156E@unsw.edu.au...
                                    > womp wrote:
                                    >
                                    >> That appears to be exactly what I was looking for from the start.
                                    >> Although
                                    >> Dean's method is one option, it appears to not offer the graphic
                                    >> flexibility
                                    >> I'm looking for.
                                    >
                                    > Hi Craig,
                                    >
                                    > Sorry for the delay in replying. I didn't see the replies. My link does
                                    > provide
                                    > the FLA file where you can can change the look of the swf that calls the
                                    > FLV. Is
                                    > that what you're after or something else?
                                    >
                                    > regards
                                    > Dean
                                    >
                                    > Director Lecturer / Consultant / Director Enthusiast
                                    > http://www.deansdirectortutorials.com/
                                    > http://www.multimediacreative.com.au
                                    > email: d.utian@unsw.edu.au
                                    >
                                    >


                                    • 15. Re: Getting flv info from Director
                                      Level 7
                                      Dean,

                                      I knew I wasn't a complete idiot. I had looked at your fla but what I was
                                      looking for was a way to control everything from Lingo and only have a swf
                                      with a FLV in it. All of the control elements would be Director elements.
                                      I found some code that seemed to be well written that addressed this but I
                                      couldn't get it to work in the short time I had.

                                      Thanks again for your help.

                                      Craig

                                      "Dean Utian" <d.utian@unsw.edu.au> wrote in message
                                      news:487043C9.84D6156E@unsw.edu.au...
                                      > womp wrote:
                                      >
                                      >> That appears to be exactly what I was looking for from the start.
                                      >> Although
                                      >> Dean's method is one option, it appears to not offer the graphic
                                      >> flexibility
                                      >> I'm looking for.
                                      >
                                      > Hi Craig,
                                      >
                                      > Sorry for the delay in replying. I didn't see the replies. My link does
                                      > provide
                                      > the FLA file where you can can change the look of the swf that calls the
                                      > FLV. Is
                                      > that what you're after or something else?
                                      >
                                      > regards
                                      > Dean
                                      >
                                      > Director Lecturer / Consultant / Director Enthusiast
                                      > http://www.deansdirectortutorials.com/
                                      > http://www.multimediacreative.com.au
                                      > email: d.utian@unsw.edu.au
                                      >
                                      >