你的位置: 奇芳阁 帝国教程 阅读文章     

帝国cms整合ckplayer教程代码(flv格式调用)

[ 帝国教程 // 2014-06-16 ]

帝国cms整合ckplayer的教程,网上已经很多了,于是奇芳阁为大家整理了一下自己使用的帝国cms整合ckplayer的两种代码!

帝国cms整合ckplayer教程代码一:

将以下代码放入模板文件中:

<div class="play">
<div id="playad" class="yytf_1">
<div id="daojs">请稍等,离广告结束还有<span id="djs" style="color:#FFDD00">5</span>秒</div>
<div class="baiduyytf">
<script src="/d/js/acmsd/thea6.js"></script>
</div>
</div>
<div id="a1"></div>
</div>
<style type="text/css">
#a1{height:400px;width:600px;float:left;position:relative;z-index:100;}.play{float:left;height:400px;width:610px;}.yytf_1{position:absolute;z-index:150;height:400px;width:600px;background-color:#000;}.yytf_2{position:absolute;z-index:150;height:280px;width:336px;margin-top:60px;margin-left:132px;}#daojs{text-align:right;background-color:#000;padding-right:20px;color:#FFF;padding-top:20px;padding-bottom:20px;}.baiduyytf{height:280px;width:336px;margin-right:auto;margin-left:auto;background-color:#FFFFFF;}</style>
<script type="text/javascript" src="/ckplayer/ckplayer/ckplayer.js"></script>
<script type="text/javascript" src="/ckplayer/js/offlights.js"></script>
<script type="text/javascript">
var flashvars={
f:'[!--flvurl--]',
c:0,
p:2,
e:0,
loaded:'loadedHandler'
};
function loadedHandler(){
if(CKobject.getObjectById('ckplayer_a1').getType()){//说明使用html5播放器
CKobject.getObjectById('ckplayer_a1').addListener('play',playHandler);
CKobject.getObjectById('ckplayer_a1').addListener('pause',pauseHandler);
}
else{
CKobject.getObjectById('ckplayer_a1').addListener('play','playHandler');
CKobject.getObjectById('ckplayer_a1').addListener('pause','pauseHandler');
}
}
function playHandler(){
CKobject._K_('playad').style.display='none';
CKobject._K_('playad').className='yytf_1';
}
function pauseHandler(){
CKobject._K_('playad').style.display='block';
CKobject._K_('playad').className='yytf_2';
CKobject._K_('daojs').style.display='none';
}
function playerstop(){
CKobject._K_('playad').style.display='block';
CKobject._K_('playad').className='yytf_1';
CKobject._K_('daojs').style.display='block';
CKobject._K_('djs').innerHTML=5;
setTimeend();}
var frontTime=false;//前置广告倒计时是否在运行中
var frontHtime=false;//后置广告是否在进行中
CKobject.embed('/ckplayer/ckplayer/ckplayer.swf','a1','ckplayer_a1','600','400',false,flashvars,['http://movie.ks.js.cn/flv/other/1_0.mp4->video/mp4']);
CKobject._K_('djs').innerHTML=5;
settime();
function settime(){//前置广告倒计时
var nowT=parseInt(CKobject._K_('djs').innerHTML);
if(nowT>0){
frontTime=true;
CKobject._K_('djs').innerHTML=nowT-1;
setTimeout('settime()',1000)
}
else{
frontTime=false;
CKobject._K_('playad').style.display='none';
CKobject._K_('daojs').style.display='none';
CKobject.getObjectById('ckplayer_a1').videoPlay();
}
}
function setTimeend(){//后置广告倒计时
var nowT=parseInt(CKobject._K_('djs').innerHTML);
if(nowT>0){
CKobject._K_('djs').innerHTML=nowT-1;
setTimeout('setTimeend()',1000)
}
else{
CKobject._K_('playad').style.display='none';
}
}
var box = new LightBox();
function closelights(){//关灯
box.Show();
}
function openlights(){//开灯
box.Close();
}</script>

将以上中的红色的f值[!--flvurl--]改为你自己的视频调用字段!

帝国cms整合ckplayer教程代码二:

将以下代码放置于需要的地方:

<HTML>
<HEAD>
<TITLE>奇芳阁软件世界 --- 媒体播放器</TITLE>
<META HTTP-EQUIV="Expires" CONTENT="0">
<link rel="stylesheet" href="js/player.css">
<script language="javascript">
window.resizeTo(510,420);
window.moveTo(100,100);
window.focus()
</script>
<SCRIPT language=javascript>
function click() {
if (event.button==2) {
alert('对不起,请勿点击右键')
}
}
document.onmousedown=click
</SCRIPT>
<div id="a1"></div>
<script type="text/javascript" src="/e/DownSys/play/ckplayer/ckplayer.js" charset="utf-8"></script>
<script type="text/javascript">
var flashvars={
f:'http://www.1ting.com/mv/video/vhd/877550.flv',
c:0
};
var params={bgcolor:'#FFF',allowFullScreen:true,allowScriptAccess:'always',wmode:'transparent'};
var video=['http://www.1ting.com/mv/video/vhd/877550.flv->video/mp4'];
CKobject.embed('/e/DownSys/play/ckplayer/ckplayer.swf','a1','ckplayer_a1','480','360',false,flashvars,video,params);
</script>
</html>

将上面的http://www.1ting.com/mv/video/vhd/877550.flv替换为你自己的模型存储视频的字段!

注意:上面两种方法只能播放flv格式的视频,不可以播放swf格式的!

打赏

取消

请考虑对本站进行小额捐赠打赏:!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

各位请注意,目前发现 0 位寻荒者 在附近海域漂移!

报歉!评论已关闭.