帝国cms整合ckplayer的教程,网上已经很多了,于是免费软件之家为大家整理了一下自己使用的帝国cms整合ckplayer的两种代码!
帝国cms整合ckplayer教程代码一:
将以下代码放入模板文件中:
divclass=play
divid=playadclass=yytf_1
divid=daojs请稍等,离广告结束还有spanid=djsstyle=color:#FFDD005/span秒/div
divclass=baiduyytf
scriptsrc=/d/js/acmsd/thea6.js/script
/div
/div
divid=a1/div
/div
styletype=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
scripttype=text/javascriptsrc=/ckplayer/ckplayer/ckplayer.js/script
scripttype=text/javascriptsrc=/ckplayer/js/offlights.js/script
scripttype=text/javascript
varflashvars={
f:'!--flvurl--]',
c:0,
p:2,
e:0,
loaded:'loadedHandler'
};
functionloadedHandler(){
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');
}
}
functionplayHandler(){
CKobject._K_('playad').style.display='none';
CKobject._K_('playad').className='yytf_1';
}
functionpauseHandler(){
CKobject._K_('playad').style.display='block';
CKobject._K_('playad').className='yytf_2';
CKobject._K_('daojs').style.display='none';
}
functionplayerstop(){
CKobject._K_('playad').style.display='block';
CKobject._K_('playad').className='yytf_1';
CKobject._K_('daojs').style.display='block';
CKobject._K_('djs').innerHTML=5;
setTimeend();}
varfrontTime=false;//前置广告倒计时是否在运行中
varfrontHtime=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();
functionsettime(){//前置广告倒计时
varnowT=parseInt(CKobject._K_('djs').innerHTML);
if(nowT0){
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();
}
}
functionsetTimeend(){//后置广告倒计时
varnowT=parseInt(CKobject._K_('djs').innerHTML);
if(nowT0){
CKobject._K_('djs').innerHTML=nowT-1;
setTimeout('setTimeend()',1000)
}
else{
CKobject._K_('playad').style.display='none';
}
}
varbox=newLightBox();
functioncloselights(){//关灯
box.Show();
}
functionopenlights(){//开灯
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格式的!