kdayun-compnent-develop/kdayun-compnent-pack/dist/libs/ckplayer/ckplayer.min.js.bak

16 lines
169 KiB
JavaScript
Raw Normal View History

2022-02-19 20:37:32 +08:00
/*
软件名称ckplayer
软件版本X2
软件作者niandeng
软件网站http://www.ckplayer.com
--------------------------------------------------------------------------------------------------------------------
开发说明
使用的主要程序语言javascript(js)及actionscript3.0(as3.0)(as3.0主要用于flashplayer部分的开发不在该页面呈现)
功能播放视频
特点兼容HTML5-VIDEO(优先)以及FlashPlayer
--------------------------------------------------------------------------------------------------------------------
使用开源代码部分
1flashls-http://flashls.org/
=====================================================================================================================
*/
!(function(){var ckplayerPath='';!function(){var scriptList=document.scripts,thisPath=scriptList[scriptList.length-1].src;for(var i=0;i<scriptList.length;i++){var scriptName=scriptList[i].getAttribute('name')||scriptList[i].getAttribute('data-name');if(scriptName&&scriptName=='ckplayer'){thisPath=scriptList[i].src}}ckplayerPath=thisPath.substring(0,thisPath.lastIndexOf('/')+1)}();var ckplayer=function(obj){this.varsDefault={playerID:'',container:'',variable:'ckplayer',volume:0.8,poster:'',autoplay:false,loop:false,live:false,duration:0,forceduration:0,seek:0,drag:'',front:'',next:'',loaded:'',flashplayer:false,html5m3u8:false,track:null,cktrack:null,cktrackdelay:0,preview:null,prompt:null,video:null,config:'',type:'',crossorigin:'',crossdomain:'',unescape:false,mobileCkControls:false,mobileAutoFull:true,playbackrate:1,h5container:'',debug:false,overspread:true,language:'',style:'',adfront:'',adfronttime:'',adfrontlink:'',adpause:'',adpausetime:'',adpauselink:'',adinsert:'',adinserttime:'',adinsertlink:'',inserttime:'',adend:'',adendtime:'',adendlink:'',advertisements:''};this.vars={};this.ckConfig={};this.jsonConfig={};this.ckLanguage={};this.jsonLanguage={};this.ckStyle={};this.jsonStyle={};this.contextMenu=[['ckplayer','link','http://www.ckplayer.com','_blank'],['version:X2','default','line']];this.errorList=[['000','Object does not exist'],['001','Variables type is not a object'],['002','Video object does not exist'],['003','Video object format error'],['004','Video object format error'],['005','Video object format error'],['006','[error] does not exist'],['007','Ajax error'],['008','Ajax error'],['009','Ajax object format error'],['010','Ajax.status:[error]'],['011','[error] File loading failed or error'],['012','[error]']];this.playbackRateArr=[[0.5,'0.5X'],[1,'1X'],[1.25,'1.25X'],[1.5,'1.5X'],[2,'2X'],[4,'4X']];this.playbackRateTemp=1;this.playbackRateDefault=1;this.subtitlesTemp=-1;this.logo='';this.loaded=false;this.timerError=null;this.error=false;this.errorUrl=[];this.timerFull=null;this.full=false;this.timerTime=null;this.timerBuffer=null;this.isTimeButtonMove=true;this.isTimeButtonDown=false;this.timeButtonOver=null;this.buttonHide=false;this.isClick=false;this.timerClick=null;this.timerCBar=null;this.needSeek=0;this.volume=0;this.volumeTemp=0;this.time=0;this.isFirst=true;this.html5Video=true;this.pdCoor={x:0,y:0};this.playerType='';this.loadTime=0;this.body=document.body||document.documentElement;this.V=null;this.listenerJsArr=[];this.buttonLen=0;this.buttonArr=[];this.elementArr=[];this.elementTempArr=[];this.track=[];this.trackIndex=0;this.nowTrackShow={sn:''};this.trackElement=[];this.timerVCanvas=null;this.animateArray=[];this.animateElementArray=[];this.animatePauseArray=[];this.previewStart=0;this.previewDiv=null;this.previewTop=null;this.previewWidth=120;this.previewTween=null;this.isM3u8=false;this.promptArr=[];this.promptElement=null;this.conBarShow=true;this.errorAdd=false;this.errorSend=false;this.controlBarIsShow=true;this.videoScale=1;this.fontFamily='"Microsoft YaHei"; YaHei; "\5FAE\8F6F\96C5\9ED1"; SimHei; "\9ED1\4F53";Arial';this.timeSliderLeftTemp=0;this.durationSendJS=false;this.adAnalysisEnd=false;this.advertisements={};this.isFirstTimePlay=true;this.adType='';this.adI=0;this.videoTemp={src:'',source:'',currentSrc:'',loop:false};this.adTimeAllTotal=0;this.adTimeTotal=0;this.adCountDownObj=null;this.adPlayStart=false;this.adPlayerPlay=false;this.adIsPause=false;this.adVideoMute=false;this.adIsVideoTime=false;this.endAdPlay=false;this.adPauseShow=false;this.adReset=false;this.videoClickXy={x:0,y:0};this.adVideoPlay=false;this.loadTimeTemp=0;this.hlsAutoPlay=true;this.loadingShow=false;this.videoString='';this.customeElement=[];this.cdWH={w:0,h:0};this.CB={};if(obj){this.embed(obj)}};ckplayer.prototype={embed:function(c){if(window.location.href.substr(0,7)=='file://'){alert('Please use the HTTP protocol to open the page');return}if(this.isUndefined(c)){this.eject(this.errorList[0]);return}if(this.varType(c)!='object'){this.eject(this.errorList[1])}this.vars=this.standardization(this.varsDef