日期:2014-05-16  浏览次数:20361 次

网页里嵌套window media play,如何做才能点击某个链接实现全屏播放?请指教
弄来弄去都不行,而REALPLAY的就可以,有做过这方面的朋友吗?以下是我的代码

<script   language= "JavaScript ">
function   fullplay(){
if(document.all.player.value== "rp "){
document.ayangplayer.SetFullScreen();
}else{
//document.mediaPlayer.SetFullScreen();这个也试过,也无法全屏
mediaPlayer.fullScreen=1;
}
}
</script>


<input   type= "hidden "   name= "player "   value= "mdplay ">
<object   classid= "clsid:05589FA1-C356-11CE-BF01-00AA0055595A "   name= "mediaPlayer "   id= "mediaPlayer "   width= "636 "   height= "475 ">
<param   name= "Appearance "   value= "0 ">
<param   name= "AutoStart "   value= "-1 ">
<param   name= "AllowChangeDisplayMode "   value= "-1 ">
<param   name= "AllowHideDisplay "   value= "0 ">
<param   name= "AllowHideControls "   value= "-1 ">
<param   name= "AutoRewind "   value= "1 ">
<param   name= "Balance "   value= "0 ">
<param   name= "CurrentPosition "   value= "0 ">
<param   name= "DisplayBackColor "   value= "0 ">
<param   name= "DisplayForeColor "   value= "16777215 ">
<param   name= "DisplayMode "   value= "0 ">
<param   name= "Enabled "   value= "-1 ">
<param   name= "EnableContextMenu "   value= "-1 ">
<param   name= "EnablePositionControls "   value= "-1 ">
<param   name= "EnableSelectionControls "   value= "0 ">
<param   name= "EnableTracker "   value= "-1 ">
<param   name= "windowlessVideo "   value= "0 ">
<param   name= "Filename "   value= "\\192.168.0.191\e\movie\test.wmv ">
<param   name= "fullScreen "   value= "0 ">
<param   name= "MovieWindowSize "   value= "1 ">
<param   name= "PlayCount "   value= "1 ">
<param   name= "Rate "   value= "1 ">
<param   name= "SelectionStart "   value= "-1 ">
<param   name= "SelectionEnd "   value= "-1 ">
<param   name= "ShowTracker "   value= "-1 ">
<param   name= "Volume "   value= "0 ">
</object>

<a   href= "#### "   onClick= "javascript:fullplay(); "> 全屏播放 </a>


点击“全屏播放”后没有效果,请各位指教。


------解决方案--------------------
这样:
<script language= "JavaScript ">
function fullplay(){
var player=document.getElementById( "mediaPlayer ");
player.FullScreenMode = true
}
</script>