以前大都用的快播,现在快播没了,光线cms需要调用吉吉影音,这个教程来自于官方网站。
该方法基于光线CMS1.5基础版,经过二次开发的版本请联系作者修改。
注意在替换相关文件时请先备份。
1、找到/core/Lib/Action/CmsAction.class.php文件,大概在139行加入以下代码:
}else if(stripos($currentUrl, 'jjhd://')!==false){//吉吉影音
$player .='<div id="GxInstall"></div><div id="GxPlayer" class="Loading"></div>';
$player .='<script language="javascript" type="text/javascript">'."\n";
$player .='var $playlist="'.str_replace(array("\r\n", "\n", "\r"),'+++',$array['playurl']).'"'."\n";
$player .='</script>'."\n";
$player .='<script language="javascript" src="'.C('web_path').'views/js/jjvod.js" charset="utf-8"></script>';
2、将jjvod.js放入/views/js/中。
3、后台添加吉吉影音影片资源,如:
jjhd://10014|342bcf5156458e8828f9d56b7882c226a65adf2a|KARA-STEP.avi.mp4
点击下载整合包
吉吉影音在马克斯程序(MaxCMS)调用方法
郑重提醒:您在修改网站相关文件时,请先备份好相关文件。
1、配置
找到文件/inc/playerKinds.xml,将以下一行代码加入文件中并保存
<playeropen="1"sort="100"flag="吉吉影音"des="jjvod-P2P"><intro><![CDATA<[ahref="http://www.jjvod.com"target="_blank">需要下载吉吉影音JJVOD播放器</a>]]></intro></player>
2、修改模板\template\default\html\play.html
在head部分<script src="/{maxcms:sitepath}js/play.js"></script>的下面加上一行:
<scriptsrc="/{maxcms:sitepath}js/jjplay.js"></script>
注意这里jjplay.js是吉吉影音专有的js文件,必须在play.js的后面加载,如果你站改过play.js文件名称,请找对文件位置。
3、jjplay.js代码分析
varjjvod_w=650;//播放器宽度varjjvod_h=500;//播放器高度varjjvod_ad='http://player.jjvod.com/ad.html';//缓冲和暂停广告varjjvod_soft='/js/jjvod_install.html';//下载地址,渠道可直接在下载页面设置varjjvod_notice='/js/notice.html';//非IE内核提示页面if(typeof(VideoListJson)=='undefined'){VideoListJson=[];VideoInfoList=VideoInfoList.split('$$$');for(vari=0;i<VideoInfoList.length;i++){varvod=VideoInfoList[i].split('$$');VideoListJson[i]=[vod[0],vod[1].split('#')];}}viewplay2=viewplay;viewplay=function(param1,param2){getplay=function(param1,param2){varx=VideoListJson,mov,Arr;if(x.length>0){mov=newString(VideoListJson[param1][1][param2]);Arr=mov.split('$');return[VideoListJson[param1][0],Arr[0],Arr[1]];}else{return['','',''];}};vara=VideoListJson[param1][1][param2];playdata=getplay(param1,param2);//0->集1->地址varplayername=playdata[0];//播放器名称varvodname=playdata[1];//影片名称varurl=playdata[2];//播放地址if(playername=="吉吉影音"||playername=="jjvod"){addjjvod(url);}else{returnviewplay2(param1,param2);}}//播放状态控制functionjjvodstatus(offest){if(document.getElementById('jjvodPlayer').PlayState==3){document.getElementById('jjad').style.display='none';}elseif(document.getElementById('jjvodPlayer').PlayState==2||document.getElementById('jjvodPlayer').PlayState==4){document.getElementById('jjad').style.display='block';}}//JJVOD代码functionaddjjvod(url){if(!!window.ActiveXObject||"ActiveXObject"inwindow){adh=jjvod_h-63;document.write("<divstyle='position:relative'>");document.write('<divid="jjad"style="position:absolute;z-index:1001"><iframemarginWidth="0"marginHeight="0"src="'+jjvod_ad+'"frameBorder="0"width="'+jjvod_w+'"scrolling="no"height="'+adh+'"id="wdqad"name="wdqad"></iframe></div>');document.write("<objectclassid='clsid:C56A576C-CC4F-4414-8CB1-9AAC2F535837'width='"+jjvod_w+"'height='"+jjvod_h+"'id='jjvodPlayer'name='jjvodPlayer'onerror=\"document.getElementById('jjvodPlayer').style.display='none';document.getElementById('wdqad').src='"+jjvod_soft+"';\"><PARAMNAME='URL'VALUE='"+url+"'><paramname='Autoplay'value='1'></object>");document.write("</div>");setInterval('jjvodstatus()','1000');}else{document.write('<iframesrc="'+jjvod_notice+'"frameborder="0"width="640"height="468"scrolling="no"></iframe>');}}
说明:MAXCMS调用播放器部分用到了viewplay()函数,我们重写了该函数,如果是获取到播放器名称是吉吉影音的则调用该播放器。
3、在后台资源中添加jjvod资源,如:
BD$jjhd://10014|342bcf5156458e8828f9d56b7882c226a65adf2a|KARA-STEP.
相关阅读
- 暂无推荐
《》由网友“”推荐。
转载请注明: