6 Replies Latest reply on Aug 8, 2006 1:25 AM by Newsgroup_User

    Detect Metadata presence in FLV

    kaos
      There is a way to detect for true o false or whatever if an flv has metadata or not???
      Ia have made a custom flv player for a website, and I need to determine if there´s metadata or not coming in the flv file, so, if metadata is present I ´ll show a full control with seek bar if not, seek bar is hidden.
      Please Heeelp! I need to solve this quickly.
      Many Thanks

        • 1. Re: Detect Metadata presence in FLV
          seand03 Level 2
          I think there will always be metadata present for some things but I think you are talking about cue points considering you are using metadata to move show or not show the seek bar. I got the following code from the livedocs for flash. I think you would want to check for cuePoints.length == 0 if so then don't show the seek bar other wise show the seek bar.
          Sean
          .
          import mx.video.*;
          var listenerObject:Object = new Object();
          listenerObject.metadataReceived = function(eventObject:Object):Void {
          trace("canSeekToEnd is " + my_FLVPlybk.metadata.canSeekToEnd);
          trace("Number of cue points is " + my_FLVPlybk.metadata.cuePoints.length);
          trace("Frame rate is " + my_FLVPlybk.metadata.framerate);
          trace("Height is " + my_FLVPlybk.metadata.height);
          trace("Width is " + my_FLVPlybk.metadata.width);
          trace("Duration is " + my_FLVPlybk.metadata.duration + " seconds");
          };
          my_FLVPlybk.addEventListener("metadataReceived", listenerObject);
          my_FLVPlybk.contentPath = " http://www.helpexamples.com/flash/video/cuepoints.flv";
          • 2. Re: Detect Metadata presence in FLV
            Level 7
            > I think there will always be metadata present for some things but I think
            you
            > are talking about cue points


            No, I don;t think so. Some FLV encoders don't inject the FLV metadata, which
            means you can't get the duration of the clip, which means you can't build a
            seek bar.

            Kaos, this is just an idea - I don;t have time to try it. I suspect that
            even if there's no metadata, the FLV will still generate an onMetaData
            event. Catch this event, check for duration and if it doesn't exist, or is
            zero or undefined or null, assume there's no metadata

            --
            -------------------------------
            Remove '_spamkiller_' to mail
            -------------------------------


            • 3. Re: Detect Metadata presence in FLV
              kaos Level 1
              Thanks all you guy for the answers.
              The problem is this... the old flvs on site they have no metadata at all, and new ones have full metadata info.
              but wen I load one of those that doesn´t have MD I can´t make even a trace of .
              • 4. Re: Detect Metadata presence in FLV
                Level 7
                > but wen I load one of those that doesn?t have MD I can?t make even a
                trace of

                Does it generate an onMetaData event?

                --
                -------------------------------
                Remove '_spamkiller_' to mail
                -------------------------------


                • 5. Re: Detect Metadata presence in FLV
                  kaos Level 1
                  Thanks again.. the problem is... >I don´t know how to trace if there´s metadata or not! the only I need is like an "if" metadata is present, do something, elso do something else. That simple! but don´t know how.....
                  • 6. Re: Detect Metadata presence in FLV
                    Level 7
                    Do you know how to capture the onMetaData event?

                    http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context= LiveDocs_Parts&file=00002562.html

                    Try this, with a stream you know has no metadata. See if the event is
                    captured. See what is traced for duration. From there you will be bale to
                    figure out how to ascertain whether an FLV has metadata or not.

                    --
                    -------------------------------
                    Remove '_spamkiller_' to mail
                    -------------------------------