国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

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

控制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>

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竟然識別不了,改為"audio/x-pn-realaudio-plugin"就行了,視頻當(dāng)作音頻用,但也能顯示視頻,不知道為什么會這樣。
2.要正確輸出視頻文件的mime-type, rmvb的mime不是“video/vnd.rn-realvideo”,而是“application/vnd.rn-realmedia-vbr”
 
參考資料:
http://plugindoc.mozdev.org/winmime.html   firefox支持的所有plugin 的mime type
http://service.real.com/help/library/guides/extend/embed.htm  real player的所有支持javascript調(diào)用的屬性以及方法說明(官方英文)
http://blog.csdn.net/hzf100/archive/2007/08/15/1745198.aspx  real player的所有支持javascript調(diào)用的屬性以及方法說明(中文)
 
控制windows media player 播放
mozilla官方實例:http://plugindoc.mozdev.org/testpages/wmp11.html
注意的地方:
type="application/x-ms-wmp" ,這個表示用的是wmp11,如果firefox發(fā)現(xiàn)客戶端是wmp9以下的話會提示安裝一個微軟的插件,安裝完后就可以用javascript控制了。
而“application/x-mplayer2”表示調(diào)用的是wmp9,用這個type是不能用javascript來控制的。
 
參考資料:
http://msdn2.microsoft.com/en-us/library/bb614515.aspx  微軟wmp11的msdn(Using the Windows Media Player Control with Firefox)
http://www.therossman.org/experiments/wmp_play.html  firefox下用flash控制wmplayer的例子
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
前端發(fā)展簡史
Win7下Flash 11.3導(dǎo)致Firefox崩潰問題解決
[翻]ECMAScript 6 特性速覽
瀏覽器內(nèi)核
實用!破解XP最新驗證程序三種方案
國產(chǎn)CPU井噴 四大架構(gòu)齊現(xiàn) 遭遇市場生態(tài)壁壘
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服