0 Replies Latest reply on Jan 14, 2008 2:29 AM by

    FLV Datarate

      I want to detect the datarate of a loaded Video so that I can compare it to the users bandwidth to set a bufferTime.

      With this piece of code I've checked that the data is indeed available in the FLV:

      ns["onMetaData"] = function (obj) {
      for (var propName:String in obj) {
      trace(propName+" = "+obj[propName]);
      }
      };

      This returns the list with all the data embedded in the movie: (removed some parts in this list)
      audiodatarate = 128
      videodatarate = 1000
      duration = 48.68

      I know how to get the duration from the video which is simply:

      ns["onMetaData"] = function (obj) {
      duration = obj.duration;
      };

      but this doesn't work for:

      ns["onMetaData"] = function (obj) {
      datarate = obj.videodatarate;
      };

      I've been browsing a bit through the help files and the forums but couldn't find my answer there.
      So the question is, how do I get the datarate from the movie.
      Obviously I could set it manually for each movie but that would mean I have to set it every time I put in a new movie with a different encoding which isn't wat I want :)

      Thanks in advance.