Java Reference
In-Depth Information
break;
}
}
}
else
{
if (document.audioPlayer.readyState == 4)
{
plugInInstalled = true;
}
}
if (!plugInInstalled)
{
alert(“You need Quicktime to play the audio files!”);
}
}
onload = window_onload;
</script>
</head>
<body>
<object id=”audioPlayer”
classid=”clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B”
codebase=”http://www.apple.com/qtactivex/qtplugin.cab”
width=”320” height=”260”>
<param name=”src” value=”sound1.mp3” />
<param name=”controller” value=”false” />
<param name=”autoplay” value=”false” />
<embed name=”audioPlayer”
height=”260”
width=”320”
src=”sound1.mp3”
type=”video/quicktime”
pluginspage=”www.apple.com/quicktime/download”
controller=”false”
autoplay=”false”
/>
</object>
<a href=”#” onclick=”return play('sound1.mp3')”>Sound 1</a>
<a href=”#” onclick=”return play('sound2.mp3')”>Sound 2</a>
<a href=”#” onclick=”return play('sound3.mp3')”>Sound 3</a>
</body>
</html>
Save this as ch13_q1.htm .
This solution is based on the QuickTime example in the chapter. Note that the three sound fi les,
sound1.mp3 , sound2.mp3 , and sound3.mp3 , can be found in the code download for this topic.
Search WWH ::




Custom Search