Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Reply
 
Thread Tools Rate Thread Display Modes
Old 05-14-2006, 01:58 PM   #1
vivoices
Motion, Stills, Audio
 
vivoices's Avatar
 
Join Date: May 2006
Location: Revaya
Posts: 84
Send a message via Skype™ to vivoices
Default Checking for complete FLV download in MediaDisplay ?

I need to check for complete download of a FLV file played in the MediaDisplay component.

The "progress" event is generated continuously until media has completely downloaded and the stops broadcasting.

I need a "FinishedDownloading" variable to be set to "true" AFTER the download completed, but the "progress" event already stoped broadcasting.

Any idea of how to set "FinishedDownloading" to "true" AFTER the download?

MX Pro 2004

Last edited by vivoices; 05-14-2006 at 02:01 PM.
vivoices is offline   Reply With Quote
Old 05-14-2006, 06:35 PM   #2
Flash Gordon
rather be programming
 
Flash Gordon's Avatar
 
Join Date: Feb 2005
Location: City of Angels
Posts: 10,140
Default

I have no idea how you are streaming the FLV in, but if you are using NetConnection and NetStream, the NetStream has a function where everything "change" gets flag-ed (for lack of a better word).

Try looking into that.
__________________
trace("Good bye Flash.") Log.i(TAG, "Hello Droid");
Flash Gordon is offline   Reply With Quote
Old 05-14-2006, 06:45 PM   #3
vivoices
Motion, Stills, Audio
 
vivoices's Avatar
 
Join Date: May 2006
Location: Revaya
Posts: 84
Send a message via Skype™ to vivoices
Default

I just set the media for the MediaDisplay component and it start downloading,

Vid.setMedia(VidPath, "FLV");

its very convenient to use MediaDisplay and MediaController.

MediaDisplay is broadcasting a "progress" event I want to assign a suiting function to set a "FinishedDownloading" variable to "true" AFTER the download.

I built everything so far arround the Media components, it would be a waste of time to recode for netstream.
vivoices is offline   Reply With Quote
Old 05-14-2006, 07:04 PM   #4
vivoices
Motion, Stills, Audio
 
vivoices's Avatar
 
Join Date: May 2006
Location: Revaya
Posts: 84
Send a message via Skype™ to vivoices
Default

I just wrote a test routine:
// ---- Test -> Vid is the MediaDisplay instance
_root.VidListenCount = 1;
VidListener = new Object();
VidListener.progress = function(){
_root.VidListenCount += 1;
}
Vid.addEventListener("progress", VidListener);
// ---- End Test

VidListenCount shows 1, thats it.

Has someone experience with the Media "progress" event?

Last edited by vivoices; 05-14-2006 at 07:07 PM.
vivoices is offline   Reply With Quote
Old 05-14-2006, 10:51 PM   #5
vivoices
Motion, Stills, Audio
 
vivoices's Avatar
 
Join Date: May 2006
Location: Revaya
Posts: 84
Send a message via Skype™ to vivoices
Default

My solution is reading the "bytesLoaded" property of the MediaDisplay instance within the "progress" listener function.

The last "bytesLoaded" value that the "progress" listener function reads is exactly the "bytesTotal" value, so I check against that to set my "FinishedDownloading" variable.
vivoices is offline   Reply With Quote
Old 05-22-2006, 09:40 PM   #6
m23
Registered User
 
Join Date: Jan 2006
Posts: 10
Default .getBytesLoaded() seems inaccurate

A problem we're having is that .getBytesLoaded() seems inaccurate.

Maybe the problem is elsewhere, but when .getBytesLoaded() equals .getBytesTotal(), the loading should be complete. But it's not. Using DU Meter to monitor file download progress, the file is still loading seconds (up to 10 or 20 seconds) after flash says the file load is complete. We have this problem both with the media component showing that loading is complete and with a custom ActionScript sound object.

Anyone else have this issue?
m23 is offline   Reply With Quote
Old 05-22-2006, 10:51 PM   #7
vivoices
Motion, Stills, Audio
 
vivoices's Avatar
 
Join Date: May 2006
Location: Revaya
Posts: 84
Send a message via Skype™ to vivoices
Default

I am reading the "bytesLoaded" and "bytesTotal" properties of the MediaDisplay component.
When my Class indicates "bytesLoaded == bytesTotal", network traffic stops half a second later.
vivoices is offline   Reply With Quote
Old 05-23-2006, 07:19 PM   #8
m23
Registered User
 
Join Date: Jan 2006
Posts: 10
Default

What's your connection speed?

I should mention that we have network software (Shunra) that let's us test at different connection speeds. When the connection is set for anything below around 256 kb, we start seeing some serious problems with the accuracy of getBytesLoaded(). I think the accuracy is always off, but just not apparent at faster connections.
m23 is offline   Reply With Quote
Old 05-23-2006, 08:00 PM   #9
vivoices
Motion, Stills, Audio
 
vivoices's Avatar
 
Join Date: May 2006
Location: Revaya
Posts: 84
Send a message via Skype™ to vivoices
Default

getBytesLoaded() is probably using different code than reading the properties directly from the MediaDisplay component.

When the server is not too busy, the FLV files are streaming at about 2Mbs = 250Kbyte/s.

Is Shunra free or cheap software? It would be interesting to see the behavior of my pages (in development) at lower speeds.

I see no need to test blow 1Mbs, since I wouldn't expect someone to stream 5 to 60MB videos over a slower connection.

I might test for speed and display a warning if below 1Mbs.

Last edited by vivoices; 05-23-2006 at 08:13 PM.
vivoices is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MovieClipLoader issues gring ActionScript 2.0 5 10-26-2005 04:47 PM
Preloading FLV:s with or w/o MediaDisplay willythekid ActionScript 2.0 7 06-16-2005 11:37 PM
Script run twice in download simulator MisterMister ActionScript 2.0 0 04-09-2005 02:57 PM
getURL after MediaDisplay completes.... Ci_Phon ActionScript 2.0 1 02-23-2005 11:53 AM
Capabilities Class padnpen ActionScript 2.0 1 12-28-2003 06:45 AM


All times are GMT. The time now is 03:46 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.