I have a hidden embedded QuickTime object on my page that I'm trying to control via JavaScript, but it's not working. The object looks like this:
<object id="myPlayer" data="" type="audio/mpeg" pluginspage="http://www.apple.com/quicktime/download" width="0" height="0">
<param name="autoPlay" value="false" />
<param name="controller" value="false" />
<param name="enablejavascript" value="true" />
</object>
There is nothing in the data parameter because at render time, I don't know the URL that's going to be loaded. I set it like this:
var player = document.getElementById("myPlayer");
player.SetURL(url);
The audio will later be played back with:
player.Play();
Firefox 3.0.3 produces no error in the JavaScript console, but no playback occurs when Play()
is called. Safari 3.0.4 produces the following error in the console:
"Value undefined (result of expression player.SetURL) is not object."
Internet Explorer 7.0.5730.11 gives the following extremely helpful error message:
"Unspecified error."
I have QuickTime version 7.4 installed on my machine. Apple's documentation says that SetURL()
is correct, so why does it not work?