Skip to main content
Inspiring
March 16, 2009
Question

How do I get BytesLoaded / BytesTotal with Flex.VideoDisplay

  • March 16, 2009
  • 2 replies
  • 1206 views
Hello,

I've created a video player/recorder in flex using FMS and the VideoDisplay component. I'm trying to write the download progress bar into the play scrubber. The typical properties I'd use are VideoDisplay.bytesLoaded and VideoDisplay.bytesTotal however I only get -1 back for both properties. The Flex 3.3 language reference says that its all you'll get back when using the FMS. I'm wondering if anyone knows where to pull the data from then if its -1 with the FMS. I'm not sure how I can create a download progress bar without it. If anyone has any clues I'd welcome it.

Also flash.events.ProgressEvent.PROGRESS is never thrown so I have no chance to pull it from there.


Thanks,
Pete
    This topic has been closed for replies.

    2 replies

    Participant
    March 17, 2009
    I assume you use something like
    public var mediaStream:NetStream;

    So to find out how much has been loaded you can get the time into the stream you are, and add how much is buffered.

    this.mediaStream.time + this.mediaStream.bufferLength
    Inspiring
    March 17, 2009
    If you are developing off the localhost, the progress event will not throw. The video downloads too quickly basically. It says this somewhere in the documenation I believe. You'll need to download the video on a 'slower' host to get the progress event to throw properly.

    Someone correct me if I am wrong... I don't have time to verify what I remember but I'm 94.5% sure.