CkPlayer播放器使用

直接貼官網 http://www.ckplayer.com/javascript

<style type="text/css">
body{ text-align:center} 
#main{margin:0 auto;width:80%;height:80%;} 
</style>

</head>
<body class="nav-md" >
			<!-- 首頁 -->
			<div class="right_col" role="main" id="main">
				<!-- 搜索 -->
				<div class="clearfix"></div>
				<div id="main">
					<div id="a1"></div>
					</div>
<script type="text/javascript" src="ckplayer/ckplayer.js" charset="utf-8"></script>
<script type="text/javascript">
window.onload=function(){
     var flashvars={
        f:'<%=session.getAttribute("scrs")%>',
        c:0,
        i:'jiump4/封神傳奇_高清.PNG',
        wh:'16:9',
        h:4,
    };
    var params={bgcolor:'#FFF',allowFullScreen:true,allowScriptAccess:'always',wmode:'transparent'};
    CKobject.embedSWF('ckplayer/ckplayer.swf','a1','ckplayer_a1','100%','100%',flashvars,params);  
    /*   var flashvars={
        f:'jiump4/封神傳奇_高清.mp4',
        c:0,
        i:'jiump4/封神傳奇_高清.PNG',
        wh:'16:9',
        h:4
    };
    var params={bgcolor:'#FFF',allowFullScreen:true,allowScriptAccess:'always',wmode:'transparent'};
    var video=['jiump4/封神傳奇_高清.mp4->video/mp4'];
    CKobject.embedSWF('ckplayer/ckplayer.swf','a1','ckplayer_a1','100%','100%',true,flashvars,video,params);
    */
   
   
   
   
   
  function callFlash(){
   //alert("中鍵");
   document.getElementById("a1").onClick();
  }
  if(window.addEventListener){
   window.addEventListener("mousedown",function(e){
    if(e.button==1)callFlash();
    //屏蔽右鍵
    if(e.button==2){    
     if (e.stopPropagation) e.stopPropagation();
     if (e.preventDefault) e.preventDefault();
     if (e.preventCapture) e.preventCapture();
        if (e.preventBubble) e.preventBubble();
    }
   },true);
  }else{
   document.getElementById("flashcontent").onmousedown=function(){
    if(event.button==4)callFlash();
    //屏蔽右鍵
    if(event.button==2){
     document.oncontextmenu=function(){return false;};
     this.setCapture();
     this.onmouseup=function(){
      this.releaseCapture();
     }
    }
   }
  }
  }
</script>
相關文章
相關標籤/搜索