• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Monitor FLV download

Guest
Feb 04, 2009 Feb 04, 2009

Copy link to clipboard

Copied

Can anyone tell me how to do this? It seems like it should be incredibly simple. I started trying about 4 hours ago and thought I'd be done in 4 minutes...

I have an FLVplayback component that loads and plays an FLV file. Grand. What I want to do is monitor the loading progress and trigger a function at an arbitrary point. I want to make something happen when, say, 33% of the video is loaded.

The attached code does not work. I've tried a hundred variations of it and all of them call "doSomething()" instantly instead of waiting until the a certain amount of video is loaded.

Anyone know how to do this (or if it's even possible with AS3)?


TOPICS
ActionScript

Views

299

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 04, 2009 Feb 04, 2009

Copy link to clipboard

Copied

bytesLoaded and bytesTotal may read as zero to begin with, and so would trigger your routine. You could check for them being more than zero, or check > instead of >=


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 04, 2009 Feb 04, 2009

Copy link to clipboard

Copied

LATEST
It's not coming up as zero. It's actually coming up as this seemingly arbitrary number that isn't related to the size of the FLV file at all.

I'm still baffled by this, but I managed to find a crude workaround. The following code works and is meeting my needs for the time being, but I would still like to know if anybody finds a "right" way to do it, since adding in timers for this sort of thing seems obtuse.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines