I've made a little video player that does some javascript when a video finishes playing (it's a kind of playlist alternative, among other things).
In any event, on Linux, it works fine.. the video plays, it stops (because it's over), then the javascript function that gets called by OnMediaComplete runs & the interface changes. On Firefox 2.0 running on OSX, however, the OnMediaComplete function isn't running. Nothing happens - the function doesn't even get called (verified by outputting some javascript debug messages).
My embed (html) looks like:
Code:
embed
id='thevideo'
name='thevideo'
nocache=0
autostart=1
src='<%= embed_link %>'
loop='false'
width='<%= xres %>'
height='<%= yres %>'
onMediaComplete='javascript:changer();'
and my changer function looks like:
Code:
function changer(inc) {
document.getElementById("debug").innerHTML = "changer:";
if (inc != null)
counter = inc;
else
counter = (counter >= vidcount) ? 0 : counter;
var prev = (counter == 0) ? (vidcount-1) : (counter-1);
document.embeds['thevideo'].filename=vids[counter];
var tds = document.getElementsByTagName("td");
for(var i = 0; i < tds.length; i++){
tds[i].className = (tds[i].className == "highlight") ? "thumb" : tds[i].className;
}
document.getElementById(counter).className="highlight";
document.thevideo.Play();
el = document.getElementById("external");
el.setAttribute("href","./templates/force_download.php?file="+file[counter]);
document.getElementById("debug").innerHTML += vids[counter];
if (!looping)
counter++;
player();
}
Note that not even the first line of changer runs. Even if I only put that one innerHTML call in there - no go. I have verified that innerHTML does, in fact, work on this machine, so it's not that javascript is disabled or anything.
Any ideas on why this works under Linux but not under OSX? Maybe it's something in the embed - maybe I'm not calling the function properly?