05-14-2006, 01:58 PM
|
#1
|
|
Motion, Stills, Audio
Join Date: May 2006
Location: Revaya
Posts: 84
|
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.
|
|
|
05-14-2006, 06:35 PM
|
#2
|
|
rather be programming
Join Date: Feb 2005
Location: City of Angels
Posts: 10,141
|
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");
|
|
|
05-14-2006, 06:45 PM
|
#3
|
|
Motion, Stills, Audio
Join Date: May 2006
Location: Revaya
Posts: 84
|
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.
|
|
|
05-14-2006, 07:04 PM
|
#4
|
|
Motion, Stills, Audio
Join Date: May 2006
Location: Revaya
Posts: 84
|
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.
|
|
|
05-14-2006, 10:51 PM
|
#5
|
|
Motion, Stills, Audio
Join Date: May 2006
Location: Revaya
Posts: 84
|
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.
|
|
|
05-22-2006, 09:40 PM
|
#6
|
|
Registered User
Join Date: Jan 2006
Posts: 10
|
.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?
|
|
|
05-22-2006, 10:51 PM
|
#7
|
|
Motion, Stills, Audio
Join Date: May 2006
Location: Revaya
Posts: 84
|
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.
|
|
|
05-23-2006, 07:19 PM
|
#8
|
|
Registered User
Join Date: Jan 2006
Posts: 10
|
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.
|
|
|
05-23-2006, 08:00 PM
|
#9
|
|
Motion, Stills, Audio
Join Date: May 2006
Location: Revaya
Posts: 84
|
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.
|
|
|
| Thread Tools |
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 03:50 PM.
///
|
|