detecting when object is completely loaded

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
newmember
Forum Contributor
Posts: 252
Joined: Fri Apr 02, 2004 12:36 pm

detecting when object is completely loaded

Post by newmember »

Hi,

How can i test with javascript whether <object> like flash, quicktime and etc. has finished loading and ready for playback?
(for image i can use onload event)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it's easiest to have the object tell you, as it'll know far far better than the browser guessing.
User avatar
newmember
Forum Contributor
Posts: 252
Joined: Fri Apr 02, 2004 12:36 pm

Post by newmember »

what i'm trying to do is that i have an iframe into which i load image,wmw,mov,ram or swf file.
while object is loading I want to display some simple js animation and stop when object completely loaded.

How would you do that?
i guess onload event of iframe is useless because it fires when all tags are loaded and not when all content is loaded.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

could potentially use the onload event of the iframe, at least by that point the object should basically be loaded, whether fully loaded or not I'm not sure, but the object instance itself should exist by that point, so basically it is loaded.. it just may take that object a bit of time to find and load the media it's being pointed to..
User avatar
newmember
Forum Contributor
Posts: 252
Joined: Fri Apr 02, 2004 12:36 pm

Post by newmember »

it just may take that object a bit of time to find and load the media it's being pointed to
but basicly this is what takes the majority of time....loading/downloading the actual content :?
User avatar
newmember
Forum Contributor
Posts: 252
Joined: Fri Apr 02, 2004 12:36 pm

Post by newmember »

i investigated an options of using object properties that are exposed to javascript.
for example some one pointed me to this link:
http://developer.apple.com/documentatio ... ew-78.html

it is for quicktime...

i guess there is something similar for windows media and flash and realvideo... but it is really time-consuming (pita) to read all these various dev manuals and find the needed properties.... and add to that that this must work in at least mozilla based browsers and ie.
i would gladly take the challenge but not in these times.

Maybe you have some other ideas how to detect whether content is finished loading?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

unless the object itself tells the browser that it has finished loading the media through the DOM event model you'll pretty much have to write specific codes to check with each object or something similar.. that's all I can think of.
Post Reply