控制real player的播放
播放頁面:fx.html
代碼:
<HTML>
<HEAD>
<TITLE>control realplayer with javascript in firefox</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
// Test the playback status
function isPlaying() {
if(document.javademo.CanPlay()) {
alert("The player is currently paused or stopped.")
}
else {
alert("The player is currently playing.")
}
}
function isPaused() {
if(document.javademo.CanPause()) {
alert("The player is currently playing.")
}
else {
alert("The player is currently paused or stopped.")
}
}
function isStopped() {
if(document.javademo.CanStop()) {
alert("The player is currently playing or paused.")
}
else {
alert("The player is currently stopped.")
}
}
// -->
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white">
<embed id="javademo" autogotourl=false type="audio/x-pn-realaudio-plugin" src="fx.php" CONTROLS=ImageWindow width=320 height=240 border=0 autostart=true loop=true></embed>
<FORM>
<P><INPUT TYPE="button" VALUE="Play"
onClick="document.javademo.DoPlay()">
<INPUT TYPE="button" VALUE="Pause"
onClick="document.javademo.DoPause()">
<INPUT TYPE="button" VALUE="Stop"
onClick="document.javademo.DoStop()"></P>
<P><INPUT TYPE="button" VALUE="Playing?"
onClick="isPlaying()">
<INPUT TYPE="button" VALUE="Paused?"
onClick="isPaused()">
<INPUT TYPE="button" VALUE="Stopped?"
onClick="isStopped()"></P>
</FORM>
</BODY>
</HTML>
<?php
header("Content-type: application/vnd.rn-realmedia-vbr");
readfile("video/yc.rmvb");
?>