小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

在firefox上用javascript控制windows media player 和 real player的播放

 Ralf_Jones 2007-12-13

控制real player的播放

播放頁(yè)面: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>

fx.php代碼:

<?php

header("Content-type: application/vnd.rn-realmedia-vbr");
readfile("video/yc.rmvb");

?>

 
需要注意的地方:
1. 從firefox的官方文檔里看標(biāo)簽embed的type應(yīng)該是“application/vnd.rn-realplayer-javascript”的,但firefox竟然識(shí)別不了,改為"audio/x-pn-realaudio-plugin"就行了,視頻當(dāng)作音頻用,但也能顯示視頻,不知道為什么會(huì)這樣。
2.要正確輸出視頻文件的mime-type, rmvb的mime不是“video/vnd.rn-realvideo”,而是“application/vnd.rn-realmedia-vbr”
 
參考資料:
http://plugindoc./winmime.html   firefox支持的所有plugin 的mime type
http://service./help/library/guides/extend/embed.htm  real player的所有支持javascript調(diào)用的屬性以及方法說(shuō)明(官方英文)
http://blog.csdn.net/hzf100/archive/2007/08/15/1745198.aspx  real player的所有支持javascript調(diào)用的屬性以及方法說(shuō)明(中文)
 
控制windows media player 播放
mozilla官方實(shí)例:http://plugindoc./testpages/wmp11.html
注意的地方:
type="application/x-ms-wmp" ,這個(gè)表示用的是wmp11,如果firefox發(fā)現(xiàn)客戶端是wmp9以下的話會(huì)提示安裝一個(gè)微軟的插件,安裝完后就可以用javascript控制了。
而“application/x-mplayer2”表示調(diào)用的是wmp9,用這個(gè)type是不能用javascript來(lái)控制的。
 
參考資料:
http://msdn2.microsoft.com/en-us/library/bb614515.aspx  微軟wmp11的msdn(Using the Windows Media Player Control with Firefox)
http://www./experiments/wmp_play.html  firefox下用flash控制wmplayer的例子

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多