Closed GoogleCodeExporter closed 9 years ago
Thanks for the feedback, we will take the optimizations into account for the
next dev
cycle.
Original comment by bobbyvandersluis
on 16 Jul 2009 at 12:12
Just to let you know that this is important for me too.
I help maintain a site from within a Third Level Educational Institution where
staff
and students access the web from behind a proxy. Access to any site other than
our
own (which is publicly accessible/not an intranet) requires authentication.
When I view a YouTube video, in a page from our site, that was embedded the
using the
Dynamic Publishing method, I am asked for authentication. If authenticated the
video
shows. If not I get nothing, which is unexpected.
Original comment by davesmit...@gmail.com
on 8 Oct 2009 at 9:08
[deleted comment]
Having same problem.
I had hoped that the callback facility would let us replace our existing scheme
that
starts a timer and if it doesn't get an external call from the loaded swf in 10
secs,
fires an error routine.
Original comment by grey.fre...@gmail.com
on 30 Oct 2009 at 8:25
You can already check for the existence of a loaded SWF by probing the SWF's
PercentLoaded variable. Anything above 0 indicates that the file was found and
has started loading.
Here's some sample code:
var altcontent;
var callback = function (e){
if(e.success && e.ref){
setTimeout(function (){
if(typeof e.ref.PercentLoaded !== "undefined" && e.ref.PercentLoaded()){
alert("SWF loaded: (el.PercentLoaded(): " +e.ref.PercentLoaded() +").");
altcontent = null;
} else {
alert("SWF failed to load. Restoring ALT content.");
var div = document.createElement("div");
div.innerHTML = altcontent;
e.ref.parentNode.replaceChild(div, e.ref);
}
}, 100);
}
};
swfobject.addDomLoadEvent(function (){
altcontent = document.getElementById("myContent").innerHTML;
});
swfobject.embedSWF("test2.swf", "myContent", "300", "120", "8.0.0", "expressInstall.swf", false, false, false, callback);
I successfully tested this example in IE7, IE9, Firefox, Chrome, Safari and
Opera. The timeout duration might take some playing with, but the gist is there.
If any kind of check were added to SWFObject, it would probably mirror this
example (or something very similar); there's no way to get around using a timer
since Flash Player doesn't provide a synchronous "is file path valid" type of
variable, which forces us to poll the SWF itself. Flash Player takes a few
milliseconds to instantiate after the <object> is created in the DOM, so we
have to set a timer to check the SWF after a small amount of time has passed.
Since this functionality is already available without modifying the library,
this feature will not be added to SWFObject.
Original comment by platelu...@gmail.com
on 31 May 2011 at 10:12
Original issue reported on code.google.com by
bonassof...@gmail.com
on 15 Jul 2009 at 2:57