From 439b0d4544ec573be9a2e48c815f0568d93116b3 Mon Sep 17 00:00:00 2001 From: niandeng <14926108@qq.com> Date: Wed, 9 Mar 2022 10:05:16 +0800 Subject: [PATCH] no commit message --- ckplayer/js/ckplayer.js | 2003 +++++++++++++++++------------------ ckplayer/js/ckplayer.min.js | 2 +- 2 files changed, 1002 insertions(+), 1003 deletions(-) diff --git a/ckplayer/js/ckplayer.js b/ckplayer/js/ckplayer.js index 8b4b1dd..618704d 100644 --- a/ckplayer/js/ckplayer.js +++ b/ckplayer/js/ckplayer.js @@ -9,74 +9,127 @@ typeof define === 'function' && define.amd ? define(factory) : (global = global || self, global.ckplayer = factory()); }(this, function () { 'use strict'; + /* + * language + * 功能:静态变量,包含播放器用到的默认语言包 + * 引入其它语言js后该变量将被替换成新引入的语言包 + */ + var language={ + play:'%E6%92%AD%E6%94%BE', + pause:'%E6%9A%82%E5%81%9C', + refresh:'%E9%87%8D%E6%92%AD', + full:'%E5%85%A8%E5%B1%8F', + exitFull:'%E9%80%80%E5%87%BA%E5%85%A8%E5%B1%8F', + webFull:'%E9%A1%B5%E9%9D%A2%E5%85%A8%E5%B1%8F', + exitWebFull:'%E9%80%80%E5%87%BA%E9%A1%B5%E9%9D%A2%E5%85%A8%E5%B1%8F', + theatre:'%E5%89%A7%E5%9C%BA%E6%A8%A1%E5%BC%8F', + exitTheatre:'%E9%80%80%E5%87%BA%E5%89%A7%E5%9C%BA%E6%A8%A1%E5%BC%8F', + volume:'%E9%9F%B3%E9%87%8F%EF%BC%9A', + muted:'%E9%9D%99%E9%9F%B3', + exitmuted:'%E6%81%A2%E5%A4%8D%E9%9F%B3%E9%87%8F', + seek:'seek%EF%BC%9A', + waiting:'%E7%BC%93%E5%86%B2', + live:'%E7%9B%B4%E6%92%AD%E4%B8%AD', + backLive:'%E8%BF%94%E5%9B%9E%E7%9B%B4%E6%92%AD', + lookBack:'%E5%9B%9E%E7%9C%8B%EF%BC%9A', + next:'%E4%B8%8B%E4%B8%80%E9%9B%86', + screenshot:'%E8%A7%86%E9%A2%91%E6%88%AA%E5%9B%BE', + smallwindows:'%E5%B0%8F%E7%AA%97%E5%8F%A3%E6%92%AD%E6%94%BE%E5%8A%9F%E8%83%BD', + playbackrate:'%E5%80%8D%E9%80%9F', + playbackrateSuffix:'%E5%80%8D', + track:'%E5%AD%97%E5%B9%95', + noTrack:'%E6%97%A0%E5%AD%97%E5%B9%95', + definition:'%E6%B8%85%E6%99%B0%E5%BA%A6', + switchTo:'%E5%88%87%E6%8D%A2%E6%88%90%EF%BC%9A', + closeTime:'%7Bseconds%7D%E7%A7%92%E5%90%8E%E5%8F%AF%E5%85%B3%E9%97%AD%E5%B9%BF%E5%91%8A', + closeAd:'%E5%85%B3%E9%97%AD%E5%B9%BF%E5%91%8A', + second:'%E7%A7%92', + details:'%E6%9F%A5%E7%9C%8B%E8%AF%A6%E6%83%85', + copy:'%E5%A4%8D%E5%88%B6', + copySucceeded:'%E5%A4%8D%E5%88%B6%E6%88%90%E5%8A%9F%EF%BC%8C%E5%8F%AF%E8%B4%B4%E7%B2%98%EF%BC%81', + smallwindowsOpen:'%E5%B0%8F%E7%AA%97%E5%8F%A3%E5%8A%9F%E8%83%BD%E5%B7%B2%E5%BC%80%E5%90%AF', + smallwindowsClose:'%E5%B0%8F%E7%AA%97%E5%8F%A3%E5%8A%9F%E8%83%BD%E5%B7%B2%E5%85%B3%E9%97%AD', + screenshotStart:'%E6%88%AA%E5%9B%BE%E4%B8%AD%EF%BC%8C%E8%AF%B7%E7%A8%8D%E5%80%99...', + screenshotClose:'%E6%88%AA%E5%9B%BE%E5%8A%9F%E8%83%BD%E5%B7%B2%E5%85%B3%E9%97%AD', + loopOpen:'%E5%BE%AA%E7%8E%AF%E6%92%AD%E6%94%BE', + loopClose:'%E5%B7%B2%E5%85%B3%E9%97%AD%E5%BE%AA%E7%8E%AF%E6%92%AD%E6%94%BE', + close:'%E5%85%B3%E9%97%AD', + down:'%E4%B8%8B%E8%BD%BD', + p50:'50%25', + p75:'75%25', + p100:'100%25', + timeScheduleAdjust:{ + prohibit:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E6%8B%96%E5%8A%A8', + prohibitBackOff:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E9%87%8D%E5%A4%8D%E8%A7%82%E7%9C%8B', + prohibitForward:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E5%BF%AB%E8%BF%9B', + prohibitLookBack:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E6%92%AD%E6%94%BE%E9%83%A8%E5%88%86%E5%86%85%E5%AE%B9', + prohibitForwardNotViewed:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E6%92%AD%E6%94%BE%E6%9C%AA%E8%A7%82%E7%9C%8B%E7%9A%84%E9%83%A8%E5%88%86' + }, + error:{ + noMessage:'%E6%9C%AA%E7%9F%A5%E9%94%99%E8%AF%AF', + supportVideoError:'%E8%AF%A5%E6%B5%8F%E8%A7%88%E5%99%A8%E7%89%88%E6%9C%AC%E5%A4%AA%E4%BD%8E%EF%BC%8C%E5%BB%BA%E8%AE%AE%E6%9B%B4%E6%8D%A2%E6%88%90%E5%85%B6%E5%AE%83%E6%B5%8F%E8%A7%88%E5%99%A8', + videoTypeError:'%E8%AF%A5%E6%B5%8F%E8%A7%88%E5%99%A8%E4%B8%8D%E6%94%AF%E6%8C%81%E6%92%AD%E6%94%BE%E8%AF%A5%E8%A7%86%E9%A2%91%EF%BC%8C%E5%BB%BA%E8%AE%AE%E6%9B%B4%E6%8D%A2%E6%88%90%E5%85%B6%E5%AE%83%E6%B5%8F%E8%A7%88%E5%99%A8', + loadingFailed:'%E5%8A%A0%E8%BD%BD%E5%A4%B1%E8%B4%A5', + emptied:'%E8%A7%86%E9%A2%91%E6%96%87%E4%BB%B6%E5%8A%A0%E8%BD%BD%E8%BF%87%E7%A8%8B%E4%B8%AD%E5%87%BA%E7%8E%B0%E9%94%99%E8%AF%AF', + screenshot:'%E8%A7%86%E9%A2%91%E6%88%AA%E5%9B%BE%E5%A4%B1%E8%B4%A5', + ajax:'Ajax%E6%95%B0%E6%8D%AE%E8%AF%B7%E6%B1%82%E9%94%99%E8%AF%AF', + noVideoContainer:'%E6%9C%AA%E6%89%BE%E5%88%B0%E6%94%BE%E7%BD%AE%E8%A7%86%E9%A2%91%E7%9A%84%E5%AE%B9%E5%99%A8' + } + }; + /* + * videoObjectDefault + * 功能:静态变量,默认播放配置,当外部传递过来的配置有未包含在varsDefault里的,则使用varsDefault里的配置 + */ + var videoObjectDefault= { + container: '',//视频容器的ID + volume: 0.8,//默认音量,范围0-1 + poster: '',//封面图片地址 + autoplay: false,//是否自动播放 + loop: false,//是否需要循环播放 + live: false,//是否是直播 + rotate:0,//视频旋转角度 + zoom:0,//默认缩放比例 + ad:null,//广告 + backLive:false,//显示返回直播按钮 + seek: 0,//默认需要跳转的秒数 + next: null,//下一集按钮动作 + loaded: '',//加载播放器后调用的函数 + plug: '',//使用插件 + duration:0,//视频总时间 + preview: null,//预览图片对象 + prompt: null,//提示点功能 + crossOrigin:'',//跨域请求字符 + video: null,//视频地址 + type:'',//视频类型 + playbackrate: 1,//默认倍速 + ended:null,//结束显示的内容 + webFull:false,//页面全屏按钮事件 + theatre:null,//剧场模式 + controls:false,//是否显示自带控制栏 + rightBar:null,//是否开启右边控制栏 + smallWindows:null,//是否启用小窗口模式 + smallWindowsDrag:true,//当处于小窗口模式时是否可拖动播放器 + screenshot:false,//截图功能是否开启 + timeScheduleAdjust:1,//是否可调节播放进度,0不启用,1是启用,2是只能前进(向右拖动),3是只能后退,4是只能前进但能回到第一次拖动时的位置,5是看过的地方可以随意拖动 + logo:'',//logo + menu:null,//右键菜单 + information:{//关于 + 'Load:':'{loadTime} second', + 'Duration:':'{duration} second', + 'Size:':'{videoWidth}x{videoHeight}', + 'Volume:':'{volume}%', + 'Fps:':'{fps}fps', + 'Sudio decoded:':'{audioDecodedByteCount} Byte', + 'Video decoded:':'{videoDecodedByteCount} Byte' + }, + track:null,//字幕 + title:'',//视频标题 + language:'',//语言包文件 + barHideTime:1500,//控制栏隐藏时间 + playbackrateOpen:true,//是否开启控制栏倍速选项 + playbackrateList:[0.75,1,1.25,1.5,2,4]//倍速配置值 + }; function ckplayerEmbed(videoObj){ - /* - * language - * 功能:全局变量,包含播放器用到的默认语言包 - * 引入其它语言js后该变量将被替换成新引入的语言包 - */ - var language={ - play:'%E6%92%AD%E6%94%BE', - pause:'%E6%9A%82%E5%81%9C', - refresh:'%E9%87%8D%E6%92%AD', - full:'%E5%85%A8%E5%B1%8F', - exitFull:'%E9%80%80%E5%87%BA%E5%85%A8%E5%B1%8F', - webFull:'%E9%A1%B5%E9%9D%A2%E5%85%A8%E5%B1%8F', - exitWebFull:'%E9%80%80%E5%87%BA%E9%A1%B5%E9%9D%A2%E5%85%A8%E5%B1%8F', - theatre:'%E5%89%A7%E5%9C%BA%E6%A8%A1%E5%BC%8F', - exitTheatre:'%E9%80%80%E5%87%BA%E5%89%A7%E5%9C%BA%E6%A8%A1%E5%BC%8F', - volume:'%E9%9F%B3%E9%87%8F%EF%BC%9A', - muted:'%E9%9D%99%E9%9F%B3', - exitmuted:'%E6%81%A2%E5%A4%8D%E9%9F%B3%E9%87%8F', - seek:'seek%EF%BC%9A', - waiting:'%E7%BC%93%E5%86%B2', - live:'%E7%9B%B4%E6%92%AD%E4%B8%AD', - backLive:'%E8%BF%94%E5%9B%9E%E7%9B%B4%E6%92%AD', - lookBack:'%E5%9B%9E%E7%9C%8B%EF%BC%9A', - next:'%E4%B8%8B%E4%B8%80%E9%9B%86', - screenshot:'%E8%A7%86%E9%A2%91%E6%88%AA%E5%9B%BE', - smallwindows:'%E5%B0%8F%E7%AA%97%E5%8F%A3%E6%92%AD%E6%94%BE%E5%8A%9F%E8%83%BD', - playbackrate:'%E5%80%8D%E9%80%9F', - playbackrateSuffix:'%E5%80%8D', - track:'%E5%AD%97%E5%B9%95', - noTrack:'%E6%97%A0%E5%AD%97%E5%B9%95', - definition:'%E6%B8%85%E6%99%B0%E5%BA%A6', - switchTo:'%E5%88%87%E6%8D%A2%E6%88%90%EF%BC%9A', - closeTime:'%7Bseconds%7D%E7%A7%92%E5%90%8E%E5%8F%AF%E5%85%B3%E9%97%AD%E5%B9%BF%E5%91%8A', - closeAd:'%E5%85%B3%E9%97%AD%E5%B9%BF%E5%91%8A', - second:'%E7%A7%92', - details:'%E6%9F%A5%E7%9C%8B%E8%AF%A6%E6%83%85', - copy:'%E5%A4%8D%E5%88%B6', - copySucceeded:'%E5%A4%8D%E5%88%B6%E6%88%90%E5%8A%9F%EF%BC%8C%E5%8F%AF%E8%B4%B4%E7%B2%98%EF%BC%81', - smallwindowsOpen:'%E5%B0%8F%E7%AA%97%E5%8F%A3%E5%8A%9F%E8%83%BD%E5%B7%B2%E5%BC%80%E5%90%AF', - smallwindowsClose:'%E5%B0%8F%E7%AA%97%E5%8F%A3%E5%8A%9F%E8%83%BD%E5%B7%B2%E5%85%B3%E9%97%AD', - screenshotStart:'%E6%88%AA%E5%9B%BE%E4%B8%AD%EF%BC%8C%E8%AF%B7%E7%A8%8D%E5%80%99...', - screenshotClose:'%E6%88%AA%E5%9B%BE%E5%8A%9F%E8%83%BD%E5%B7%B2%E5%85%B3%E9%97%AD', - loopOpen:'%E5%BE%AA%E7%8E%AF%E6%92%AD%E6%94%BE', - loopClose:'%E5%B7%B2%E5%85%B3%E9%97%AD%E5%BE%AA%E7%8E%AF%E6%92%AD%E6%94%BE', - close:'%E5%85%B3%E9%97%AD', - down:'%E4%B8%8B%E8%BD%BD', - p50:'50%25', - p75:'75%25', - p100:'100%25', - timeScheduleAdjust:{ - prohibit:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E6%8B%96%E5%8A%A8', - prohibitBackOff:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E9%87%8D%E5%A4%8D%E8%A7%82%E7%9C%8B', - prohibitForward:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E5%BF%AB%E8%BF%9B', - prohibitLookBack:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E6%92%AD%E6%94%BE%E9%83%A8%E5%88%86%E5%86%85%E5%AE%B9', - prohibitForwardNotViewed:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E6%92%AD%E6%94%BE%E6%9C%AA%E8%A7%82%E7%9C%8B%E7%9A%84%E9%83%A8%E5%88%86' - }, - error:{ - noMessage:'%E6%9C%AA%E7%9F%A5%E9%94%99%E8%AF%AF', - supportVideoError:'%E8%AF%A5%E6%B5%8F%E8%A7%88%E5%99%A8%E7%89%88%E6%9C%AC%E5%A4%AA%E4%BD%8E%EF%BC%8C%E5%BB%BA%E8%AE%AE%E6%9B%B4%E6%8D%A2%E6%88%90%E5%85%B6%E5%AE%83%E6%B5%8F%E8%A7%88%E5%99%A8', - videoTypeError:'%E8%AF%A5%E6%B5%8F%E8%A7%88%E5%99%A8%E4%B8%8D%E6%94%AF%E6%8C%81%E6%92%AD%E6%94%BE%E8%AF%A5%E8%A7%86%E9%A2%91%EF%BC%8C%E5%BB%BA%E8%AE%AE%E6%9B%B4%E6%8D%A2%E6%88%90%E5%85%B6%E5%AE%83%E6%B5%8F%E8%A7%88%E5%99%A8', - loadingFailed:'%E5%8A%A0%E8%BD%BD%E5%A4%B1%E8%B4%A5', - emptied:'%E8%A7%86%E9%A2%91%E6%96%87%E4%BB%B6%E5%8A%A0%E8%BD%BD%E8%BF%87%E7%A8%8B%E4%B8%AD%E5%87%BA%E7%8E%B0%E9%94%99%E8%AF%AF', - screenshot:'%E8%A7%86%E9%A2%91%E6%88%AA%E5%9B%BE%E5%A4%B1%E8%B4%A5', - ajax:'Ajax%E6%95%B0%E6%8D%AE%E8%AF%B7%E6%B1%82%E9%94%99%E8%AF%AF', - noVideoContainer:'%E6%9C%AA%E6%89%BE%E5%88%B0%E6%94%BE%E7%BD%AE%E8%A7%86%E9%A2%91%E7%9A%84%E5%AE%B9%E5%99%A8' - } - }; /* * rightMenu * 功能:全局变量,右键内容 @@ -96,59 +149,6 @@ click:'aboutShow' } ]; - /* - * videoObjectDefault - * 功能:全局变量,默认播放配置,当外部传递过来的配置有未包含在varsDefault里的,则使用varsDefault里的配置 - */ - var videoObjectDefault= { - container: '',//视频容器的ID - volume: 0.8,//默认音量,范围0-1 - poster: '',//封面图片地址 - autoplay: false,//是否自动播放 - loop: false,//是否需要循环播放 - live: false,//是否是直播 - rotate:0,//视频旋转角度 - zoom:0,//默认缩放比例 - ad:null,//广告 - backLive:false,//显示返回直播按钮 - seek: 0,//默认需要跳转的秒数 - next: null,//下一集按钮动作 - loaded: '',//加载播放器后调用的函数 - plug: '',//使用插件 - duration:0,//视频总时间 - preview: null,//预览图片对象 - prompt: null,//提示点功能 - crossOrigin:'',//跨域请求字符 - video: null,//视频地址 - type:'',//视频类型 - playbackrate: 1,//默认倍速 - ended:null,//结束显示的内容 - webFull:false,//页面全屏按钮事件 - theatre:null,//剧场模式 - controls:false,//是否显示自带控制栏 - rightBar:null,//是否开启右边控制栏 - smallWindows:null,//是否启用小窗口模式 - smallWindowsDrag:true,//当处于小窗口模式时是否可拖动播放器 - screenshot:false,//截图功能是否开启 - timeScheduleAdjust:1,//是否可调节播放进度,0不启用,1是启用,2是只能前进(向右拖动),3是只能后退,4是只能前进但能回到第一次拖动时的位置,5是看过的地方可以随意拖动 - logo:'',//logo - menu:null,//右键菜单 - information:{//关于 - 'Load:':'{loadTime} second', - 'Duration:':'{duration} second', - 'Size:':'{videoWidth}x{videoHeight}', - 'Volume:':'{volume}%', - 'Fps:':'{fps}fps', - 'Sudio decoded:':'{audioDecodedByteCount} Byte', - 'Video decoded:':'{videoDecodedByteCount} Byte' - }, - track:null,//字幕 - title:'',//视频标题 - language:'',//语言包文件 - barHideTime:1500,//控制栏隐藏时间 - playbackrateOpen:true,//是否开启控制栏倍速选项 - playbackrateList:[0.75,1,1.25,1.5,2,4]//倍速配置值 - }; var vars={},varsTemp={};//保存传递过来的videoObject var video=null;//视频播放器对象 var duration=0;//总时间 @@ -189,7 +189,7 @@ * 功能:初始化,调用播放器则首先调用该函数 * @obj=初始化时的配置对象:videoObject */ - function into(obj){ + var into=function(obj){ /* * 如果未传递初始化配置对象,则为player变量增加一个add函数,功能相当于into */ @@ -266,13 +266,13 @@ showWindowsError(language['error']['noVideoContainer']); return null; } - } + }, /* * bodyReady * 功能:页面加载完成后构建播放器 * @obj=初始化时的配置对象 */ - function bodyReady(obj){ + bodyReady=function (obj){ documentReady(function(){ if(!isUndefined(obj['container'])){ CT=$(obj['container']); @@ -289,13 +289,13 @@ } }); return null; - } + }, /* * ajaxWebsite * 功能:页面加载完成后重新初始化 * @obj=初始化时的配置对象 */ - function ajaxWebsite(obj){ + ajaxWebsite=function (obj){ if(valType(obj['video'])=='string' && (obj['video'].substr(0,8)=='website:' || obj['video'].substr(0,4)=='url:')){ varsTemp = standardization(varsTemp, obj); var ajaxUrl=''; @@ -319,13 +319,13 @@ showWindowsError(language['error']['noVideoContainer']); return null; } - } + }, /* * loadLanguage * 功能:加载Language * @obj=初始化时的配置对象 */ - function loadLanguage(obj){ + loadLanguage=function (obj){ vars = standardization(varsTemp, obj); if(vars['language']){ var path=getPath('language')+vars['language']+'.js'; @@ -339,13 +339,13 @@ else{ return embed(obj); } - } + }, /* * embed * 功能:构建播放器 * @obj=初始化时的配置对象 */ - function embed(obj){ + embed=function (obj){ /* * 判断静音状态 */ @@ -490,12 +490,12 @@ } changeVideo(vars['video']);//播放视频 return player; - } + }, /* * changeVideo * 功能:初始化视频地址或修改视频地址 */ - function changeVideo(vstr){ + changeVideo=function (vstr){ var i=0; if(video.attr('src') || video.htm()){ player.pause(); @@ -587,12 +587,12 @@ if(isChangeDef){ checkDefinition(); } - } + }, /* * plugPlayer * 功能:使用插件进行播放 */ - function plugPlayer(url){ + plugPlayer=function (url){ switch(vars['plug']){ case 'hls.js': hlsPlayer(url); @@ -618,12 +618,12 @@ break; } - } + }, /* * hlsPlayer * 功能:使用hls.js插件进行播放 */ - function hlsPlayer(url){ + hlsPlayer=function (url){ var path=getPath('hls.js')+'hls.min.js'; loadJs(path,function(){ if (!isUndefined(Hls) && Hls.isSupported()) { @@ -658,12 +658,12 @@ video.attr('src',url); } }); - } + }, /* * flvPlayer * 功能:使用flv.js插件进行播放 */ - function flvPlayer(url){ + flvPlayer=function (url){ var path=getPath('flv.js')+'flv.min.js'; loadJs(path,function(){ if (typeof(flvjs)!='undefined' && !isUndefined(flvjs) && flvjs.isSupported()) { @@ -697,12 +697,12 @@ }); } }); - } + }, /* * mpegtsPlayer * 功能:使用mpegts.js插件进行播放 */ - function mpegtsPlayer(url){ + mpegtsPlayer=function (url){ var path=getPath('mpegts.js')+'mpegts.js'; loadJs(path,function(){ if (typeof(mpegts)!='undefined' && !isUndefined(mpegts) && mpegts.getFeatureList().mseLivePlayback) { @@ -737,12 +737,12 @@ }); } }); - } + }, /* * canPlay * 功能:判断是否能支持相关视频格式 */ - function canPlay(vStr,num){ + canPlay=function(vStr,num){ var vTypeArr=[ {vidType:'video/ogg',codType:'theora, vorbis'}, {vidType:'video/mp4',codType:'avc1.4D401E, mp4a.40.2'}, @@ -820,12 +820,12 @@ showError(); } return is; - } + }, /* * loadFace * 功能:加载界面 */ - function loadFace(){ + loadFace=function(){ //loading容器 C['loading']=createlDiv('ck-loading'); CM.append(C['loading']); @@ -1224,12 +1224,12 @@ C['topBar'].removeClass('ck-top-bar-hide'); } }); - } + }, /* * addAllListener * 功能:注册播放器的全部监听 */ - function addAllListener(){ + addAllListener=function(){ video.addListener('stalled',videoHandler.stalled);//在浏览器不论何种原因未能取回媒介数据时运行的脚本 video.addListener('suspend',videoHandler.suspend);//在媒介数据完全加载之前不论何种原因终止取回媒介数据时运行的脚本 video.addListener('loadeddata',videoHandler.loadedData);//监听视频数据已加载 @@ -1265,12 +1265,12 @@ addListener(window, 'scroll', windowScroll);//监听窗口滚动 } } - } + }, /* * eventTarget * 功能:注册事件,将事件注册给CT对象供外部监听 */ - function eventTarget(name,obj){ + eventTarget=function(name,obj){ try{ if(EventTarget!=null){ if(isUndefined(obj)){ @@ -1316,12 +1316,12 @@ } } catch(event){console.error(event)} - } + }, /* * loadTrack * 功能:加载track */ - function loadTrack(){ + loadTrack=function(){ if(isUndefined(video.textTracks)){ return; } @@ -1346,12 +1346,12 @@ checkTrack(); } } - } + }, /* * loadedMetaData * 功能:视频播放对象video注册内部监听调用函数 */ - function loadedMetaData(){ + loadedMetaData=function(){ eventTarget('loadedMetaData',{ width:CK.getWidth(), height:CK.getHeight(), @@ -1364,7 +1364,7 @@ replaceInformation('videoHeight',CT.videoHeight); replaceInformation('volume',parseInt(CT.volume*100)); replaceInformation('duration',parseInt(duration)); - } + }; /* * videoHandler * 功能:视频播放对象video注册内部监听调用函数 @@ -1827,7 +1827,7 @@ * adFrontPlay * 功能:播放贴片广告 */ - function adFrontPlay(){ + var adFrontPlay=function(){ if(ad['frontPlayI']==0){//如果是播放第一个广告,则显示相关组件 allBarHide(false); C['ad'].show(); @@ -1873,12 +1873,12 @@ C['ad']['bottom']['details'].hide(); } } - } + }, /* * adFrontCloseTime * 功能:播放贴片广告时按指定时间后显示关闭广告按钮 */ - function adFrontCloseTime(){ + adFrontCloseTime=function(){ if(!isUndefined(ad['front']['closeSetTime'])){ clearTimeout(ad['front']['closeSetTime']); ad['front']['closeSetTime']=null; @@ -1892,12 +1892,12 @@ C['ad']['top']['closeAd'].show(); C['ad']['top']['closeTime'].hide(); } - } + }, /* * calculationAdFrontTime * 功能:计算贴片广告倒计时时间以及广告是视频时用于倒计时 */ - function calculationAdFrontTime(t){ + calculationAdFrontTime=function(t){ if(!isUndefined(t)){ ad['front']['list'][ad['frontPlayI']]['time']=t; } @@ -1906,22 +1906,22 @@ ad['front']['countDown']+=parseInt(ad['front']['list'][i]['time']); } C['ad']['top']['countDown'].htm(ad['front']['countDown']+language['second']); - } + }, /* * clearAdFrontSetTime * 功能:关闭贴片广告倒计时的计时器 */ - function clearAdFrontSetTime(){ + clearAdFrontSetTime=function(){ if(adFrontSetTime){ clearTimeout(adFrontSetTime); adFrontSetTime=null; } - } + }, /* * adFrontCountDown * 功能:贴片广告倒计时 */ - function adFrontCountDown(){ + adFrontCountDown=function(){ clearAdFrontSetTime(); var adv=ad['front']['list'][ad['frontPlayI']]; if(adv['time']>0){ @@ -1933,12 +1933,12 @@ else{ adFrontEnded(); } - } + }, /* * adFrontEnded * 功能:贴片广告单个播放完成后进行判断是否需要播放下一个广告还是播放正片 */ - function adFrontEnded(){ + adFrontEnded=function(){ if(ad['frontPlayI']=ad['pausePlayI']){ var adv=ad['pause']['list'][ad['pausePlayI']]; @@ -2174,12 +2174,12 @@ },adv['time']*1000) } } - } + }, /* * closePauseAd * 功能:关闭暂停广告 */ - function closePauseAd(){ + closePauseAd=function(){ if(adPauseSetTime){ clearTimeout(adPauseSetTime); adPauseSetTime=null; @@ -2194,7 +2194,7 @@ player.closeLayer(ad['pause']['node']); eventTarget('pauseAdClose'); } - } + }; /* * player * 功能:开放接口,向外部提供播放器的交互功能列表,包含获取,执行,监听这三种功能 @@ -3313,57 +3313,12 @@ return null; } }; - /* - * documentReady - * 功能:判断页面加载完成 - * @fn:页面加载完成后执行的函数 - */ - function documentReady(fn) { - var isReady = false; - var timer = null; - var doReady = function() { - if(timer) clearInterval(timer); - if(isReady) return; - isReady = true; - if(valType(fn) == 'function') { - fn(); - } - }; - var bodyLoad = function() { - timer = setInterval(function() { - try { - if(!isUndefined(document.readyState) && document.readyState == 'complete') { - doReady(); - } - } catch(event) {}; - }, 10); - }; - var w3c = function() { - if(valType(fn) == 'function') { - fn(); - } - removeListener(window, 'load', w3c); - }; - if(!isUndefined($('body'))){ - if(valType(fn) == 'function') { - fn(); - } - } - else{ - try { - addListener(window, 'load', w3c); - } catch(event) { - bodyLoad(); - } - } - - } /* * checkBar * 功能:完全获取vars值后判断控制栏上的按钮是否需要显示 * 完全获取vars是指视频加载成功后 */ - function checkBar(){ + var checkBar=function(){ //初始化判断 if(vars['autoplay']){ C['bar']['playAndPause']['play'].hide(); @@ -3430,12 +3385,12 @@ if(vars['volume']==0){ player.muted(); } - } + }, /* * loadLogo * 功能:加载logo */ - function loadLogo(){ + loadLogo=function(){ if(!isUndefined(vars['logo']) && isUndefined(C['logo'])){ C['logo']=createlDiv('ck-logo'); createlImg(vars['logo']).addListener('load',function(){ @@ -3443,12 +3398,12 @@ C['logo'].append(this); }).addListener('error',function(){C['logo'].remove()}); } - } + }, /* * loadAbout * 功能:加载loadAbout */ - function loadAbout(){ + loadAbout=function(){ if(!isUndefined(vars['information']) && !isUndefined(C['about']) && valType(vars['information'])=='object'){ var obj=vars['information']; var k=''; @@ -3471,12 +3426,12 @@ CM.append(C['about']['textareaEle']); C['about']['textareaEle'].hide() } - } + }, /* * loadMenu * 功能:加载右键 */ - function loadMenu(){ + loadMenu=function(){ if(!isUndefined(vars['menu']) && vars['menu']){ rightMenu=vars['menu']; } @@ -3542,49 +3497,49 @@ }; C['menu'].mouseout(menuMouseOut); C['menu'].mouseover(clearTime); - } + }, /* * aboutShow * 功能:显示关于视频 */ - function aboutShow(){ + aboutShow=function(){ C['about'].show(); C['menu'].hide(); - } + }, /* * aboutHide * 功能:显示关于视频 */ - function aboutHide(){ + aboutHide=function(){ C['about'].hide(); - } + }, /* * aboutCopy * 功能:拷贝关于视频内容 */ - function aboutCopy(){ + aboutCopy=function(){ C['about']['textareaEle'].show(); C['about']['textareaEle'].select(); document.execCommand('Copy'); // 执行浏览器复制命令 C['about']['textareaEle'].hide(); message(language['copySucceeded'],true); - } + }, /* * getBarHeight * 功能:获取控制栏的高 */ - function getBarHeight(){ + getBarHeight=function(){ var h=C['bar'].getHeight(); if(parseFloat(C['bar']['pbox'].css('top'))<0){ h-=parseInt(C['bar']['pbox'].css('top')); } return h; - } + }, /* * hideBar * 功能:隐藏控制栏,只在播放状态下有效 */ - function hideBar(){ + hideBar=function(){ if(mouseSetTime){ clearTimeout(mouseSetTime); mouseSetTime=null; @@ -3605,22 +3560,22 @@ } mouseSetTime=null; },vars['barHideTime']); - } + }, /* * barMouseOut * 功能:鼠标离开控制栏修改播放进度框样式 */ - function barMouseOut(){ + barMouseOut=function(){ if(!paused){ C['bar']['pbox'].addClass('ck-bar-progress-out'); hideBar(); } - } + }, /* * barMouseOver * 功能:鼠标经过控制栏修改播放进度框样式 */ - function barMouseOver(){ + barMouseOver=function(){ if(!paused){ C['bar']['pbox'].removeClass('ck-bar-progress-out'); if(mouseSetTime){ @@ -3628,33 +3583,33 @@ mouseSetTime=null; } } - } + }, /* * rightBarMouseOut * 功能:鼠标离开右侧控制栏修改播放进度框样式 */ - function rightBarMouseOut(){ + rightBarMouseOut=function(){ if(!paused){ hideBar(); } - } + }, /* * rightBarMouseOver * 功能:鼠标经过右侧控制栏修改播放进度框样式 */ - function rightBarMouseOver(){ + rightBarMouseOver=function(){ if(!paused){ if(mouseSetTime){ clearTimeout(mouseSetTime); mouseSetTime=null; } } - } + }, /* * checkPlaybackrate * 功能:初始化或重置倍速组件内容 */ - function checkPlaybackrate(){ + checkPlaybackrate=function(){ var playbackrate=vars['playbackrateList']; var pbr=vars['playbackrate']; C['bar']['playbackrate']['bg']=createlDiv('ck-list-bg'); @@ -3693,22 +3648,22 @@ }); changePlaybackrateVal(pbr); } - } + }, /* * playbackrateClick * 功能:选择播速 */ - function playbackrateClick(e){ + playbackrateClick=function(e){ C['bar']['playbackrate']['bgbox'].hide(); setTimeout(function(){C['bar']['playbackrate']['bgbox'].removeCss('display');},300); message(language['switchTo']+$(this).htm()); player.playbackRate(parseFloat($(this).attr('data-val'))); - } + }, /* * changePlaybackrateVal * 功能:根据速度检查播速 */ - function changePlaybackrateVal(num){ + changePlaybackrateVal=function(num){ C['bar']['playbackrate']['bg'].find('button').each(function(index,ele){ var val=parseFloat(ele.attr('data-val')); ele.removeClass('ck-list-p-focus'); @@ -3725,12 +3680,12 @@ ele.removeClass('ck-list-p-focus'); } }); - } + }, /* * checkTrack * 功能:初始化或重置字幕组件内容 */ - function checkTrack(){ + checkTrack=function(){ var track=vars['track']; var pbr=-1; C['bar']['track']['bgbox'].htm(''); @@ -3779,22 +3734,22 @@ }); }); changeTrackVal(pbr); - } + }, /* * trackClick * 功能:选择字幕 */ - function trackClick(e){ + trackClick=function(e){ C['bar']['track']['bgbox'].hide(); setTimeout(function(){C['bar']['track']['bgbox'].removeCss('display');},300); message(language['switchTo']+$(this).attr('data-title')); player.track(parseFloat($(this).attr('data-i'))); - } + }, /* * changeTrackVal * 功能:根据字幕检查 */ - function changeTrackVal(num){ + changeTrackVal=function(num){ C['bar']['track']['bg'].find('button').each(function(index,ele){ var i=parseInt(ele.attr('data-i')); if(num==i){ @@ -3813,12 +3768,12 @@ ele.removeClass('ck-list-p-focus'); } }); - } + }, /* * checkDefinition * 功能:初始化或重置清晰度组件内容 */ - function checkDefinition(){ + checkDefinition=function(){ var pi=-1; var videoUrl=video['currentSrc']; if(!isUndefined(C['bar']['definition']['bg'])){ @@ -3875,23 +3830,23 @@ } }); } - } + }, /* * definitionClick * 功能:选择清晰度 */ - function definitionClick(e){ + definitionClick=function(e){ C['bar']['definition']['bgbox'].hide(); setTimeout(function(){ C['bar']['definition']['bgbox'].removeCss('display'); },300); changeDefinition(parseInt($(this).attr('data-i'))); - } + }, /* * changeDefinition * 功能:检查清晰度 */ - function changeDefinition(num){ + changeDefinition=function(num){ C['bar']['definition']['bg'].find('button').each(function(index,ele){ var i=parseInt(ele.attr('data-i')); if(num==i){ @@ -3912,12 +3867,12 @@ ele.removeClass('ck-list-p-focus'); } }); - } + }, /* * deletePrompt * 功能:删除关键点 */ - function deletePrompt(){ + deletePrompt=function(){ var i=0; if(!isUndefined(C['prompt']) && valType(C['prompt'])=='array'){ for(i=C['prompt'].length;i>-1;i--){ @@ -3928,12 +3883,12 @@ C['prompt']=null; } C['prompt']=[]; - } + }, /* * changePrompt * 功能:构建关键点 */ - function changePrompt(){ + changePrompt=function(){ deletePrompt(); for(var i=0;i0){ @@ -5010,12 +4965,12 @@ C['bar']['pbox']['load'].css('width',(loadTime/duration)*100+'%'); } } - }; + }, /* * changeMuted * 功能:修改静音和取消静音时按钮切换事件 */ - function changeMuted(b){ + changeMuted=function(b){ if(b){ C['bar']['vbox']['muted'].hide(); C['bar']['vbox']['exitMuted'].show(); @@ -5029,12 +4984,12 @@ C['ad']['bottom']['mutedAndExit']['muted'].show(); C['ad']['bottom']['mutedAndExit']['exitMuted'].hide() } - } + }, /* * replaceInformation * 功能:替换关于里的内容 */ - function replaceInformation(o , n){ + replaceInformation=function(o , n){ if(isUndefined(C['about']['sourceData']) && !isUndefined(C['about'].find('ul'))){ C['about']['sourceData']=C['about'].find('ul').eq(0).htm(); C['about']['objData']={}; @@ -5069,12 +5024,12 @@ C['about']['objData'][o]=n; return C['about'].find('ul').eq(0).htm(htm); } - } + }, /* * calculationFps * 功能:获取fps */ - function calculationFps() { + calculationFps=function() { var requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || @@ -5109,12 +5064,12 @@ CT.fps=0; } step(); - } + }, /* * getElement * 功能:获取一个外部节点 */ - function getElement(content){ + getElement=function(content){ var ele=$(content); if(isUndefined(ele)) return; if(valType(ele)=='htmlarray'){ @@ -5126,12 +5081,12 @@ ele.nextElement=ele.next(); } return ele; - } + }, /* * $ * 功能:根据ID或className或节点节点名称获取对象 */ - function $(obj, eL) { + $=function(obj, eL) { var parent = null; if (document) { parent = document; @@ -6105,12 +6060,12 @@ } return res; - } + }, /* * createlDiv * 功能:新建一个DIV节点 */ - function createlDiv(className,html) { + createlDiv=function(className,html) { var ele = document.createElement('div'); var eleObject = $(ele); if (className) { @@ -6120,21 +6075,21 @@ eleObject.htm(html); } return eleObject; - } + }, /* * createlVideo * 功能:新建一个video节点 */ - function createlVideo() { + createlVideo=function() { var ele = document.createElement('video'); var eleObject = $(ele); return eleObject; - }; + }, /* * createlButton * 功能新建一个button节点 */ - function createlButton(className,html) { + createlButton=function(className,html) { var ele = document.createElement('button'); var eleObject = $(ele); eleObject.attr('type','button'); @@ -6145,12 +6100,12 @@ eleObject.htm(html); } return eleObject; - } + }, /* * createlA * 功能新建一个a节点 */ - function createlA(html,href,className) { + createlA=function(html,href,className) { var ele = document.createElement('a'); var eleObject = $(ele); if(html){ @@ -6164,12 +6119,12 @@ eleObject.addClass(className); } return eleObject; - } + }, /* * createlJsLink * 功能新建一个a节点 */ - function createlJsLink(html,js) { + createlJsLink=function(html,js) { var ele = document.createElement('a'); var eleObject = $(ele); if(html){ @@ -6182,12 +6137,12 @@ eleObject.attr('href','javascript:;'); } return eleObject; - } + }, /* * createlImg * 功能新建一个img节点 */ - function createlImg(file,className) { + createlImg=function(file,className) { var ele = document.createElement('img'); var eleObject = $(ele); if (className) { @@ -6197,12 +6152,12 @@ ele.src=file; } return eleObject; - } + }, /* * getClient * 功能:获取clientX和clientY */ - function getClient(event) { + getClient=function(event) { var eve = event || window.event; if (isUndefined(eve)) { eve = { @@ -6228,491 +6183,38 @@ x: x, y: y } - } - /* - * getMaxZIndex - * 功能:获取当前页面最大深度 - */ - function getMaxZIndex() { - var arr = document.all || document.querySelectorAll('*'); - var maxZ = -1; - for (var i = 0; i < arr.length; i++) { - var temp = null; - try { - temp = window.getComputedStyle(arr[i], null).zIndex; - } catch (event) { - if (arr[i].style) { - temp = arr[i].style.zIndex; - } - } - if (temp != 'auto' && parseInt(temp) > maxZ) { - maxZ = parseInt(temp); - } - } - return maxZ; - } - /* - * getWindowSize - * 功能:获取window的宽和高 - */ - function getWindowSize() { - return { - width: window.innerWidth, - height: window.innerHeight - }; - } - /* - * standardization - * 功能:将对象Object标准化,将n对象替换进o对象 - * @o:标准化对象,@n:外部传递对象 - */ - function standardization(o, n) { //n替换进o - var h = {}; - var k; - for (k in o) { - h[k] = o[k]; - } - for (k in n) { - if(k in h){ - h[k] = n[k]; - } - } - return h; - } - /* - * mergeObj - * 功能:将新对象合并到原对象中,需要确保原对像里有对应的值并且类型一样 - * @o:原对象,@n:新对象 - */ - function mergeObj(o,n){ - var h = {}; - var k; - for (k in o) { - h[k] = o[k]; - } - for (k in n) { - if(k in h){ - switch(valType(h[k])){ - case 'object': - if(valType(n[k])=='object'){ - h[k] = mergeObj(h[k],n[k]); - } - break; - default: - if(valType(h[k])==valType(n[k])){ - h[k] = n[k]; - } - break; - } - } - } - return h; - } - /* - * valType - * 功能:判断变量类型 - */ - function valType(val) { - if(typeof val==='undefined') return 'undefined'; - var str=Object.prototype.toString.call(val).split(' ')[1].replace(']','').toLowerCase(); - if(str.substr(0,4)=='html' && (str.substr(-7)=='element' || str.substr(-8)=='document' || str=='window')){ - str='htmlobject'; - } - if(str=='htmlcollection' || str=='nodelist'){ - str='htmlarray'; - } - return str; - } - /* - * isUndefined - * 功能:判断变量是否存在或值是否为undefined - */ - function isUndefined(val) { - try { - return valType(val)==='undefined' || val === undefined || val === null || (valType(val)==='number' && isNaN(val)); - } catch (event) { - return true; - } - return false; - } - /* - * prev - * 功能:获取指定节点前一个同胞节点 - * @ele:要获取的节点 - */ - function prev(ele) { - var e = ele.previousSibling; - if (e == null) { //测试同胞节点是否存在,否则返回空 - return null; - } - if (e.nodeType == 3) { //如果同胞节点为文本节点 - var t = prev(e); - if (t && t.nodeType == 1) { - return t; - } - } else { - if (e.nodeType == 1) { //确认节点为节点节点才返回 - return e; - } else { - return false; - } - } - } - /* - * next - * 功能:获取指定节点下一个同胞节点 - * @ele:要获取的节点 - */ - function next(ele) { - var e = ele.nextSibling; - if (e == null) { //测试同胞节点是否存在,否则返回空 - return null; - } - if (e.nodeType == 3) { //如果同胞节点为文本节点 - var t = next(e); - if (t && t.nodeType == 1) { - return t; - } - } else { - if (e.nodeType == 1) { //确认节点为节点才返回 - return e; - } else { - return false; - } - } - } - /* - * addListener - * 功能:事件监听 - * @ele:监听对象,@e:事件名称,@f:返回事件函数 - */ - function addListener(ele, e, f, t) { - if (isUndefined(t)) { - t = false; - } - if (ele.addEventListener) { - try { - ele.addEventListener(e, f, t); - } catch (event) {} - } else if (ele.attachEvent) { - try { - ele.attachEvent('on' + e, f); - } catch (event) {} - } else { - ele['on' + e] = f; - } - if(isUndefined(ele.listenerList)){ - ele.listenerList=[]; - } - ele.listenerList.push([e,f]); - return ele; - }; - /* - * removeListener - * 功能:删除事件监听 - * @ele:监听对象,@e:事件名称,@f:返回事件函数 - */ - function removeListener(ele, e, f, t) { - if (isUndefined(t)) { - t = false; - } - if (ele.removeEventListener) { - try { - ele.removeEventListener(e, f, t); - } catch (e) {} - } else if (ele.detachEvent) { - try { - ele.detachEvent('on' + e, f); - } catch (e) {} - } else { - ele['on' + e] = null; - } - if(!isUndefined(ele.listenerList)){ - var temp=[]; - for(var i=0;i> 0 - }, - - // Week - W: function() { - var a = f.z(), - b = 364 + f.L() - a; - var nd2, nd = (new Date(jsdate.getFullYear() + '/1/1').getDay() || 7) - 1; - if(b <= 2 && ((jsdate.getDay() || 7) - 1) <= 2 - b) { - return 1; - } else { - if(a <= 2 && nd >= 4 && a >= (6 - nd)) { - nd2 = new Date(jsdate.getFullYear() - 1 + '/12/31'); - return date('W', Math.round(nd2.getTime() / 1000)); - } else { - return(1 + (nd <= 3 ? ((a + nd) / 7) : (a - (7 - nd)) / 7) >> 0); - } - } - }, - - // Month - F: function() { - return txt_months[f.n()] - }, - m: function() { - return pad(f.n(), 2) - }, - M: function() { - return f.F().substr(0, 3) - }, - n: function() { - return jsdate.getMonth() + 1 - }, - t: function() { - var n; - if((n = jsdate.getMonth() + 1) == 2) { - return 28 + f.L(); - } else { - if(n & 1 && n < 8 || !(n & 1) && n > 7) { - return 31; - } else { - return 30; - } - } - }, - - // Year - L: function() { - var y = f.Y(); - return(!(y & 3) && (y % 1e2 || !(y % 4e2))) ? 1 : 0 - }, - //o not supported yet - Y: function() { - return jsdate.getFullYear() - }, - y: function() { - return(jsdate.getFullYear() + '').slice(2) - }, - - // Time - a: function() { - return jsdate.getHours() > 11 ? 'pm' : 'am' - }, - A: function() { - return f.a().toUpperCase() - }, - B: function() { - // peter paul koch: - var off = (jsdate.getTimezoneOffset() + 60) * 60; - var theSeconds = (jsdate.getHours() * 3600) + (jsdate.getMinutes() * 60) + jsdate.getSeconds() + off; - var beat = Math.floor(theSeconds / 86.4); - if(beat > 1000) beat -= 1000; - if(beat < 0) beat += 1000; - if((String(beat)).length == 1) beat = '00' + beat; - if((String(beat)).length == 2) beat = '0' + beat; - return beat; - }, - g: function() { - return jsdate.getHours() % 12 || 12 - }, - G: function() { - return jsdate.getHours() - }, - h: function() { - return pad(f.g(), 2) - }, - H: function() { - return pad(jsdate.getHours(), 2) - }, - i: function() { - return pad(jsdate.getMinutes(), 2) - }, - s: function() { - return pad(jsdate.getSeconds(), 2) - }, - //u not supported yet - - // Timezone - //e not supported yet - //I not supported yet - O: function() { - var t = pad(Math.abs(jsdate.getTimezoneOffset() / 60 * 100), 4); - if(jsdate.getTimezoneOffset() > 0) t = '-' + t; - else t = '+' + t; - return t; - }, - P: function() { - var O = f.O(); - return(O.substr(0, 3) + ':' + O.substr(3, 2)) - }, - //T not supported yet - //Z not supported yet - - // Full Date/Time - c: function() { - return f.Y() + '-' + f.m() + '-' + f.d() + 'T' + f.h() + ':' + f.i() + ':' + f.s() + f.P() - }, - //r not supported yet - U: function() { - return Math.round(jsdate.getTime() / 1000) - } - }; - - return format.replace(/([a-zA-Z])/g,function(t, s) { - var ret=''; - if(t != s) { - // escaped - ret = s; - } else if(f[s]) { - // a date function exists - ret = f[s](); - } else { - // nothing special - ret = s; - } - return ret; - }); - } - - /* - * getPath - * 功能:获取该js文件所在路径 - */ - function getPath(siz) { - 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'); - var src = scriptList[i].src.slice(scriptList[i].src.lastIndexOf('/') + 1, scriptList[i].src.lastIndexOf('.')); - if ((scriptName && (scriptName == 'ckplayer' || scriptName == 'ckplayer.min')) || (scriptList[i].src && (src == 'ckplayer' || src == 'ckplayer.min'))) { - thisPath = scriptList[i].src; - break; - } - } - var path=thisPath.substring(0, thisPath.lastIndexOf('/js/') + 1); - if(!isUndefined(siz)){ - path+=siz+'/'; - } - return path; - } - - /* - * checkJs - * 功能:判断js是否已加载 - * @file:js文件路径 - */ - function checkJs(file) { - var scriptList = document.scripts; - for (var i = 0; i < scriptList.length; i++) { - if(scriptList[i].src==file){ - return scriptList[i]; - } - } - return false; - } + }, /* * loadJs * 功能:加载js文件并在加载完成后执行callback函数 * @file:js文件地址 * @callback:加载完成后执行的函数 */ - function loadJs(file, callback) { + loadJs=function(file, callback) { var fn =function() {}; if(!isUndefined(callback)){ fn=callback; @@ -6766,170 +6268,14 @@ } script.src = file; $('head').eq(0).append(script); - } - /* - * ajax - * 功能:ajax功能 - * @cObj:传递的参数,包含请求地址,请求类型,编码等 - */ - function ajax(cObj) { - var callback = null; - var obj = { - method: 'get',//请求类型 - dataType: 'json',//请求的数据类型 - charset: 'utf-8', - async: true,//true表示异步,false表示同步 - url: '', - data: null, - success: null, - error:null - }; - obj = standardization(obj, cObj); - if (isUndefined(obj['url'])) { - return; - } - /* - * errorFun - *功能:执行error - */ - var errorFun=function(info){ - if(!isUndefined(obj['error']) && valType(obj['error'])=='function'){ - obj['error'](info); - } - else{ - obj['success'](null); - } - }; - /* - * successFun - *功能:执行success - */ - var successFun=function(success){ - if(!isUndefined(obj['success']) && valType(obj['success'])=='function'){ - obj['success'](success); - } - }; - /* - * createXHR - *功能:用来为ajax函数提供支持 - */ - var createXHR=function() { - if (window.XMLHttpRequest) { - return new XMLHttpRequest(); - } else if (window.ActiveXObject) { - try { - return new ActiveXObject('Microsoft.XMLHTTP'); - } catch(event) { - try { - return new ActiveXObject('Msxml2.XMLHTTP'); - } catch(event) {} - } - } - }; - /* - * formatParams - * 功能:将对象转成地址字符串,为ajax函数提供支持 - * @obj:传递一个对象 - */ - var formatParams=function(obj) { - var arr = []; - for (var key in obj) { - arr.push(encodeURIComponent(key) + '=' + encodeURIComponent(obj[key])); - } - return arr.join('&'); - }; - if (valType(cObj) != 'object') { - if(!isUndefined(obj['error'])){ - obj.error(event); - } - return; - } - - if (obj.dataType === 'json' || obj.dataType === 'text' || obj.dataType === 'html' || obj.dataType === 'xml') { - var xhr = createXHR(); - callback = function() { - //判断http的交互是否成功 - if (xhr.status === 200) { - if (obj.dataType === 'json') { - try { - successFun(eval('(' + xhr.responseText + ')')); //回调传递参数 - } - catch(event) { - successFun(null); - } - } else { - successFun(xhr.responseText); //回调传递参数 - } - } - else { - errorFun({code:xhr.status,message:xhr.statusText}); - } - }; - obj.data = formatParams(obj.data); //通过params()将名值对转换成字符串 - if (obj.method === 'get' && !isUndefined(obj.data)) { - if (obj.data != '') { - if (obj.url.indexOf('?') == -1) { - obj.url += '?' + obj.data - } else { - obj.url += '&' + obj.data; - } - } - } - if (obj.async === true) { //true表示异步,false表示同步 - addListener(xhr,'readystatechange',function(event){ - if (this.readyState === 4 && callback != null) { //判断对象的状态是否交互完成 - callback(); //回调 - } - }); - } - xhr.open(obj.method, obj.url, obj.async); - if (obj.method === 'post') { - try{ - xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); - xhr.setRequestHeader('charset', obj['charset']); - xhr.send(obj.data); - } - catch(event){ - callback(); - } - } - else { - try{ - xhr.send(null); //get方式则填null - } - catch(event){ - callback(); - } - } - if (obj.async === false) { //同步 - callback(); - } + }, - } - else if (obj.dataType === 'jsonp') { - var oHead = document.getElementsByTagName('head')[0]; - var oScript = document.createElement('script'); - var callbackName = 'callback' + new Date().getTime(); - var params = formatParams(obj.data) + '&callback=' + callbackName; //按时间戳拼接字符串 - //拼接好src - oScript.src = obj.url.split('?') + '?' + params; - //插入script标签 - oHead.insertBefore(oScript, oHead.firstChild); - //jsonp的回调函数 - window[callbackName] = function(json) { - if(!isUndefined(obj['success']) && valType(obj['success'])==='function'){ - obj['success'](json); - } - oHead.removeChild(oScript); - }; - } - } /* * doubleClickEvent * 功能:注册对象双击功能 * @ele:注册对象,可以是页面中的任意节点,不支持数组形式 */ - function doubleClickEvent(ele){ + doubleClickEvent=function(ele){ var setTime=null;//注册延时函数 var clickTime=0;//记录点击时间 ele=$(ele); @@ -6967,63 +6313,716 @@ } } }); - } - /* - * dataURLtoBlob - * 功能,base64转blob - */ - function dataURLtoBlob(dataurl) { - var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n); - while (n--) { - u8arr[n] = bstr.charCodeAt(n); - } - return new Blob([u8arr], { type: mime }); - } - /* - * decodeURIString - * 功能,解码中文 - */ - function decodeURIString(obj){ - for(var k in obj){ - if(valType(obj[k])=='string' && obj[k]){ - try{ - obj[k]=decodeURI(obj[k]); - } - catch(event){} - } - if(valType(obj[k])=='object'){ - obj[k]=decodeURIString(obj[k]); - } - } - return obj; - } - /* - * bodyScroll - * 功能,禁止页面滚动操作 - */ - function bodyScroll(event){ - event.preventDefault(); - } + }, /* * noScrolling * 功能,禁止页面滚动操作 */ - function noScrolling(b){ + noScrolling=function(b){ if(isUndefined(b)) b=false; + var bodyScroll=function (event){ + event.preventDefault(); + }; if(b){ //禁止滚动 $('body').addListener('touchmove', bodyScroll, {passive: false }); } else{ //开启滚动 $('body').removeListener('touchmove',bodyScroll, {passive: false}); } + }; + return into(videoObj); + } + /* + * ajax + * 功能:ajax功能 + * @cObj:传递的参数,包含请求地址,请求类型,编码等 + */ + function ajax(cObj) { + var callback = null; + var obj = { + method: 'get',//请求类型 + dataType: 'json',//请求的数据类型 + charset: 'utf-8', + async: true,//true表示异步,false表示同步 + url: '', + data: null, + success: null, + error:null + }; + obj = standardization(obj, cObj); + if (isUndefined(obj['url'])) { + return; } - function getApp(){ - var u = navigator.userAgent.toLowerCase(); - if(u.indexOf('iphone')>-1){ - return 'iphone'; + /* + * errorFun + *功能:执行error + */ + var errorFun=function(info){ + if(!isUndefined(obj['error']) && valType(obj['error'])=='function'){ + obj['error'](info); + } + else{ + obj['success'](null); + } + }; + /* + * successFun + *功能:执行success + */ + var successFun=function(success){ + if(!isUndefined(obj['success']) && valType(obj['success'])=='function'){ + obj['success'](success); + } + }; + /* + * createXHR + *功能:用来为ajax函数提供支持 + */ + var createXHR=function() { + if (window.XMLHttpRequest) { + return new XMLHttpRequest(); + } else if (window.ActiveXObject) { + try { + return new ActiveXObject('Microsoft.XMLHTTP'); + } catch(event) { + try { + return new ActiveXObject('Msxml2.XMLHTTP'); + } catch(event) {} + } + } + }; + /* + * formatParams + * 功能:将对象转成地址字符串,为ajax函数提供支持 + * @obj:传递一个对象 + */ + var formatParams=function(obj) { + var arr = []; + for (var key in obj) { + arr.push(encodeURIComponent(key) + '=' + encodeURIComponent(obj[key])); + } + return arr.join('&'); + }; + if (valType(cObj) != 'object') { + if(!isUndefined(obj['error'])){ + obj.error(event); + } + return; + } + + if (obj.dataType === 'json' || obj.dataType === 'text' || obj.dataType === 'html' || obj.dataType === 'xml') { + var xhr = createXHR(); + callback = function() { + //判断http的交互是否成功 + if (xhr.status === 200) { + if (obj.dataType === 'json') { + try { + successFun(eval('(' + xhr.responseText + ')')); //回调传递参数 + } + catch(event) { + successFun(null); + } + } else { + successFun(xhr.responseText); //回调传递参数 + } + } + else { + errorFun({code:xhr.status,message:xhr.statusText}); + } + }; + obj.data = formatParams(obj.data); //通过params()将名值对转换成字符串 + if (obj.method === 'get' && !isUndefined(obj.data)) { + if (obj.data != '') { + if (obj.url.indexOf('?') == -1) { + obj.url += '?' + obj.data + } else { + obj.url += '&' + obj.data; + } + } + } + if (obj.async === true) { //true表示异步,false表示同步 + addListener(xhr,'readystatechange',function(event){ + if (this.readyState === 4 && callback != null) { //判断对象的状态是否交互完成 + callback(); //回调 + } + }); + } + xhr.open(obj.method, obj.url, obj.async); + if (obj.method === 'post') { + try{ + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + xhr.setRequestHeader('charset', obj['charset']); + xhr.send(obj.data); + } + catch(event){ + callback(); + } + } + else { + try{ + xhr.send(null); //get方式则填null + } + catch(event){ + callback(); + } + } + if (obj.async === false) { //同步 + callback(); + } + + } + else if (obj.dataType === 'jsonp') { + var oHead = document.getElementsByTagName('head')[0]; + var oScript = document.createElement('script'); + var callbackName = 'callback' + new Date().getTime(); + var params = formatParams(obj.data) + '&callback=' + callbackName; //按时间戳拼接字符串 + //拼接好src + oScript.src = obj.url.split('?') + '?' + params; + //插入script标签 + oHead.insertBefore(oScript, oHead.firstChild); + //jsonp的回调函数 + window[callbackName] = function(json) { + if(!isUndefined(obj['success']) && valType(obj['success'])==='function'){ + obj['success'](json); + } + oHead.removeChild(oScript); + }; + } + } + /* + * documentReady + * 功能:判断页面加载完成 + * @fn:页面加载完成后执行的函数 + */ + function documentReady(fn) { + var isReady = false; + var timer = null; + var doReady = function() { + if(timer) clearInterval(timer); + if(isReady) return; + isReady = true; + if(valType(fn) == 'function') { + fn(); + } + }; + var bodyLoad = function() { + timer = setInterval(function() { + try { + if(!isUndefined(document.readyState) && document.readyState == 'complete') { + doReady(); + } + } catch(event) {}; + }, 10); + }; + var w3c = function() { + if(valType(fn) == 'function') { + fn(); + } + removeListener(window, 'load', w3c); + }; + if(!isUndefined($('body'))){ + if(valType(fn) == 'function') { + fn(); } } - return into(videoObj); + else{ + try { + addListener(window, 'load', w3c); + } catch(event) { + bodyLoad(); + } + } + + } + /* + * getPath + * 功能:获取该js文件所在路径 + */ + function getPath(siz) { + 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'); + var src = scriptList[i].src.slice(scriptList[i].src.lastIndexOf('/') + 1, scriptList[i].src.lastIndexOf('.')); + if ((scriptName && (scriptName == 'ckplayer' || scriptName == 'ckplayer.min')) || (scriptList[i].src && (src == 'ckplayer' || src == 'ckplayer.min'))) { + thisPath = scriptList[i].src; + break; + } + } + var path=thisPath.substring(0, thisPath.lastIndexOf('/js/') + 1); + if(!isUndefined(siz)){ + path+=siz+'/'; + } + return path; + } + /* + * checkJs + * 功能:判断js是否已加载 + * @file:js文件路径 + */ + function checkJs(file) { + var scriptList = document.scripts; + for (var i = 0; i < scriptList.length; i++) { + if(scriptList[i].src==file){ + return scriptList[i]; + } + } + return false; + } + /* + * getMaxZIndex + * 功能:获取当前页面最大深度 + */ + function getMaxZIndex() { + var arr = document.all || document.querySelectorAll('*'); + var maxZ = -1; + for (var i = 0; i < arr.length; i++) { + var temp = null; + try { + temp = window.getComputedStyle(arr[i], null).zIndex; + } catch (event) { + if (arr[i].style) { + temp = arr[i].style.zIndex; + } + } + if (temp != 'auto' && parseInt(temp) > maxZ) { + maxZ = parseInt(temp); + } + } + return maxZ; + } + /* + * getWindowSize + * 功能:获取window的宽和高 + */ + function getWindowSize() { + return { + width: window.innerWidth, + height: window.innerHeight + }; + } + /* + * standardization + * 功能:将对象Object标准化,将n对象替换进o对象 + * @o:标准化对象,@n:外部传递对象 + */ + function standardization(o, n) { //n替换进o + var h = {}; + var k; + for (k in o) { + h[k] = o[k]; + } + for (k in n) { + if(k in h){ + h[k] = n[k]; + } + } + return h; + } + /* + * mergeObj + * 功能:将新对象合并到原对象中,需要确保原对像里有对应的值并且类型一样 + * @o:原对象,@n:新对象 + */ + function mergeObj(o,n){ + var h = {}; + var k; + for (k in o) { + h[k] = o[k]; + } + for (k in n) { + if(k in h){ + switch(valType(h[k])){ + case 'object': + if(valType(n[k])=='object'){ + h[k] = mergeObj(h[k],n[k]); + } + break; + default: + if(valType(h[k])==valType(n[k])){ + h[k] = n[k]; + } + break; + } + } + } + return h; + } + /* + * valType + * 功能:判断变量类型 + */ + function valType(val) { + if(typeof val==='undefined') return 'undefined'; + var str=Object.prototype.toString.call(val).split(' ')[1].replace(']','').toLowerCase(); + if(str.substr(0,4)=='html' && (str.substr(-7)=='element' || str.substr(-8)=='document' || str=='window')){ + str='htmlobject'; + } + if(str=='htmlcollection' || str=='nodelist'){ + str='htmlarray'; + } + return str; + } + /* + * isUndefined + * 功能:判断变量是否存在或值是否为undefined + */ + function isUndefined(val) { + try { + return valType(val)==='undefined' || val === undefined || val === null || (valType(val)==='number' && isNaN(val)); + } catch (event) { + return true; + } + return false; + } + /* + * prev + * 功能:获取指定节点前一个同胞节点 + * @ele:要获取的节点 + */ + function prev(ele) { + var e = ele.previousSibling; + if (e == null) { //测试同胞节点是否存在,否则返回空 + return null; + } + if (e.nodeType == 3) { //如果同胞节点为文本节点 + var t = prev(e); + if (t && t.nodeType == 1) { + return t; + } + } else { + if (e.nodeType == 1) { //确认节点为节点节点才返回 + return e; + } else { + return false; + } + } + } + /* + * next + * 功能:获取指定节点下一个同胞节点 + * @ele:要获取的节点 + */ + function next(ele) { + var e = ele.nextSibling; + if (e == null) { //测试同胞节点是否存在,否则返回空 + return null; + } + if (e.nodeType == 3) { //如果同胞节点为文本节点 + var t = next(e); + if (t && t.nodeType == 1) { + return t; + } + } else { + if (e.nodeType == 1) { //确认节点为节点才返回 + return e; + } else { + return false; + } + } + } + /* + * addListener + * 功能:事件监听 + * @ele:监听对象,@e:事件名称,@f:返回事件函数 + */ + function addListener(ele, e, f, t) { + if (isUndefined(t)) { + t = false; + } + if (ele.addEventListener) { + try { + ele.addEventListener(e, f, t); + } catch (event) {} + } else if (ele.attachEvent) { + try { + ele.attachEvent('on' + e, f); + } catch (event) {} + } else { + ele['on' + e] = f; + } + if(isUndefined(ele.listenerList)){ + ele.listenerList=[]; + } + ele.listenerList.push([e,f]); + return ele; + }; + /* + * removeListener + * 功能:删除事件监听 + * @ele:监听对象,@e:事件名称,@f:返回事件函数 + */ + function removeListener(ele, e, f, t) { + if (isUndefined(t)) { + t = false; + } + if (ele.removeEventListener) { + try { + ele.removeEventListener(e, f, t); + } catch (e) {} + } else if (ele.detachEvent) { + try { + ele.detachEvent('on' + e, f); + } catch (e) {} + } else { + ele['on' + e] = null; + } + if(!isUndefined(ele.listenerList)){ + var temp=[]; + for(var i=0;i> 0 + }, + + // Week + W: function() { + var a = f.z(), + b = 364 + f.L() - a; + var nd2, nd = (new Date(jsdate.getFullYear() + '/1/1').getDay() || 7) - 1; + if(b <= 2 && ((jsdate.getDay() || 7) - 1) <= 2 - b) { + return 1; + } else { + if(a <= 2 && nd >= 4 && a >= (6 - nd)) { + nd2 = new Date(jsdate.getFullYear() - 1 + '/12/31'); + return date('W', Math.round(nd2.getTime() / 1000)); + } else { + return(1 + (nd <= 3 ? ((a + nd) / 7) : (a - (7 - nd)) / 7) >> 0); + } + } + }, + + // Month + F: function() { + return txt_months[f.n()] + }, + m: function() { + return pad(f.n(), 2) + }, + M: function() { + return f.F().substr(0, 3) + }, + n: function() { + return jsdate.getMonth() + 1 + }, + t: function() { + var n; + if((n = jsdate.getMonth() + 1) == 2) { + return 28 + f.L(); + } else { + if(n & 1 && n < 8 || !(n & 1) && n > 7) { + return 31; + } else { + return 30; + } + } + }, + + // Year + L: function() { + var y = f.Y(); + return(!(y & 3) && (y % 1e2 || !(y % 4e2))) ? 1 : 0 + }, + //o not supported yet + Y: function() { + return jsdate.getFullYear() + }, + y: function() { + return(jsdate.getFullYear() + '').slice(2) + }, + + // Time + a: function() { + return jsdate.getHours() > 11 ? 'pm' : 'am' + }, + A: function() { + return f.a().toUpperCase() + }, + B: function() { + // peter paul koch: + var off = (jsdate.getTimezoneOffset() + 60) * 60; + var theSeconds = (jsdate.getHours() * 3600) + (jsdate.getMinutes() * 60) + jsdate.getSeconds() + off; + var beat = Math.floor(theSeconds / 86.4); + if(beat > 1000) beat -= 1000; + if(beat < 0) beat += 1000; + if((String(beat)).length == 1) beat = '00' + beat; + if((String(beat)).length == 2) beat = '0' + beat; + return beat; + }, + g: function() { + return jsdate.getHours() % 12 || 12 + }, + G: function() { + return jsdate.getHours() + }, + h: function() { + return pad(f.g(), 2) + }, + H: function() { + return pad(jsdate.getHours(), 2) + }, + i: function() { + return pad(jsdate.getMinutes(), 2) + }, + s: function() { + return pad(jsdate.getSeconds(), 2) + }, + //u not supported yet + + // Timezone + //e not supported yet + //I not supported yet + O: function() { + var t = pad(Math.abs(jsdate.getTimezoneOffset() / 60 * 100), 4); + if(jsdate.getTimezoneOffset() > 0) t = '-' + t; + else t = '+' + t; + return t; + }, + P: function() { + var O = f.O(); + return(O.substr(0, 3) + ':' + O.substr(3, 2)) + }, + //T not supported yet + //Z not supported yet + + // Full Date/Time + c: function() { + return f.Y() + '-' + f.m() + '-' + f.d() + 'T' + f.h() + ':' + f.i() + ':' + f.s() + f.P() + }, + //r not supported yet + U: function() { + return Math.round(jsdate.getTime() / 1000) + } + }; + + return format.replace(/([a-zA-Z])/g,function(t, s) { + var ret=''; + if(t != s) { + // escaped + ret = s; + } else if(f[s]) { + // a date function exists + ret = f[s](); + } else { + // nothing special + ret = s; + } + return ret; + }); + } + /* + * dataURLtoBlob + * 功能,base64转blob + */ + function dataURLtoBlob(dataurl) { + var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n); + while (n--) { + u8arr[n] = bstr.charCodeAt(n); + } + return new Blob([u8arr], { type: mime }); + } + /* + * decodeURIString + * 功能,解码中文 + */ + function decodeURIString(obj){ + for(var k in obj){ + if(valType(obj[k])=='string' && obj[k]){ + try{ + obj[k]=decodeURI(obj[k]); + } + catch(event){} + } + if(valType(obj[k])=='object'){ + obj[k]=decodeURIString(obj[k]); + } + } + return obj; + } + /* + * getApp + * 功能,获取平台类型是否是iphone + */ + function getApp(){ + var u = navigator.userAgent.toLowerCase(); + if(u.indexOf('iphone')>-1){ + return 'iphone'; + } } return ckplayerEmbed; })); \ No newline at end of file diff --git a/ckplayer/js/ckplayer.min.js b/ckplayer/js/ckplayer.min.js index 06ccc8f..e9f9614 100644 --- a/ckplayer/js/ckplayer.min.js +++ b/ckplayer/js/ckplayer.min.js @@ -4,4 +4,4 @@ * 版权:www.ckplayer.com * 开源协议:MIT */ -(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory():typeof define==='function'&&define.amd?define(factory):(global=global||self,global.ckplayer=factory())}(this,function(){'use strict';function ckplayerEmbed(videoObj){var language={play:'%E6%92%AD%E6%94%BE',pause:'%E6%9A%82%E5%81%9C',refresh:'%E9%87%8D%E6%92%AD',full:'%E5%85%A8%E5%B1%8F',exitFull:'%E9%80%80%E5%87%BA%E5%85%A8%E5%B1%8F',webFull:'%E9%A1%B5%E9%9D%A2%E5%85%A8%E5%B1%8F',exitWebFull:'%E9%80%80%E5%87%BA%E9%A1%B5%E9%9D%A2%E5%85%A8%E5%B1%8F',theatre:'%E5%89%A7%E5%9C%BA%E6%A8%A1%E5%BC%8F',exitTheatre:'%E9%80%80%E5%87%BA%E5%89%A7%E5%9C%BA%E6%A8%A1%E5%BC%8F',volume:'%E9%9F%B3%E9%87%8F%EF%BC%9A',muted:'%E9%9D%99%E9%9F%B3',exitmuted:'%E6%81%A2%E5%A4%8D%E9%9F%B3%E9%87%8F',seek:'seek%EF%BC%9A',waiting:'%E7%BC%93%E5%86%B2',live:'%E7%9B%B4%E6%92%AD%E4%B8%AD',backLive:'%E8%BF%94%E5%9B%9E%E7%9B%B4%E6%92%AD',lookBack:'%E5%9B%9E%E7%9C%8B%EF%BC%9A',next:'%E4%B8%8B%E4%B8%80%E9%9B%86',screenshot:'%E8%A7%86%E9%A2%91%E6%88%AA%E5%9B%BE',smallwindows:'%E5%B0%8F%E7%AA%97%E5%8F%A3%E6%92%AD%E6%94%BE%E5%8A%9F%E8%83%BD',playbackrate:'%E5%80%8D%E9%80%9F',playbackrateSuffix:'%E5%80%8D',track:'%E5%AD%97%E5%B9%95',noTrack:'%E6%97%A0%E5%AD%97%E5%B9%95',definition:'%E6%B8%85%E6%99%B0%E5%BA%A6',switchTo:'%E5%88%87%E6%8D%A2%E6%88%90%EF%BC%9A',closeTime:'%7Bseconds%7D%E7%A7%92%E5%90%8E%E5%8F%AF%E5%85%B3%E9%97%AD%E5%B9%BF%E5%91%8A',closeAd:'%E5%85%B3%E9%97%AD%E5%B9%BF%E5%91%8A',second:'%E7%A7%92',details:'%E6%9F%A5%E7%9C%8B%E8%AF%A6%E6%83%85',copy:'%E5%A4%8D%E5%88%B6',copySucceeded:'%E5%A4%8D%E5%88%B6%E6%88%90%E5%8A%9F%EF%BC%8C%E5%8F%AF%E8%B4%B4%E7%B2%98%EF%BC%81',smallwindowsOpen:'%E5%B0%8F%E7%AA%97%E5%8F%A3%E5%8A%9F%E8%83%BD%E5%B7%B2%E5%BC%80%E5%90%AF',smallwindowsClose:'%E5%B0%8F%E7%AA%97%E5%8F%A3%E5%8A%9F%E8%83%BD%E5%B7%B2%E5%85%B3%E9%97%AD',screenshotStart:'%E6%88%AA%E5%9B%BE%E4%B8%AD%EF%BC%8C%E8%AF%B7%E7%A8%8D%E5%80%99...',screenshotClose:'%E6%88%AA%E5%9B%BE%E5%8A%9F%E8%83%BD%E5%B7%B2%E5%85%B3%E9%97%AD',loopOpen:'%E5%BE%AA%E7%8E%AF%E6%92%AD%E6%94%BE',loopClose:'%E5%B7%B2%E5%85%B3%E9%97%AD%E5%BE%AA%E7%8E%AF%E6%92%AD%E6%94%BE',close:'%E5%85%B3%E9%97%AD',down:'%E4%B8%8B%E8%BD%BD',p50:'50%25',p75:'75%25',p100:'100%25',timeScheduleAdjust:{prohibit:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E6%8B%96%E5%8A%A8',prohibitBackOff:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E9%87%8D%E5%A4%8D%E8%A7%82%E7%9C%8B',prohibitForward:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E5%BF%AB%E8%BF%9B',prohibitLookBack:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E6%92%AD%E6%94%BE%E9%83%A8%E5%88%86%E5%86%85%E5%AE%B9',prohibitForwardNotViewed:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E6%92%AD%E6%94%BE%E6%9C%AA%E8%A7%82%E7%9C%8B%E7%9A%84%E9%83%A8%E5%88%86'},error:{noMessage:'%E6%9C%AA%E7%9F%A5%E9%94%99%E8%AF%AF',supportVideoError:'%E8%AF%A5%E6%B5%8F%E8%A7%88%E5%99%A8%E7%89%88%E6%9C%AC%E5%A4%AA%E4%BD%8E%EF%BC%8C%E5%BB%BA%E8%AE%AE%E6%9B%B4%E6%8D%A2%E6%88%90%E5%85%B6%E5%AE%83%E6%B5%8F%E8%A7%88%E5%99%A8',videoTypeError:'%E8%AF%A5%E6%B5%8F%E8%A7%88%E5%99%A8%E4%B8%8D%E6%94%AF%E6%8C%81%E6%92%AD%E6%94%BE%E8%AF%A5%E8%A7%86%E9%A2%91%EF%BC%8C%E5%BB%BA%E8%AE%AE%E6%9B%B4%E6%8D%A2%E6%88%90%E5%85%B6%E5%AE%83%E6%B5%8F%E8%A7%88%E5%99%A8',loadingFailed:'%E5%8A%A0%E8%BD%BD%E5%A4%B1%E8%B4%A5',emptied:'%E8%A7%86%E9%A2%91%E6%96%87%E4%BB%B6%E5%8A%A0%E8%BD%BD%E8%BF%87%E7%A8%8B%E4%B8%AD%E5%87%BA%E7%8E%B0%E9%94%99%E8%AF%AF',screenshot:'%E8%A7%86%E9%A2%91%E6%88%AA%E5%9B%BE%E5%A4%B1%E8%B4%A5',ajax:'Ajax%E6%95%B0%E6%8D%AE%E8%AF%B7%E6%B1%82%E9%94%99%E8%AF%AF',noVideoContainer:'%E6%9C%AA%E6%89%BE%E5%88%B0%E6%94%BE%E7%BD%AE%E8%A7%86%E9%A2%91%E7%9A%84%E5%AE%B9%E5%99%A8'}};var rightMenu=[{title:'ckplayer',link:'http://www.ckplayer.com'},{title:'version:X3',underline:true},{title:'about',click:'aboutShow'}];var videoObjectDefault={container:'',volume:0.8,poster:'',autoplay:false,loop:false,live:false,rotate:0,zoom:0,ad:null,backLive:false,seek:0,next:null,loaded:'',plug:'',duration:0,preview:null,prompt:null,crossOrigin:'',video:null,type:'',playbackrate:1,ended:null,webFull:false,theatre:null,controls:false,rightBar:null,smallWindows:null,smallWindowsDrag:true,screenshot:false,timeScheduleAdjust:1,logo:'',menu:null,information:{'Load:':'{loadTime} second','Duration:':'{duration} second','Size:':'{videoWidth}x{videoHeight}','Volume:':'{volume}%','Fps:':'{fps}fps','Sudio decoded:':'{audioDecodedByteCount} Byte','Video decoded:':'{videoDecodedByteCount} Byte'},track:null,title:'',language:'',barHideTime:1500,playbackrateOpen:true,playbackrateList:[0.75,1,1.25,1.5,2,4]};var vars={},varsTemp={};var video=null;var duration=0;var mutedState='';var waited=true;var paused=true;var loadTime=0;var seekTime=0;var oldTime=0,playTime=0,firstSeekTime=-1,maxSeeTime=0;var isChangeDef=true;var playType='';var msgSetTime=null,tipSetTime=null,mouseSetTime=null;var adFrontSetTime=null,adPauseSetTime=null;var waitingMessage=true;var hidePreviewSetTime=null;var pSliderMouseDown=false;var playbackTime=0;var loadedmetadataNum=0;var screenshotImg=null;var ad=null;var frontAdPlay=false,pauseAdPlay=false;var barShow=true,rightBarShow=true;var EventTarget=null,newEvent=null,eventTargetList=null;var loadedTrack=false;var C={};var CT=null,CK=null,CM=null,CV=null;var pugPlayer=null;var hls=null;var loadMeta=true;var app='';var nowRotate=0;var nowZoom=100;var smallWindowsState=false;var isDrag=false;function into(obj){if(isUndefined(obj)){player.add=player.into=into;return player}language=decodeURIString(language);if(!isUndefined(window.ckplayerLanguage)){language=mergeObj(language,window.ckplayerLanguage)}eventTarget();app=getApp();varsTemp={};for(var key in videoObjectDefault){varsTemp[key]=videoObjectDefault[key]}if(valType(obj)=='string'&&(obj.substr(0,8)=='website:'||obj.substr(0,4)=='url:')){var ajaxUrl='';if(obj.substr(0,8)=='website:'){ajaxUrl=obj.substring(8)}if(obj.substr(0,4)=='url:'){ajaxUrl=obj.substring(4)}ajax({url:ajaxUrl,success:function(data){if(data){return into(data)}else{showWindowsError(language['error']['ajax']+',url:'+ajaxUrl);return null}}})}else if(valType(obj)=='object'){varsTemp=standardization(varsTemp,obj);if(!isUndefined(obj['container'])&&obj['container']){CT=$(obj['container']);if(CT){return loadLanguage(obj)}else{return bodyReady(obj)}}else{return bodyReady(obj)}}else{showWindowsError(language['error']['noVideoContainer']);return null}}function bodyReady(obj){documentReady(function(){if(!isUndefined(obj['container'])){CT=$(obj['container']);if(CT){return loadLanguage(obj)}else{showWindowsError(language['error']['noVideoContainer']);return null}}else{return ajaxWebsite(obj)}});return null}function ajaxWebsite(obj){if(valType(obj['video'])=='string'&&(obj['video'].substr(0,8)=='website:'||obj['video'].substr(0,4)=='url:')){varsTemp=standardization(varsTemp,obj);var ajaxUrl='';if(obj['video'].substr(0,8)=='website:'){ajaxUrl=obj['video'].substring(8)}if(obj['video'].substr(0,4)=='url:'){ajaxUrl=obj['video'].substring(4)}ajax({url:ajaxUrl,success:function(data){if(data){return into(data)}else{showWindowsError(language['error']['ajax']+',url:'+ajaxUrl);return null}}})}else{showWindowsError(language['error']['noVideoContainer']);return null}}function loadLanguage(obj){vars=standardization(varsTemp,obj);if(vars['language']){var path=getPath('language')+vars['language']+'.js';loadJs(path,function(){if(!isUndefined(window['ckplayerLanguage'])){language=mergeObj(language,window['ckplayerLanguage'])}return embed(obj)})}else{return embed(obj)}}function embed(obj){mutedState=vars['volume']>0?false:true;if(!isUndefined(CT)&&CT!=null){if(valType(CT)=='htmlarray'){CT=CT.eq(0)}}else{return null}calculationFps();CT.htm('');CK=createlDiv('ckplayer-ckplayer');CT.append(CK);CM=createlDiv('ck-main');CK.append(CM);CV=createlDiv('ck-video');CM.append(CV);if(video){video.remove();video=null}if(valType(vars['video'])=='string'&&((vars['video'].substr(0,1)=='.'&&vars['video'].indexOf('/')==-1)||vars['video'].substr(0,1)=='#')){video=$(vars['video'])}if(!video){video=createlVideo();video.attr('width','100%').attr('height','100%');CV.append(video)}if(vars['autoplay']){video.attr('autoplay','autoplay');paused=false}else{video.attr('preload','metadata')}CT.loop=vars['loop'];if(CT.loop){video.attr('loop','loop')}video.volume=vars['volume'];if(vars['controls']){video.controls=true}else{video.controls=false}try{video.attr('controlslist','nodownload');video.attr('x-webkit-airplay','true');video.attr('x5-video-orientation','portraint');video.attr('playsinline','true');video.attr('webkit-playsinline','true');video.attr('x5-playsinline','true');if(vars['crossOrigin']){video.useCORS=true;video.crossOrigin=vars['crossOrigin']}}catch(event){}CT.smallWindows=true;CT.webFull=false;CT.theatre=false;loadFace();if(vars['rotate']>0){player.rotate(vars['rotate'])}if(vars['zoom']>0){player.zoom(vars['zoom'])}if(isUndefined(video.canPlayType)){CT.error={code:5,message:language['error']['supportVideoError']};eventTarget('error',CT.error);showError();return player}addAllListener();if(!isUndefined(vars['loaded'])){if(valType(vars['loaded'])=='function'){try{vars['loaded'](player)}catch(event){}}else if(valType(vars['loaded'])=='string'){try{eval(vars['loaded']+'(player)')}catch(event){}}}changeVideo(vars['video']);return player}function changeVideo(vstr){var i=0;if(video.attr('src')||video.htm()){player.pause()}if(video.attr('src')){video.attr('src','');video.removeAttr('src')}if(!isUndefined(video.textTracks)&&video.textTracks.length>0){for(i=video.find('track').length-1;i>-1;i--){video.find('track').eq(i).remove()}}video.htm('');if(!isUndefined(vars['seek'])&&valType(vars['seek'])=='number'&&vars['seek']>0&&!seekTime){seekTime=vars['seek']}if(!isUndefined(vars['ad'])){ad=vars['ad']}var source='';if(valType(vstr)=='string'){if(vstr.substr(0,8)=='website:'||vstr.substr(0,4)=='url:'){var ajaxUrl='';if(vstr.substr(0,8)=='website:'){ajaxUrl=vstr.substring(8)}if(vstr.substr(0,4)=='url:'){ajaxUrl=vstr.substring(4)}ajax({url:ajaxUrl,success:function(data){if(data!=null){vars=standardization(varsTemp,data);changeVideo(vars['video'])}else{CT.error={code:8,message:language['error']['ajax']};eventTarget('error',CT.error);showError()}}});return}else{if(vars['plug']&&!canPlay(vstr)){plugPlayer(vstr)}else{video.attr('src',vstr)}loadTrack()}}else if(valType(vstr)=='array'){for(i=0;i1){source+=''}}}}if(source){video.htm(source)}loadTrack()}else if(valType(vstr)=='object'){if(vars['plug']){plugPlayer(vstr)}else{CT.error={code:10,message:language['error']['emptied']};eventTarget('error',CT.error);showError()}loadTrack()}if(!isUndefined(video.find('source'))&&video.find('source').length>0){video.find('source').eq(video.find('source').length-1).addListener('error',videoHandler.error)}checkBar();loadLogo();if(isChangeDef){checkDefinition()}}function plugPlayer(url){switch(vars['plug']){case'hls.js':hlsPlayer(url);break;case'flv.js':flvPlayer(url);break;case'mpegts.js':mpegtsPlayer(url);break;case'dash.js':dashPlayer(url);break;default:if(valType(vars['plug'])=='function'){vars['plug'](video,url)}else{CT.error={code:10,message:language['error']['emptied']};eventTarget('error',CT.error);showError()}break}}function hlsPlayer(url){var path=getPath('hls.js')+'hls.min.js';loadJs(path,function(){if(!isUndefined(Hls)&&Hls.isSupported()){hls=new Hls();hls.loadSource(url);hls.attachMedia(video);hls.on(Hls.Events.ERROR,function(event,data){var code=9;var message=language['error']['loadingFailed'];var fatal=data.fatal;if(!isUndefined(data.response)){if(!isUndefined(data.response.code)){code=data.response.code}if(!isUndefined(data.response.text)&&data.response.text){message=data.response.text}else{if(!isUndefined(event)){message=event}}}CT.error={code:code,message:message};eventTarget('error',CT.error);if(fatal){showError()}})}else if(canPlay(url)){video.attr('src',url)}})}function flvPlayer(url){var path=getPath('flv.js')+'flv.min.js';loadJs(path,function(){if(typeof(flvjs)!='undefined'&&!isUndefined(flvjs)&&flvjs.isSupported()){var config={type:'flv',url:url};if(valType(url)=='object'){config=url}if(vars['live']){config['isLive']=true}if(pugPlayer){pugPlayer.pause();pugPlayer.unload();pugPlayer.detachMediaElement();pugPlayer.destroy();pugPlayer=null}pugPlayer=flvjs.createPlayer(config);pugPlayer.attachMediaElement(video);pugPlayer.load();pugPlayer.on(flvjs.Events.METADATA_ARRIVED,function(res){videoHandler.loadedMetaData()});pugPlayer.on(flvjs.Events.ERROR,function(errorType,errorDetail,errorInfo){CT.error={code:errorInfo['code'],message:errorInfo['msg']};eventTarget('error',CT.error);showError()})}})}function mpegtsPlayer(url){var path=getPath('mpegts.js')+'mpegts.js';loadJs(path,function(){if(typeof(mpegts)!='undefined'&&!isUndefined(mpegts)&&mpegts.getFeatureList().mseLivePlayback){var config={type:'mse',url:url};if(valType(url)=='object'){config=url}if(vars['live']){config['isLive']=true}if(pugPlayer){pugPlayer.pause();pugPlayer.unload();pugPlayer.detachMediaElement();pugPlayer.destroy();pugPlayer=null}pugPlayer=mpegts.createPlayer(config);pugPlayer.attachMediaElement(video);pugPlayer.load();pugPlayer.on(mpegts.Events.METADATA_ARRIVED,function(res){videoHandler.loadedMetaData()});pugPlayer.on(mpegts.Events.ERROR,function(errorType,errorDetail,errorInfo){CT.error={code:errorInfo['code'],message:errorInfo['msg']};eventTarget('error',CT.error);showError()})}})}function canPlay(vStr,num){var vTypeArr=[{vidType:'video/ogg',codType:'theora, vorbis'},{vidType:'video/mp4',codType:'avc1.4D401E, mp4a.40.2'},{vidType:'video/mp4',codType:'avc1'},{vidType:'video/mp4',codType:'hevc'},{vidType:'video/webm',codType:'vp8.0, vorbis'},{vidType:'video/webm',codType:'vp9'},{vidType:'',codType:'application/x-mpegURL'},{vidType:'',codType:'application/vnd.apple.mpegurl'}];var vType={ogg:vTypeArr[0],mp4:[vTypeArr[1],vTypeArr[2],vTypeArr[3]],webm:[vTypeArr[4],vTypeArr[5]],m3u8:[vTypeArr[6],vTypeArr[7]]};var arr=[];var k='';var supportType=function(obj){var vType=obj['vidType'];var str='';if(vType){str=vType+'; codecs="'+obj['codType']+'"'}else{str=obj['codType']}var sup=video.canPlayType(str);if(sup==''){sup='no'}return sup};var getExtension=function(filepath){return filepath.replace(/.+\./,'')};if(isUndefined(num)){if(valType(vStr)=='string'){if(vars['type']){for(k in vTypeArr){if(vTypeArr[k]['vidType']==vars['type']){arr.push(vTypeArr[k])}}}else{if(getExtension(vStr)&&getExtension(vStr)in vType){var temp=vType[getExtension(vStr)];if(valType(temp)=='array'){for(var i=0;i0){for(var i=0;i'}if(video){var html=video.htm()+track;video.htm(html)}if(video.find('track')&&!loadedTrack){loadedTrack=true;checkTrack()}}}function loadedMetaData(){eventTarget('loadedMetaData',{width:CK.getWidth(),height:CK.getHeight(),videoWidth:CT.videoWidth,videoHeight:CT.videoHeight,duration:duration,volume:CT.volume});replaceInformation('videoWidth',CT.videoWidth);replaceInformation('videoHeight',CT.videoHeight);replaceInformation('volume',parseInt(CT.volume*100));replaceInformation('duration',parseInt(duration))}var videoHandler={loadStart:function(){if(!vars['controls']&&app!='iphone'){C['loading'].show()}C['centerPlay'].hide();eventTarget('loadstart')},canPlay:function(){C['loading'].hide();eventTarget('canplay')},loadedData:function(){eventTarget('loadeddata')},loadedMetaData:function(){duration=this.duration;if(!isUndefined(this.duration)&&vars['duration']){duration=vars['duration']}if(!vars['live']){C['time'].htm(formatSeconds(this.currentTime)+'/'+formatSeconds(duration));C['tempTime'].htm(formatSeconds(this.currentTime)+'/'+formatSeconds(duration))}C['loading'].hide();if(vars['poster']){video.attr('poster',vars['poster'])}if(!vars['autoplay']&&!vars['controls']){C['centerPlay'].show();C['buffer'].hide()}CT.duration=duration;CT.videoWidth=this.videoWidth;CT.videoHeight=this.videoHeight;CT.volume=this.volume;if(CT.videoWidth||CT.videoHeight||duration){loadedMetaData()}var len=0;if(!isUndefined(this.buffered)){len=this.buffered.length}if(len>0){changeLoad()}if(!vars['live']){changePreview(vars['preview'])}else{changePreview()}if(!isUndefined(vars['prompt'])&&valType(vars['prompt'])=='array'&&!vars['live']){changePrompt()}else{deletePrompt()}if(isChangeDef){checkDefinition();isChangeDef=false}pSliderMouseDown=false;loadedmetadataNum++;if(!isUndefined(ad)&&!isUndefined(ad['frontPlay'])&&ad['frontPlay']&&loadedmetadataNum>1){player.play();calculationAdFrontTime(duration)}if(!isUndefined(ad)&&!isUndefined(ad['frontPlay'])&&!ad['frontPlay']){player.volume(vars['volume']);player.play()}if(!vars['autoplay']&&loadMeta){loadMeta=false;player.pause();setTimeout(player.pause,300)}if('error'in C){C['error'].hide()}},timeUpDate:function(){if(!waited){waited=true;C['buffer'].hide();eventTarget('buffer','end')}var len=this.buffered.length;if(len>0){changeLoad()}if(!duration&&this.duration){duration=this.duration;CT.duration=duration;CT.videoWidth=this.videoWidth;CT.videoHeight=this.videoHeight;if(CT.videoWidth||CT.videoHeight||duration){loadedMetaData()}}oldTime=playTime;playTime=this.currentTime;if(maxSeeTime1){calculationAdFrontTime(duration-playTime)}if(!isUndefined(C['error'])&&C['error'].css('display')=='block'){C['error'].hide()}replaceInformation('audioDecodedByteCount',this.webkitAudioDecodedByteCount||this.audioDecodedByteCount||0);replaceInformation('videoDecodedByteCount',this.webkitVideoDecodedByteCount||this.videoDecodedByteCount||0)},ended:function(){if(!isUndefined(ad)&&!isUndefined(ad['frontPlay'])&&ad['frontPlay']){adFrontEnded()}else{C['bar']['playAndPause']['pause'].hide();C['bar']['playAndPause']['play'].hide();C['bar']['playAndPause']['refresh'].show();eventTarget('ended');showEnded();message()}},error:function(event){if(!isUndefined(event.type)){var errorInfo=this.error;var errorBak=function(){var code=12;var msg=language['error']['loadingFailed'];if(!isUndefined(errorInfo)){if(!isUndefined(errorInfo.code)){code=errorInfo.code}if(!isUndefined(errorInfo.message)){msg=errorInfo.message}CT.error={code:code,message:msg};showError()}else{CT.error={code:code,message:msg};if(event.target.attr('src')){showError()}}eventTarget('error',CT.error)};if(event.type=='error'){try{if(video.currentSrc){ajax({url:video.currentSrc,error:function(info){if(info&&valType(info)=='object'&&'code'in info&&info['code']){CT.error=info;eventTarget('error',CT.error);showError()}else{errorBak()}},success:function(data){if(!data){errorBak()}}})}else{errorBak()}}catch(event){errorBak()}}}},stalled:function(){eventTarget('stalled');CT.error={code:13,message:'load:stalled'};eventTarget('error',CT.error)},suspend:function(){eventTarget('suspend')},emptied:function(){eventTarget('emptied');CT.error={code:7,message:language['error']['emptied']};eventTarget('error',CT.error)},seeked:function(){if(paused){player.play()}pSliderMouseDown=false;eventTarget('seek',{time:this.currentTime,state:'seeked'});eventTarget('seeked')},seeking:function(){if(paused){player.play()}var seekingTime=this.currentTime;if(firstSeekTime==-1){firstSeekTime=seekingTime}switch(vars['timeScheduleAdjust']){case 0:if(oldTime!=seekingTime){waitingMessage=false;player.seek(oldTime);message(language['timeScheduleAdjust']['prohibit']);return}break;case 2:if(seekingTimeoldTime){waitingMessage=false;player.seek(oldTime);message(language['timeScheduleAdjust']['prohibitForward']);return}break;case 4:if(seekingTimemaxSeeTime){waitingMessage=false;player.seek(maxSeeTime);message(language['timeScheduleAdjust']['prohibitForwardNotViewed']);return}break}eventTarget('seek',{time:seekingTime,state:'seeking'});eventTarget('seeking');if(!vars['live']){C['time'].htm(formatSeconds(seekingTime)+'/'+formatSeconds(duration));C['tempTime'].htm(formatSeconds(seekingTime)+'/'+formatSeconds(duration))}},waiting:function(){waited=false;eventTarget('buffer','start');C['centerPlay'].hide();if(!vars['controls']){C['buffer'].show()}if(!waitingMessage){waitingMessage=true}else{message(language['waiting'])}},play:function(){paused=false;C['bar']['playAndPause']['play'].hide();C['bar']['playAndPause']['pause'].show();C['bar']['playAndPause']['refresh'].hide();C['centerPlay'].hide();if(playType=='button'){C['bar']['pbox'].removeClass('ck-bar-progress-out')}else{C['bar']['pbox'].addClass('ck-bar-progress-out')}hideBar();closePauseAd();playType='';if(!isUndefined(C['ended'])){player.closeLayer(C['ended'])}if('error'in C){C['error'].hide()}eventTarget('play');if(!isUndefined(ad)){if(!isUndefined(ad['front'])){if(isUndefined(ad['frontPlay'])){ad['frontPlayI']=0;ad['frontPlay']=true;player.pause();adFrontPlay();return}}}if(seekTime&&(isUndefined(vars['live'])||(!isUndefined(vars['live'])&&valType(vars['live'])=='boolean'&&!vars['live']))){player.seek(seekTime);seekTime=0}},pause:function(){paused=true;if(isUndefined(ad)||isUndefined(ad['frontPlay'])||(!isUndefined(ad['frontPlay'])&&!ad['frontPlay'])){if(!isUndefined(ad)&&!isUndefined(ad['pause'])){if(isUndefined(ad['pausePlayI'])){ad['pausePlayI']=0}adPausePlay()}else{if(!vars['controls']){C['centerPlay'].show();C['buffer'].hide()}}}else{if(!vars['controls']){C['centerPlay'].show();C['buffer'].hide()}}C['bar']['playAndPause']['pause'].hide();C['bar']['playAndPause']['play'].show();C['bar']['playAndPause']['refresh'].hide();C['bar']['pbox'].removeClass('ck-bar-progress-out');checkProgressSlider();eventTarget('pause');C['bar'].removeClass('ck-bar-out');CM.removeClass('ck-nocursor')},volumeChange:function(){if(this.volume==0&&!mutedState){this.muted=true}if(this.volume>0&&mutedState){this.muted=false}if(mutedState!=this.muted){mutedState=this.muted;changeMuted(this.muted);CT.muted=this.muted;eventTarget('muted',CT.muted)}CT.volume=this.volume;eventTarget('volume',this.volume);if(!isUndefined(C['bar']['vbox'])){var vol=parseInt(this.volume*100);C['bar']['vbox']['volume']['txt'].htm(vol);if(!C['bar']['vbox']['mouseDown']){changeVolumeSlider(this.muted?0:this.volume)}if(!this.muted){message(language['volume']+vol+'%')}}replaceInformation('volume',parseInt(this.volume*100))},resize:function(){var fullState=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen||document.msFullscreenElement;if(fullState){C['bar']['fullAndExit']['exitFull'].show();C['bar']['fullAndExit']['full'].hide();C['ad']['bottom']['fullAndExit']['exitFull'].show();C['ad']['bottom']['fullAndExit']['full'].hide();if(!CM.hasClass('ck-main-full')){CM.addClass('ck-main-full')}message(language['full']);C['bar']['webFullAndExit'].hide();C['bar']['theatreAndExit'].hide();if(!isUndefined(C['menu'])){CM.append(C['menu'])}}else{fullState=false;C['bar']['fullAndExit']['full'].show();C['bar']['fullAndExit']['exitFull'].hide();C['ad']['bottom']['fullAndExit']['full'].show();C['ad']['bottom']['fullAndExit']['exitFull'].hide();if(CM.hasClass('ck-main-full')){CM.removeClass('ck-main-full')}if(!isUndefined(vars['webFull'])&&vars['webFull']){C['bar']['webFullAndExit'].show()}if(!isUndefined(vars['theatre'])&&!CT.webFull){C['bar']['theatreAndExit'].show()}if(!isUndefined(C['menu'])){$('body').append(C['menu'])}if(CV.css('width')!=CM.css('width')){player.zoom(100)}}if(CT.full!=fullState){CT.full=fullState;eventTarget('full',fullState)}checkVideoRotate();changeProgress(player.time())},keydown:function(e){var keycode=e.keyCode||e.which;var v=player.volume();switch(keycode){case 32:e=window.event||event;if(e.preventDefault){e.preventDefault()}else{window.event.returnValue=false}player.playOrPause();break;case 37:player.fastBack();break;case 39:player.fastNext();break;case 38:player.volume(v+.1<1?v+=.1:1);break;case 40:player.volume(v-.1>0?v-=.1:0);break;default:break}}};function adFrontPlay(){if(ad['frontPlayI']==0){allBarHide(false);C['ad'].show();ad['front']['video']=false;if(!isUndefined(ad['front']['closeTime'])){if(ad['front']['closeTime']>0){C['ad']['top']['closeTime'].show();adFrontCloseTime()}else{C['ad']['top']['closeAd'].show()}}}if(!isUndefined(ad['front']['node'])&&ad['front']['node']!=null){CM.append(ad['front']['node']);player.closeLayer(ad['front']['node']);ad['front']['node']=null}C['ad']['picture'].htm('');C['ad']['picture'].hide();C['ad']['link'].hide();if(!isUndefined(ad['front']['list'][ad['frontPlayI']])){var adv=ad['front']['list'][ad['frontPlayI']];frontAdPlay=true;eventTarget('frontAd',adv);if(adv['type']=='picture'){adPicturePlay(adv)}else if(adv['type']=='node'){adNode(adv)}else{C['ad']['link'].attr('data-link',adv['link']);adVideoPlay(adv['file'])}if(!isUndefined(adv['link'])){C['ad']['bottom']['details'].show();C['ad']['bottom']['details'].htm(''+language['details']+'')}else{C['ad']['bottom']['details'].hide()}}}function adFrontCloseTime(){if(!isUndefined(ad['front']['closeSetTime'])){clearTimeout(ad['front']['closeSetTime']);ad['front']['closeSetTime']=null}C['ad']['top']['closeTime'].htmReplace('{seconds}',ad['front']['closeTime'],language['closeTime']);ad['front']['closeTime']--;if(ad['front']['closeTime']>0){ad['front']['closeSetTime']=setTimeout(adFrontCloseTime,1000)}else{C['ad']['top']['closeAd'].show();C['ad']['top']['closeTime'].hide()}}function calculationAdFrontTime(t){if(!isUndefined(t)){ad['front']['list'][ad['frontPlayI']]['time']=t}ad['front']['countDown']=0;for(var i=ad['frontPlayI'];i0){adv['time']--;ad['front']['countDown']--;C['ad']['top']['countDown'].htm(ad['front']['countDown']+language['second']);adFrontSetTime=setTimeout(adFrontCountDown,1000)}else{adFrontEnded()}}function adFrontEnded(){if(ad['frontPlayI']0||h>0){if(adv['link']){var a=createlA('',adv['link']);a.append(this);C['ad']['picture'].append(a)}else{C['ad']['picture'].append(this)}img.unbind();img.click(function(){eventTarget('frontAdClick',adv)})}else{if(imgloadNum<10){imgloadNum++;imgLoadHandler()}}})};imgLoadHandler();calculationAdFrontTime();adFrontCountDown();C['ad']['bottom']['mutedAndExit'].hide()}function adNode(adv){if(isUndefined(adv['content']))return;ad['front']['node']=player.layer(adv);ad['front']['node'].css({'z-index':1});C['ad'].append(ad['front']['node']);ad['front']['node'].unbind();ad['front']['node'].click(function(){eventTarget('frontAdClick',adv)});calculationAdFrontTime();adFrontCountDown();C['ad']['bottom']['mutedAndExit'].hide()}function frontVideoClickHandler(){var url=C['ad']['link'].attr('data-link');window.open(url,'_blank')}function closeFrontAd(){if(!isUndefined(ad)&&!isUndefined(ad['front'])&&!isUndefined(ad['front']['closeButtonClick'])){if(valType(ad['front']['closeButtonClick'])=='function'){try{ad['front']['closeButtonClick']()}catch(event){console.error(event)}}else if(valType(ad['front']['closeButtonClick'])=='string'){try{eval(ad['front']['closeButtonClick']+'()')}catch(event){console.error(event)}}}else{player.closeFrontAd()}}function adPausePlay(){closePauseAd();if(!isUndefined(ad)&&!isUndefined(ad['pause'])&&!isUndefined(ad['pause']['list'])&&ad['pause']['list'].length-1>=ad['pausePlayI']){var adv=ad['pause']['list'][ad['pausePlayI']];if(!isUndefined(ad['pause']['close'])&&ad['pause']['close']){ad['pauseClose']=createlButton('ck-pause-close');ad['pauseClose'].click(function(){C['centerPlay'].show();C['buffer'].hide();closePauseAd()})}if(!isUndefined(adv['file'])){var img=null;var imgloadNum=0;var imgLoadHandler=function(){img=createlImg(adv['file']);C['adPause'].show();C['adPause'].htm('');C['adPause'].append(img);img.addListener('load',function(){var w=this.getWidth(),h=this.getHeight();if(w>0||h>0){C['adPause'].htm('');if(adv['link']){var a=createlA('',adv['link']);a.append(this);C['adPause'].append(a)}else{C['adPause'].append(this)}C['adPause'].css({'width':w+'px','height':h+'px'});if(ad['pauseClose']){C['adPause'].append(ad['pauseClose'])}img.click(function(){eventTarget('pauseAdClick',adv)})}else{if(imgloadNum<10){imgloadNum++;imgLoadHandler()}}})};imgLoadHandler()}else if(!isUndefined(adv['content'])){ad['pause']['node']=player.layer(adv);if(ad['pauseClose']){ad['pause']['node'].append(ad['pauseClose'])}ad['pause']['node'].click(function(){eventTarget('pauseAdClick',adv)})}eventTarget('pauseAd',adv);if(!isUndefined(adv['time'])&&adv['time']>0){adPauseSetTime=setTimeout(function(){ad['pausePlayI']++;if(ad['pausePlayI']>ad['pause']['list'].length-1){ad['pausePlayI']=0}adPausePlay()},adv['time']*1000)}}}function closePauseAd(){if(adPauseSetTime){clearTimeout(adPauseSetTime);adPauseSetTime=null}C['adPause'].hide();if(!isUndefined(ad)&&!isUndefined(ad['pauseClose'])&&ad['pauseClose']!=null){ad['pauseClose'].remove();ad['pauseClose']=null}if(!isUndefined(ad)&&!isUndefined(ad['pause'])&&!isUndefined(ad['pause']['node'])&&ad['pause']['node']){ad['pause']['node'].unbind();player.closeLayer(ad['pause']['node']);eventTarget('pauseAdClose')}}var player={width:function(value){if(!isUndefined(value)){if(valType(value)=='number'){value+='px'}CT.css({'width':value});checkVideoRotate()}return CK.getWidth()},height:function(value){if(!isUndefined(value)){if(valType(value)=='number'){value+='px'}CT.css({'height':value});checkVideoRotate()}return CK.getHeight()},videoWidth:function(){if(video){return video.videoWidth}return null},videoHeight:function(){if(video){return video.videoHeight}return null},zoom:function(fn){if(!isUndefined(fn)){if(valType(fn)=='function'){newEvent.addEventListener('zoom',fn)}if(valType(fn)=='number'){var arr=[C['topBar']['zoomEle']['zoom50'],C['topBar']['zoomEle']['zoom75'],C['topBar']['zoomEle']['zoom100']];for(var i=0;ifn&&fn>0){rot=arr[fn]}else{if(arr.indexOf(fn)>-1){rot=fn}}if(rot!=nowRotate){eventTarget('rotate',rot);nowRotate=rot;checkVideoRotate()}}}},vars:function(obj,val){if(isUndefined(obj)){return}if(valType(obj)=='string'&&!isUndefined(val)){var temp={};temp[obj]=val;obj=temp}var isChange=false;for(var k in obj){if(k in vars&&obj[k]!=vars[k]){isChange=true;break}}if(isChange){vars=standardization(vars,obj)}if(!isUndefined(obj['video'])){isChangeDef=true;changeVideo(vars['video'])}if(!isUndefined(obj['title'])){C['topBar']['titleEle'].htm(obj['title'])}},loadstart:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('loadstart',fn)}},loadeddata:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('loadeddata',fn)}},loadedMetaData:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('loadedMetaData',fn)}},canplay:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('canplay',fn)}},play:function(fn){if(valType(fn)=='object'){if(fn['target']==C['bar']['playAndPause']['play']||fn['target']==C['bar']['playAndPause']['refresh']){playType='button'}}if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('play',fn)}else{if(loadedmetadataNum>0&&video){try{video.play()}catch(event){console.error(event)}}}return player},pause:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('pause',fn)}else{if(loadedmetadataNum>0&&video){try{video.pause()}catch(event){console.error(event)}}}return player},playOrPause:function(){if(paused){player.play()}else{player.pause()}return player},volume:function(fn){if(!isUndefined(fn)){if(valType(fn)=='function'){newEvent.addEventListener('volume',fn)}else if(valType(fn)=='number'&&video){if(fn<0)fn=0;if(fn>1)fn=1;if(video.muted){video.volume=fn*.5}video.volume=fn}}else if(video){return video.volume}return player},muted:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('muted',fn)}else if(video){video.muted=true}return player},exitMuted:function(){if(video){video.muted=false;if(video.volume==0){player.volume(.8)}}return player},time:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('time',fn)}else if(video){return video.currentTime||0}},seek:function(fn){if(!isUndefined(fn)){if(valType(fn)=='function'){newEvent.addEventListener('seek',fn)}if(valType(fn)=='number'&&video){switch(vars['timeScheduleAdjust']){case 0:message(language['timeScheduleAdjust']['prohibit']);return;break;case 1:break;case 2:if(fnoldTime){message(language['timeScheduleAdjust']['prohibitForward']);return}break;case 4:if(fnmaxSeeTime){waitingMessage=false;video.currentTime=maxSeeTime;message(language['timeScheduleAdjust']['prohibitForwardNotViewed']);return}break}pSliderMouseDown=false;video.currentTime=fn}}return player},buffer:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('buffer',fn)}return player},ended:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('ended',fn)}return player},error:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('error',fn)}return player},emptied:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('emptied',fn)}return player},duration:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('duration',fn)}else{return duration||0}},playbackRate:function(fn){if(!isUndefined(fn)){if(valType(fn)=='function'){newEvent.addEventListener('playbackRate',fn)}else if(valType(fn)=='number'&&video){video.playbackRate=fn;CT.playbackRate=fn;eventTarget('playbackRate',fn);changePlaybackrateVal(fn)}}else{return video.playbackRate}},track:function(fn){if(!isUndefined(fn)){if(valType(fn)=='function'){newEvent.addEventListener('track',fn)}else if(valType(fn)=='number'&&video){var track=null;if(!isUndefined(video.textTracks)){track=video.textTracks}if(track&&valType(track)=='texttracklist'){var arr=vars['track'];for(var i=track.length-1;i>-1;i--){video.find('track').eq(i).remove()}for(var i=0;i'}if(video){var html=video.htm()+track;video.htm(html)}changeTrackVal(fn)}}}else{return CT.track}},fastBack:function(num){if(duration==0)return;if(isUndefined(num)||valType(num)!='number'){num=20}var time=player.time();if(time-num>0){time-=num}else{time=0}player.seek(time);return player},fastNext:function(num){if(duration==0)return;if(isUndefined(num)||valType(num)!='number'){num=20}var time=player.time();if(time+num200)zIndex=200;if(isUndefined(ele.cssDisplay)){ele.cssPosition=ele.css('position');ele.cssDisplay=ele.css('display')}ele.css({'position':'absolute','z-index':zIndex});if(!cBar){CM.append(ele)}else{C['bar'].append(ele)}ele.CK=CK;ele.show()}return ele},closeLayer:function(ele){if(valType(ele)=='string'){var temp=$(ele);if(!isUndefined(temp)){if(temp.length>0){ele=temp.eq(0)}}}if(!isUndefined(ele)&&valType(ele)=='htmlobject'){if(!isUndefined(ele.captureParentNode)){var eleP=ele.captureParentNode;if(ele.nextElement){try{eleP.insertBefore(ele,ele.nextElement)}catch(event){eleP.append(ele)}}else if(ele.prevElement){try{eleP.insertAfter(ele,ele.prevElement)}catch(event){eleP.append(ele)}}else{eleP.append(ele)}ele.css({'display':ele.cssDisplay})}else{ele.remove()}if(!isUndefined(ele.cssDisplay)){ele.css({'display':ele.cssDisplay,'position':ele.cssPosition})}}return player},message:function(str){message(str);return player},closeFrontAd:function(){if(frontAdPlay&&!isUndefined(ad)&&!isUndefined(ad['front'])&&!isUndefined(ad['front']['list'])){ad['frontPlayI']=ad['front']['list'].length-1;adFrontEnded();clearAdFrontSetTime()}return player},addListener:function(name,fn){newEvent.addEventListener(name,fn)},removeListener:function(name,fn){newEvent.removeEventListener(name,fn)},bar:function(bool){barShow=bool;if(bool){C['bar'].show()}else{C['bar'].hide()}},rightBar:function(bool){rightBarShow=bool;if(bool){C['rightBar'].show()}else{C['rightBar'].hide()}},mouseActive:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('mouseActive',fn)}return this},remove:function(){var eventTemp={};if(eventTargetList!=null){for(var k in eventTargetList){eventTemp[k]=eventTargetList[k]}for(var k in eventTemp){var temp=eventTemp[k];if(temp){for(var i=0;i-1;i--){var pTemp=createlButton('ck-list-p',playbackrate[i]+language['playbackrateSuffix']);pTemp.attr('data-i',i).attr('data-val',playbackrate[i]);C['bar']['playbackrate']['bg']['p'].push(pTemp);C['bar']['playbackrate']['bg'].append(pTemp);pTemp.click(playbackrateClick)}C['bar']['playbackrate'].hide();if(!isUndefined(vars['playbackrateOpen'])&&vars['playbackrateOpen']){C['bar']['playbackrate'].show();C['bar']['playbackrate']['bgbox'].show();var w=C['bar']['playbackrate']['bg'].getWidth(),h=C['bar']['playbackrate']['bg'].getHeight();var bw=C['bar']['playbackrate']['button'].getWidth();C['bar']['playbackrate']['bg'].css({'width':w+10+'px'});w=C['bar']['playbackrate']['bg'].getWidth();if(getBarHeight()>C['bar'].getHeight()){h+=(getBarHeight()-C['bar'].getHeight())}C['bar']['playbackrate']['bgbox'].attr('style','');C['bar']['playbackrate']['bgbox'].css({'width':w+'px','height':(h+2)+'px','left':-(w-bw)*0.5+'px'});C['bar']['playbackrate']['button'].mouseover(function(){w=C['bar']['playbackrate']['bg'].getWidth();bw=C['bar']['playbackrate']['button'].getWidth();C['bar']['playbackrate']['bgbox'].css({'left':-(w-bw)*0.5+'px'})});changePlaybackrateVal(pbr)}}function playbackrateClick(e){C['bar']['playbackrate']['bgbox'].hide();setTimeout(function(){C['bar']['playbackrate']['bgbox'].removeCss('display')},300);message(language['switchTo']+$(this).htm());player.playbackRate(parseFloat($(this).attr('data-val')))}function changePlaybackrateVal(num){C['bar']['playbackrate']['bg'].find('button').each(function(index,ele){var val=parseFloat(ele.attr('data-val'));ele.removeClass('ck-list-p-focus');if(num==val){ele.addClass('ck-list-p-focus');if(num!=1){C['bar']['playbackrate']['button'].htm(ele.htm())}else{C['bar']['playbackrate']['button'].htm(language['playbackrate'])}}else{ele.removeClass('ck-list-p-focus')}})}function checkTrack(){var track=vars['track'];var pbr=-1;C['bar']['track']['bgbox'].htm('');C['bar']['track']['bg']=createlDiv('ck-list-bg');C['bar']['track']['bgbox'].append(C['bar']['track']['bg']);C['bar']['track']['bg']['p']=[];var pTemp=null;for(var i=track.length-1;i>-1;i--){pTemp=createlButton('ck-list-p',track[i]['label']);pTemp.attr('data-i',i).attr('data-title',track[i]['label']);C['bar']['track']['bg']['p'].push(pTemp);C['bar']['track']['bg'].append(pTemp);if(!isUndefined(track[i]['default'])&&track[i]['default']){pbr=i}pTemp.click(trackClick)}pTemp=createlButton('ck-list-p',language['noTrack']);pTemp.attr('data-i',-1).attr('data-title',language['noTrack']);C['bar']['track']['bg']['p'].push(pTemp);C['bar']['track']['bg'].append(pTemp);pTemp.click(trackClick);C['bar']['track'].hide();C['bar']['track'].show();C['bar']['track']['bgbox'].show();var w=C['bar']['track']['bg'].getWidth(),h=C['bar']['track']['bg'].getHeight();var bw=C['bar']['track']['button'].getWidth();C['bar']['track']['bg'].css({'width':w+10+'px'});w=C['bar']['track']['bg'].getWidth();if(getBarHeight()>C['bar'].getHeight()){h+=(getBarHeight()-C['bar'].getHeight())}C['bar']['track']['bgbox'].attr('style','');C['bar']['track']['bgbox'].css({'width':w+'px','height':(h+2)+'px','left':-(w-bw)*0.5+'px'});C['bar']['track']['button'].mouseover(function(){w=C['bar']['track']['bg'].getWidth();bw=C['bar']['track']['button'].getWidth();C['bar']['track']['bgbox'].css({'left':-(w-bw)*0.5+'px'})});changeTrackVal(pbr)}function trackClick(e){C['bar']['track']['bgbox'].hide();setTimeout(function(){C['bar']['track']['bgbox'].removeCss('display')},300);message(language['switchTo']+$(this).attr('data-title'));player.track(parseFloat($(this).attr('data-i')))}function changeTrackVal(num){C['bar']['track']['bg'].find('button').each(function(index,ele){var i=parseInt(ele.attr('data-i'));if(num==i){C['bar']['track']['button'].htm(ele.attr('data-title'));if(i>-1){CT.track=vars['track'][i];eventTarget('track',vars['track'][i])}else{CT.track=null;eventTarget('track',null)}ele.addClass('ck-list-p-focus')}else{ele.removeClass('ck-list-p-focus')}})}function checkDefinition(){var pi=-1;var videoUrl=video['currentSrc'];if(!isUndefined(C['bar']['definition']['bg'])){C['bar']['definition']['bgbox'].htm('');C['bar']['definition']['bgbox'].attr('style','');C['bar']['definition']['button'].htm(language['definition'])}if(valType(vars['video'])=='array'){var arr=vars['video'];C['bar']['definition']['bg']=createlDiv('ck-list-bg');C['bar']['definition']['bgbox'].append(C['bar']['definition']['bg']);C['bar']['definition']['bg']['p']=[];for(var i=arr.length-1;i>-1;i--){var pTemp=createlButton('ck-list-p',arr[i][2]);pTemp.attr('data-i',i).attr('data-video',arr[i][0]).attr('data-type',arr[i][1]).attr('data-title',arr[i][2]);C['bar']['definition']['bg']['p'].push(pTemp);C['bar']['definition']['bg'].append(pTemp);if(videoUrl&&videoUrl.indexOf(arr[i][0])>-1){pi=i}pTemp.click(definitionClick)}C['bar']['definition'].show();C['bar']['definition']['bgbox'].show();var w=C['bar']['definition']['bg'].getWidth(),h=C['bar']['definition']['bg'].getHeight();var bw=C['bar']['definition']['button'].getWidth();C['bar']['definition']['bg'].css({'width':w+10+'px'});w=C['bar']['definition']['bg'].getWidth();if(getBarHeight()>C['bar'].getHeight()){h+=(getBarHeight()-C['bar'].getHeight())}C['bar']['definition']['bgbox'].attr('style','');C['bar']['definition']['bgbox'].css({'width':w+'px','height':(h+2)+'px','left':-(w-bw)*0.5+'px'});C['bar']['definition']['button'].mouseover(function(){w=C['bar']['definition']['bg'].getWidth();bw=C['bar']['definition']['button'].getWidth();C['bar']['definition']['bgbox'].css({'left':-(w-bw)*0.5+'px'})})}if(pi>-1){C['bar']['definition']['bg'].find('button').each(function(index,ele){var i=parseInt(ele.attr('data-i'));if(pi==i){ele.addClass('ck-list-p-focus')}else{ele.removeClass('ck-list-p-focus')}})}}function definitionClick(e){C['bar']['definition']['bgbox'].hide();setTimeout(function(){C['bar']['definition']['bgbox'].removeCss('display')},300);changeDefinition(parseInt($(this).attr('data-i')))}function changeDefinition(num){C['bar']['definition']['bg'].find('button').each(function(index,ele){var i=parseInt(ele.attr('data-i'));if(num==i){if(!isUndefined(video.textTracks)&&video.textTracks.length>0){for(var y=video.find('track').length-1;y>-1;y--){video.find('track').eq(y).remove()}}seekTime=player.time();video.attr('autoplay','autoplay');changeVideo(ele.attr('data-video'));message(language['switchTo']+ele.htm());C['bar']['definition']['button'].htm(ele.htm());ele.addClass('ck-list-p-focus');eventTarget('definition',{id:i,video:ele.attr('data-video'),title:ele.attr('data-title')})}else{ele.removeClass('ck-list-p-focus')}})}function deletePrompt(){var i=0;if(!isUndefined(C['prompt'])&&valType(C['prompt'])=='array'){for(i=C['prompt'].length;i>-1;i--){if(!isUndefined(C['prompt'][i])){C['prompt'][i].remove()}}C['prompt']=null}C['prompt']=[]}function changePrompt(){deletePrompt();for(var i=0;i100)left=100;ele.css({'left':left+'%'});ele.mouseover(function(){if(this.attr('data-words')){showPromptWords(this)}});ele.mouseout(function(){if(this.attr('data-words')){showPromptWords()}});C['prompt'].push(ele)}}}function showPromptWords(ele){if(isUndefined(C['promptWords'])){C['promptWords']=createlDiv('ck-prompt-words');CM.append(C['promptWords']);C['promptWords']['content']=createlDiv('ck-prompt-content');C['promptWords'].append(C['promptWords']['content'])}if(isUndefined(ele)){C['promptWords']['content'].htm('');C['promptWords'].hide();return}C['promptWords']['content'].htm(ele.attr('data-words'));C['promptWords'].show();var pW=C['promptWords'].getWidth(),pH=C['promptWords'].getHeight();var bg=C['bar']['pbox']['bg'];var time=parseFloat(ele.attr('data-time'));var top=CK.getHeight()-getBarHeight();var left=ele.offset()['left']-CK.offset()['left']+ele.getWidth()*.5-pW*.5;if(!isUndefined(C['preview'])){top=CK.getHeight()-parseFloat((getBarHeight()+C['preview']['smallHight']+parseInt(C['preview'].css('margin-bottom'))))}else{top=CK.getHeight()-parseFloat((getBarHeight()+C['tip']['minHeight']+parseInt(C['tip'].css('margin-bottom'))));top-=(getBarHeight()-C['bar'].getHeight())}top-=parseFloat(C['promptWords'].css('margin-bottom'));top-=pH;left-=parseFloat(C['promptWords'].css('margin-right'));if(left<0)left=0;if(left>CK.getWidth()-pW)left=CK.getWidth()-pW;C['promptWords'].css({'top':top+'px','left':left+'px'})}function changePreview(preview){if(!isUndefined(C['preview'])){C['preview'].remove();C['preview']=null}if(!isUndefined(preview)){C['preview']=createlDiv('ck-preview');CM.append(C['preview']);if(isUndefined(vars['preview']['type'])){vars['preview']['type']=0}if(vars['preview']['type']==1){C['preview']['bg']=createlDiv('ck-preview-bg');C['preview'].append(C['preview']['bg'])}var files=[];var loadImg=function(bigW,bigH,smallW,smallH){if(vars['preview']['type']==1){C['preview']['bg']['img']=[];for(var i=0;i1){if(valType(vars['preview']['thumbnail'][0])=='number'){thumbnail[0]=vars['preview']['thumbnail'][0]}if(valType(vars['preview']['thumbnail'][1])=='number'){thumbnail[1]=vars['preview']['thumbnail'][1]}vars['preview']['thumbnail']=thumbnail}if(files[0]){var img=createlImg(files[0],'ck-preview-load-img').addListener('load',function(){loadImg(this.getWidth(),this.getHeight(),this.getWidth()/thumbnail[0],this.getHeight()/thumbnail[1]);this.remove()});CM.append(img)}}else{C['preview'].removeChild();C['preview']=null}}else{C['preview'].removeChild();C['preview']=null}}}function showPreview(time){if(hidePreviewSetTime){clearTimeout(hidePreviewSetTime);hidePreviewSetTime=null}if(time<0){if(!isUndefined(C['preview'])){hidePreviewSetTime=setTimeout(function(){C['preview'].hide();hidePreviewSetTime=null},200);return}}if(!isUndefined(C['preview'])&&!isUndefined(vars['preview']['thumbnail'])&&duration>0){if(isUndefined(vars['preview']['type'])){vars['preview']['type']=0}var scale=2,thumbnail=vars['preview']['thumbnail'];if(!isUndefined(vars['preview']['scale'])){scale=vars['preview']['scale']}var divI=0,imgI=0;var left=0,frameLeft=0;var pW=0;var smallW=C['preview']['smallWidth'],smallH=C['preview']['smallHight'];var bgXw=time*C['bar']['pbox']['bg'].getWidth()/duration+(C['bar']['pbox']['bg'].offset()['left']-CK.offset()['left']);if(C['preview'].css('display')=='none'){C['preview'].show()}C['preview'].css({'height':smallH+'px',});if(vars['preview']['type']==1){divI=parseInt(time/(scale*thumbnail[0]));imgI=parseInt(time/scale);var minI=divI-5,maxI=divI+5;if(minI<0)minI=0;if(maxI>C['preview']['bg']['img'].length-1){maxI=C['preview']['bg']['img'].length-1}for(var i=minI;iC['preview'].getWidth()-C['preview']['frame'].getWidth()){var xz=frameLeft-(C['preview'].getWidth()-C['preview']['frame'].getWidth());frameLeft=C['preview'].getWidth()-C['preview']['frame'].getWidth();left-=xz}C['preview']['bg'].css({'left':left+'px'});C['preview']['frame'].css({'left':frameLeft+'px'})}else{var temp=(time/scale)/(thumbnail[0]*thumbnail[1]);imgI=parseInt(temp);var smallI=parseInt((temp-imgI)*100);var rows=parseInt(smallI/thumbnail[0]);var column=smallI%thumbnail[0];var files=vars['preview']['file'];left=bgXw-smallW*.5;if(left<0){left=0}if(left>CK.getWidth()-smallW){left=CK.getWidth()-smallW}C['preview'].css({'width':C['preview']['smallWidth']+'px','background':'url('+files[imgI]+') no-repeat','background-position':'-'+column*smallW+'px -'+rows*smallH+'px','left':left+'px'})}}}function showError(){C['loading'].hide();if(vars['controls']){return}if(isUndefined(C['error'])){C['error']=createlDiv('ck-error');CM.append(C['error'])}var msg=CT.error['message'];if(!msg)msg=language['error']['noMessage'];var html=msg+'(code:'+CT.error['code']+')';C['error'].htm(html);C['error'].show()}function showWindowsError(error){var ele=createlDiv('ckplayer-error',error);$('body').append(ele)}function showNextEpisode(){if(isUndefined(vars['next']))return;if(valType(vars['next'])=='object'){if('content'in vars['next']){C['next']=player.layer(vars['next']);return}if('title'in vars['next']){tip(C['bar']['nextEpisode'],vars['next']['title']);return}}tip(C['bar']['nextEpisode'],language['next'])}function nextClick(){if(valType(vars['next'])=='object'){if('link'in vars['next']){window.location.href=vars['next']['link']}}}function showEnded(){if(!CT.loop&&!isUndefined(vars['ended'])){closePauseAd();C['ended']=player.layer(vars['ended']);if(C['ended']){C['centerPlay'].hide()}return}}function windowScroll(){if(!CT.smallWindows)return;if(CT.webFull||CT.theatre||CT.full){exitSmallWindows();return}var scrollTop=document.documentElement.scrollTop||document.body.scrollTop;if(scrollTop>CT.offset()['top']+CT.getHeight()){if(!CK.hasClass('ckplayer-ckplayer-smallwindow')){CK.addClass('ckplayer-ckplayer-smallwindow');eventTarget('smallWindows',true);smallWindowsState=true;if(vars['smallWindowsDrag']){drag(true)}allBarHide();checkVideoRotate()}}else{exitSmallWindows()}}function exitSmallWindows(){if(CK.hasClass('ckplayer-ckplayer-smallwindow')){CK.removeClass('ckplayer-ckplayer-smallwindow');if(vars['smallWindowsDrag']){drag()}eventTarget('smallWindows',false);smallWindowsState=false;allBarShow();checkVideoRotate()}}function drag(state){var doc=$(document);var posX=0,posY=0,posXRecord=0,posYRecord=0;var open=false;if(!isUndefined(state)){open=state}var mouseDown=function(e){e.preventDefault&&e.preventDefault();e=e||window.event;var client=getClient(e);posXRecord=client['x'];posYRecord=client['y'];doc.mousemove(docMouseMove);doc.mouseup(docMouseUp);CK.css({'cursor':'move'})};var docMouseMove=function(e){e=e||window.event;var client=getClient(e);var eleOffset=CK.offset();posY=client['y']-posYRecord;posX=client['x']-posXRecord;posXRecord=client['x'];posYRecord=client['y'];var left=eleOffset['left']+posX;var top=eleOffset['top']+posY;CK.css({'left':left+'px','top':top+'px'});if(CK.css('position')!='fixed'){CK.css({'position':'fixed'})}isDrag=true};var docMouseUp=function(){doc.removeListener('mousemove',docMouseMove);doc.removeListener('mouseup',docMouseUp);CK.css({'cursor':'default'})};if(open){CK.mousedown(mouseDown)}else{CK.unbind('mousedown')}};function checkVideoRotate(){var ckW=CK.getWidth()*nowZoom*0.01,ckH=CK.getHeight()*nowZoom*0.01;var vW=CV.getWidth(),vH=CV.getHeight();CV.css({'transform':'rotate('+nowRotate+'deg)','-ms-transform':'rotate('+nowRotate+'deg)','-moz-transform':'rotate('+nowRotate+'deg)','-webkit-transform':'rotate('+nowRotate+'deg)','-o-transform':'rotate('+nowRotate+'deg)','width':nowZoom+'%','height':nowZoom+'%'});if(nowRotate!=0&&nowRotate!=180){if(vH>ckW&&vW>ckH){if(vH/ckW>vW/ckH){CV.css({'height':nowZoom+'%','width':ckH+'px'})}else{CV.css({'width':nowZoom+'%','height':ckW+'px'})}return}if(vHckH){CV.css({'height':nowZoom+'%','width':ckH+'px'})}else{if(vH/vW>=ckW/ckH){CV.css({'width':nowZoom+'%','height':ckW+'px'})}else{CV.css({'height':nowZoom+'%','width':ckH+'px'})}}return}if(vH>=ckW&&vW<=ckH){CV.css({'width':nowZoom+'%','height':ckW+'px'});return}if(vW>=ckH&&vHC['bar'].getHeight()){top-=(getBarHeight()-C['bar'].getHeight())}if(w>ew){left=offset['left']-ckOffset['left']-(w-ew)*.5}else{left=offset['left']-ckOffset['left']+(ew-w)*.5}if(align=='left'){left=offset['left']-ckOffset['left']-w;top=offset['top']-ckOffset['top']}if(!isUndefined(cl)){left=cl['x']-ckOffset['left']-w*.5}if(left<0){left=0}if(top<0){top=0}if(left>CM.getWidth()-w){left=CM.getWidth()-w}if(top>CM.getHeight()-h){top=CM.getHeight()-h}C['tip'].css({'left':left+'px','top':top-parseInt(C['tip'].css('margin-bottom'))+'px'})}function progressDragX(){var bg=C['bar']['pbox']['bg'],play=C['bar']['pbox']['play'],slider=C['bar']['pbox']['slider'],mouseLine=C['bar']['pbox']['mouseLine'];slider.unbind();bg.unbind();var pos=0,posRecord=0;var doc=$(document);var sliderDownTime=0;var sliderMouseDown=function(e){e.preventDefault&&e.preventDefault();if(!vars['timeScheduleAdjust']){return}e=e||window.event;var eleOffset=slider.offset(),bgOffset=bg.offset(),client=getClient(e);pSliderMouseDown=true;posRecord=client['x'];var left=eleOffset['left']-bgOffset['left'];sliderDownTime=left*duration/(bg.getWidth()-slider.getWidth());slider.removeListener('mousedown',sliderMouseDown);slider.removeListener('touchstart',sliderMouseDown);doc.mousemove(docMouseMove);doc.mouseup(docMouseUp);slider.touchmove(docMouseMove);slider.touchend(docMouseUp);noScrolling(true)};var docMouseMove=function(e){e=e||window.event;var eleOffset=slider.offset(),bgOffset=bg.offset(),client=getClient(e);pSliderMouseDown=true;pos=posRecord-client['x'];posRecord=client['x'];var left=eleOffset['left']-pos-bgOffset['left'];if(left<0){left=0}if(left>bg.getWidth()-slider.getWidth()){left=bg.getWidth()-slider.getWidth()}C['bar']['pbox'].addClass('ck-bar-progress-slider-move');var time='';if(!vars['live']){time=left*duration/(bg.getWidth()-slider.getWidth());switch(vars['timeScheduleAdjust']){case 2:if(timesliderDownTime){left=-1000;message(language['timeScheduleAdjust']['prohibitForward']);return}break;case 4:if(timemaxSeeTime){left=-1000;player.seek(maxSeeTime);message(language['timeScheduleAdjust']['prohibitForwardNotViewed']);return}break}time=formatSeconds(time)}else{time=formatLiveTime(left*getLiveTime()/(bg.getWidth()-slider.getWidth()))}tip(slider,time);if(left>=0){slider.css({'left':left+'px'});play.css({'width':left+slider.getWidth()*.5+'px'})}else{pSliderMouseDown=false}};var docMouseUp=function(){noScrolling();doc.removeListener('mousemove',docMouseMove);doc.removeListener('mouseup',docMouseUp);slider.removeListener('touchmove',docMouseMove);slider.removeListener('touchend',docMouseUp);slider.mousedown(sliderMouseDown);slider.touchstart(sliderMouseDown);if(!vars['live']){var time=play.getWidth()*duration/(bg.getWidth()-slider.getWidth()*.5);if(time>duration){time=duration}seekTime=0;player.seek(time)}else{var playbackTime=parseInt(vars['live']+play.getWidth()*getLiveTime()/(bg.getWidth()-slider.getWidth()*.5));eventTarget('playback',{time:playbackTime,date:date('Y-m-d H:i:s',playbackTime)});eventTarget('seek',{time:playbackTime,state:'seeking',date:date('Y-m-d H:i:s',playbackTime)})}C['bar']['pbox'].removeClass('ck-bar-progress-slider-move');if(isMouseLeave){tip()}};var isMouseLeave=true;var sliderMouseOver=function(){var time='';if(!vars['live']){time=formatSeconds(parseInt(slider.css('left'))*duration/(bg.getWidth()-slider.getWidth()))}else{time=language['live']}isMouseLeave=false;tip(slider,time)};var sliderMouseLeave=function(){isMouseLeave=true};slider.mousedown(sliderMouseDown);slider.mouseover(sliderMouseOver);slider.mouseleave(sliderMouseLeave);slider.touchstart(sliderMouseDown);var bgMouseDown=function(e){e=e||window.event;var client=getClient(e);var bgOffset=bg.offset();var w=client['x']-bgOffset['left'];if(CT.full){w+=CK.offset()['left']}if(!vars['live']){var time=duration*w/bg.getWidth();switch(vars['timeScheduleAdjust']){case 0:message(language['timeScheduleAdjust']['prohibit']);return;break;case 2:if(timeoldTime){message(language['timeScheduleAdjust']['prohibitForward']);return}break;case 4:if(timemaxSeeTime){message(language['timeScheduleAdjust']['prohibitForwardNotViewed']);return}break}seekTime=0;player.seek(time)}else{var playbackTime=parseInt(vars['live']+getLiveTime()*w/bg.getWidth());eventTarget('playback',{time:playbackTime,date:date('Y-m-d H:i:s',playbackTime)});eventTarget('seek',{time:playbackTime,state:'seeking',date:date('Y-m-d H:i:s',playbackTime)})}if(w>bg.getWidth()-slider.getWidth()*.5){w=bg.getWidth()-slider.getWidth()*.5}if(wmaxTop){sliderTop=maxTop}slider.css({'top':sliderTop+'px'});var ppMarginTop=sliderTop-minTop+slider.getHeight()*0.5;pp.css({'margin-top':ppMarginTop+'px'});var vol=(bg.getHeight()-ppMarginTop-slider.getHeight()*0.5)/(bg.getHeight()-slider.getHeight());player.volume(vol)};var docMouseUp=function(){noScrolling();doc.removeListener('mousemove',docMouseMove);doc.removeListener('mouseup',docMouseUp);slider.removeListener('touchmove',docMouseMove);slider.removeListener('touchend',docMouseUp);slider.mousedown(sliderMouseDown);slider.touchstart(sliderMouseDown);C['bar']['vbox']['mouseDown']=false};slider.mousedown(sliderMouseDown);slider.touchstart(sliderMouseDown);var bgMouseDown=function(e){e=e||window.event;var client=getClient(e);var bgOffset=bg.offset();var h=client['y']-bgOffset['top'];var max=bg.getHeight();var vol=1-h/max;player.volume(vol)};bg.mousedown(bgMouseDown)};function changeProgress(time){if((valType(vars['live'])=='boolean'&&vars['live'])){return}if(!pSliderMouseDown){var bg=C['bar']['pbox']['bg'],slider=C['bar']['pbox']['slider'];var playW=(time/duration)*100;if(valType(vars['live'])=='number'){playW='100'}C['bar']['pbox']['play'].css({'width':playW+'%'});var sliderW=(slider.getWidth()/bg.getWidth())*100;var sliderLeft=playW-sliderW*.5;if(sliderLeft<0){sliderLeft=0}if(sliderLeft>100-sliderW){sliderLeft=100-sliderW}C['bar']['pbox']['slider'].css({'left':sliderLeft+'%'});checkProgressSlider()}};function checkProgressSlider(){var bg=C['bar']['pbox']['bg'],slider=C['bar']['pbox']['slider'];var st=0;if(C['bar']['pbox'].css('transition-duration')){st=parseFloat(C['bar']['pbox'].css('transition-duration'))*1000+20}var checkThis=function(){var sliderLeft=parseInt(C['bar']['pbox']['slider'].css('left'));if(sliderLeft<0){sliderLeft=0;C['bar']['pbox']['slider'].css({'left':sliderLeft+'px'})}if(sliderLeft>bg.getWidth()-slider.getWidth()){sliderLeft=bg.getWidth()-slider.getWidth();C['bar']['pbox']['slider'].css({'left':sliderLeft+'px'})}};setTimeout(checkThis,st)};function changeTopTime(){C['topBar']['timeEle'].htm(date('H:i:s'));setTimeout(changeTopTime,1000)}function changeVolumeSlider(vol){if(!isUndefined(C['bar']['vbox'])){var box=C['bar']['vbox']['volume']['box'],bg=C['bar']['vbox']['volume']['bg'],pp=C['bar']['vbox']['volume']['pp'],slider=C['bar']['vbox']['volume']['slider'];C['bar']['vbox']['volume']['txt'].htm(parseInt(vol*100));var bgH=bg.getHeight();if(bgH){var ppMarginTop=bgH-vol*bgH;pp.css({'margin-top':ppMarginTop+'px'});var sliderTop=bg.offset()['top']-box.offset()['top']+ppMarginTop-slider.getHeight()*0.5;slider.css({'top':sliderTop+'px'})}}};function changeLoad(){if(video){var len=video.buffered.length;if(len>0){var bufferEnd=video.buffered.end(len-1);if(loadTime=1000){last+=offset;appendFps(fps);fps=0}requestAnimationFrame(step)};var appendFps=function(fps){if(fps!=CT.fps){CT.fps=fps;replaceInformation('fps',fps);eventTarget('fps',fps)}};if(isUndefined(CT.fps)){CT.fps=0}step()}function getElement(content){var ele=$(content);if(isUndefined(ele))return;if(valType(ele)=='htmlarray'){ele=ele[0]}if(isUndefined(ele.captureParentNode)){ele.captureParentNode=ele.parentNode;ele.prevElement=ele.prev();ele.nextElement=ele.next()}return ele}function $(obj,eL){var parent=null;if(document){parent=document}if(!isUndefined(eL)){parent=eL}var res=[];if(obj){if(valType(obj)=='htmlobject'||valType(obj)=='object'){res=obj;if(!isUndefined(res.ckplayer)){return res}}else if(valType(obj)=='string'&&obj!=''){switch(obj.substr(0,1)){case'.':obj=obj.substr(1,obj.length);if(parent.getElementsByClassName){res=parent.getElementsByClassName(obj);if(!res.length){return null}}else if(!parent&&document.getElementsByClassName){res=document.getElementsByClassName(obj);if(!res.length){return null}}else{var reg=new RegExp(' '+obj+' ','i');var ele=null;if(parent.getElementsByTagName){ele=parent.getElementsByTagName('*')}else{ele=document.getElementsByTagName('*')}for(var i=0;i1){b=arr[1].substr(0,1).toLocaleUpperCase()+arr[1].substr(1,arr[1].length-1)}if(arr.length>2){b=arr[2].substr(0,1).toLocaleUpperCase()+arr[2].substr(1,arr[2].length-1)}return a+b+c}return str};if(isUndefined(value)){if(!isUndefined(key)&&valType(key)=='string'){if(this.currentStyle){return this.currentStyle[key]}else{return document.defaultView.getComputedStyle(this,null)[key]}}if(isUndefined(key)){if(this.currentStyle){return this.currentStyle}else{return document.defaultView.getComputedStyle(this,null)}}}if(valType(key)!='object'){var newKey=keyNew(key);if(this.length>1){for(var i=0;i=m+1){return this[m]}return null}return null};for(var i=0;imaxZ){maxZ=parseInt(temp)}}return maxZ}function getWindowSize(){return{width:window.innerWidth,height:window.innerHeight}}function standardization(o,n){var h={};var k;for(k in o){h[k]=o[k]}for(k in n){if(k in h){h[k]=n[k]}}return h}function mergeObj(o,n){var h={};var k;for(k in o){h[k]=o[k]}for(k in n){if(k in h){switch(valType(h[k])){case'object':if(valType(n[k])=='object'){h[k]=mergeObj(h[k],n[k])}break;default:if(valType(h[k])==valType(n[k])){h[k]=n[k]}break}}}return h}function valType(val){if(typeof val==='undefined')return'undefined';var str=Object.prototype.toString.call(val).split(' ')[1].replace(']','').toLowerCase();if(str.substr(0,4)=='html'&&(str.substr(-7)=='element'||str.substr(-8)=='document'||str=='window')){str='htmlobject'}if(str=='htmlcollection'||str=='nodelist'){str='htmlarray'}return str}function isUndefined(val){try{return valType(val)==='undefined'||val===undefined||val===null||(valType(val)==='number'&&isNaN(val))}catch(event){return true}return false}function prev(ele){var e=ele.previousSibling;if(e==null){return null}if(e.nodeType==3){var t=prev(e);if(t&&t.nodeType==1){return t}}else{if(e.nodeType==1){return e}else{return false}}}function next(ele){var e=ele.nextSibling;if(e==null){return null}if(e.nodeType==3){var t=next(e);if(t&&t.nodeType==1){return t}}else{if(e.nodeType==1){return e}else{return false}}}function addListener(ele,e,f,t){if(isUndefined(t)){t=false}if(ele.addEventListener){try{ele.addEventListener(e,f,t)}catch(event){}}else if(ele.attachEvent){try{ele.attachEvent('on'+e,f)}catch(event){}}else{ele['on'+e]=f}if(isUndefined(ele.listenerList)){ele.listenerList=[]}ele.listenerList.push([e,f]);return ele};function removeListener(ele,e,f,t){if(isUndefined(t)){t=false}if(ele.removeEventListener){try{ele.removeEventListener(e,f,t)}catch(e){}}else if(ele.detachEvent){try{ele.detachEvent('on'+e,f)}catch(e){}}else{ele['on'+e]=null}if(!isUndefined(ele.listenerList)){var temp=[];for(var i=0;i>0},W:function(){var a=f.z(),b=364+f.L()-a;var nd2,nd=(new Date(jsdate.getFullYear()+'/1/1').getDay()||7)-1;if(b<=2&&((jsdate.getDay()||7)-1)<=2-b){return 1}else{if(a<=2&&nd>=4&&a>=(6-nd)){nd2=new Date(jsdate.getFullYear()-1+'/12/31');return date('W',Math.round(nd2.getTime()/1000))}else{return(1+(nd<=3?((a+nd)/7):(a-(7-nd))/7)>>0)}}},F:function(){return txt_months[f.n()]},m:function(){return pad(f.n(),2)},M:function(){return f.F().substr(0,3)},n:function(){return jsdate.getMonth()+1},t:function(){var n;if((n=jsdate.getMonth()+1)==2){return 28+f.L()}else{if(n&1&&n<8||!(n&1)&&n>7){return 31}else{return 30}}},L:function(){var y=f.Y();return(!(y&3)&&(y%1e2||!(y%4e2)))?1:0},Y:function(){return jsdate.getFullYear()},y:function(){return(jsdate.getFullYear()+'').slice(2)},a:function(){return jsdate.getHours()>11?'pm':'am'},A:function(){return f.a().toUpperCase()},B:function(){var off=(jsdate.getTimezoneOffset()+60)*60;var theSeconds=(jsdate.getHours()*3600)+(jsdate.getMinutes()*60)+jsdate.getSeconds()+off;var beat=Math.floor(theSeconds/86.4);if(beat>1000)beat-=1000;if(beat<0)beat+=1000;if((String(beat)).length==1)beat='00'+beat;if((String(beat)).length==2)beat='0'+beat;return beat},g:function(){return jsdate.getHours()%12||12},G:function(){return jsdate.getHours()},h:function(){return pad(f.g(),2)},H:function(){return pad(jsdate.getHours(),2)},i:function(){return pad(jsdate.getMinutes(),2)},s:function(){return pad(jsdate.getSeconds(),2)},O:function(){var t=pad(Math.abs(jsdate.getTimezoneOffset()/60*100),4);if(jsdate.getTimezoneOffset()>0)t='-'+t;else t='+'+t;return t},P:function(){var O=f.O();return(O.substr(0,3)+':'+O.substr(3,2))},c:function(){return f.Y()+'-'+f.m()+'-'+f.d()+'T'+f.h()+':'+f.i()+':'+f.s()+f.P()},U:function(){return Math.round(jsdate.getTime()/1000)}};return format.replace(/([a-zA-Z])/g,function(t,s){var ret='';if(t!=s){ret=s}else if(f[s]){ret=f[s]()}else{ret=s}return ret})}function getPath(siz){var scriptList=document.scripts,thisPath=scriptList[scriptList.length-1].src;for(var i=0;i-1){return'iphone'}}return into(videoObj)}return ckplayerEmbed})); \ No newline at end of file +(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory():typeof define==='function'&&define.amd?define(factory):(global=global||self,global.ckplayer=factory())}(this,function(){'use strict';var language={play:'%E6%92%AD%E6%94%BE',pause:'%E6%9A%82%E5%81%9C',refresh:'%E9%87%8D%E6%92%AD',full:'%E5%85%A8%E5%B1%8F',exitFull:'%E9%80%80%E5%87%BA%E5%85%A8%E5%B1%8F',webFull:'%E9%A1%B5%E9%9D%A2%E5%85%A8%E5%B1%8F',exitWebFull:'%E9%80%80%E5%87%BA%E9%A1%B5%E9%9D%A2%E5%85%A8%E5%B1%8F',theatre:'%E5%89%A7%E5%9C%BA%E6%A8%A1%E5%BC%8F',exitTheatre:'%E9%80%80%E5%87%BA%E5%89%A7%E5%9C%BA%E6%A8%A1%E5%BC%8F',volume:'%E9%9F%B3%E9%87%8F%EF%BC%9A',muted:'%E9%9D%99%E9%9F%B3',exitmuted:'%E6%81%A2%E5%A4%8D%E9%9F%B3%E9%87%8F',seek:'seek%EF%BC%9A',waiting:'%E7%BC%93%E5%86%B2',live:'%E7%9B%B4%E6%92%AD%E4%B8%AD',backLive:'%E8%BF%94%E5%9B%9E%E7%9B%B4%E6%92%AD',lookBack:'%E5%9B%9E%E7%9C%8B%EF%BC%9A',next:'%E4%B8%8B%E4%B8%80%E9%9B%86',screenshot:'%E8%A7%86%E9%A2%91%E6%88%AA%E5%9B%BE',smallwindows:'%E5%B0%8F%E7%AA%97%E5%8F%A3%E6%92%AD%E6%94%BE%E5%8A%9F%E8%83%BD',playbackrate:'%E5%80%8D%E9%80%9F',playbackrateSuffix:'%E5%80%8D',track:'%E5%AD%97%E5%B9%95',noTrack:'%E6%97%A0%E5%AD%97%E5%B9%95',definition:'%E6%B8%85%E6%99%B0%E5%BA%A6',switchTo:'%E5%88%87%E6%8D%A2%E6%88%90%EF%BC%9A',closeTime:'%7Bseconds%7D%E7%A7%92%E5%90%8E%E5%8F%AF%E5%85%B3%E9%97%AD%E5%B9%BF%E5%91%8A',closeAd:'%E5%85%B3%E9%97%AD%E5%B9%BF%E5%91%8A',second:'%E7%A7%92',details:'%E6%9F%A5%E7%9C%8B%E8%AF%A6%E6%83%85',copy:'%E5%A4%8D%E5%88%B6',copySucceeded:'%E5%A4%8D%E5%88%B6%E6%88%90%E5%8A%9F%EF%BC%8C%E5%8F%AF%E8%B4%B4%E7%B2%98%EF%BC%81',smallwindowsOpen:'%E5%B0%8F%E7%AA%97%E5%8F%A3%E5%8A%9F%E8%83%BD%E5%B7%B2%E5%BC%80%E5%90%AF',smallwindowsClose:'%E5%B0%8F%E7%AA%97%E5%8F%A3%E5%8A%9F%E8%83%BD%E5%B7%B2%E5%85%B3%E9%97%AD',screenshotStart:'%E6%88%AA%E5%9B%BE%E4%B8%AD%EF%BC%8C%E8%AF%B7%E7%A8%8D%E5%80%99...',screenshotClose:'%E6%88%AA%E5%9B%BE%E5%8A%9F%E8%83%BD%E5%B7%B2%E5%85%B3%E9%97%AD',loopOpen:'%E5%BE%AA%E7%8E%AF%E6%92%AD%E6%94%BE',loopClose:'%E5%B7%B2%E5%85%B3%E9%97%AD%E5%BE%AA%E7%8E%AF%E6%92%AD%E6%94%BE',close:'%E5%85%B3%E9%97%AD',down:'%E4%B8%8B%E8%BD%BD',p50:'50%25',p75:'75%25',p100:'100%25',timeScheduleAdjust:{prohibit:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E6%8B%96%E5%8A%A8',prohibitBackOff:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E9%87%8D%E5%A4%8D%E8%A7%82%E7%9C%8B',prohibitForward:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E5%BF%AB%E8%BF%9B',prohibitLookBack:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E6%92%AD%E6%94%BE%E9%83%A8%E5%88%86%E5%86%85%E5%AE%B9',prohibitForwardNotViewed:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E6%92%AD%E6%94%BE%E6%9C%AA%E8%A7%82%E7%9C%8B%E7%9A%84%E9%83%A8%E5%88%86'},error:{noMessage:'%E6%9C%AA%E7%9F%A5%E9%94%99%E8%AF%AF',supportVideoError:'%E8%AF%A5%E6%B5%8F%E8%A7%88%E5%99%A8%E7%89%88%E6%9C%AC%E5%A4%AA%E4%BD%8E%EF%BC%8C%E5%BB%BA%E8%AE%AE%E6%9B%B4%E6%8D%A2%E6%88%90%E5%85%B6%E5%AE%83%E6%B5%8F%E8%A7%88%E5%99%A8',videoTypeError:'%E8%AF%A5%E6%B5%8F%E8%A7%88%E5%99%A8%E4%B8%8D%E6%94%AF%E6%8C%81%E6%92%AD%E6%94%BE%E8%AF%A5%E8%A7%86%E9%A2%91%EF%BC%8C%E5%BB%BA%E8%AE%AE%E6%9B%B4%E6%8D%A2%E6%88%90%E5%85%B6%E5%AE%83%E6%B5%8F%E8%A7%88%E5%99%A8',loadingFailed:'%E5%8A%A0%E8%BD%BD%E5%A4%B1%E8%B4%A5',emptied:'%E8%A7%86%E9%A2%91%E6%96%87%E4%BB%B6%E5%8A%A0%E8%BD%BD%E8%BF%87%E7%A8%8B%E4%B8%AD%E5%87%BA%E7%8E%B0%E9%94%99%E8%AF%AF',screenshot:'%E8%A7%86%E9%A2%91%E6%88%AA%E5%9B%BE%E5%A4%B1%E8%B4%A5',ajax:'Ajax%E6%95%B0%E6%8D%AE%E8%AF%B7%E6%B1%82%E9%94%99%E8%AF%AF',noVideoContainer:'%E6%9C%AA%E6%89%BE%E5%88%B0%E6%94%BE%E7%BD%AE%E8%A7%86%E9%A2%91%E7%9A%84%E5%AE%B9%E5%99%A8'}};var videoObjectDefault={container:'',volume:0.8,poster:'',autoplay:false,loop:false,live:false,rotate:0,zoom:0,ad:null,backLive:false,seek:0,next:null,loaded:'',plug:'',duration:0,preview:null,prompt:null,crossOrigin:'',video:null,type:'',playbackrate:1,ended:null,webFull:false,theatre:null,controls:false,rightBar:null,smallWindows:null,smallWindowsDrag:true,screenshot:false,timeScheduleAdjust:1,logo:'',menu:null,information:{'Load:':'{loadTime} second','Duration:':'{duration} second','Size:':'{videoWidth}x{videoHeight}','Volume:':'{volume}%','Fps:':'{fps}fps','Sudio decoded:':'{audioDecodedByteCount} Byte','Video decoded:':'{videoDecodedByteCount} Byte'},track:null,title:'',language:'',barHideTime:1500,playbackrateOpen:true,playbackrateList:[0.75,1,1.25,1.5,2,4]};function ckplayerEmbed(videoObj){var rightMenu=[{title:'ckplayer',link:'http://www.ckplayer.com'},{title:'version:X3',underline:true},{title:'about',click:'aboutShow'}];var vars={},varsTemp={};var video=null;var duration=0;var mutedState='';var waited=true;var paused=true;var loadTime=0;var seekTime=0;var oldTime=0,playTime=0,firstSeekTime=-1,maxSeeTime=0;var isChangeDef=true;var playType='';var msgSetTime=null,tipSetTime=null,mouseSetTime=null;var adFrontSetTime=null,adPauseSetTime=null;var waitingMessage=true;var hidePreviewSetTime=null;var pSliderMouseDown=false;var playbackTime=0;var loadedmetadataNum=0;var screenshotImg=null;var ad=null;var frontAdPlay=false,pauseAdPlay=false;var barShow=true,rightBarShow=true;var EventTarget=null,newEvent=null,eventTargetList=null;var loadedTrack=false;var C={};var CT=null,CK=null,CM=null,CV=null;var pugPlayer=null;var hls=null;var loadMeta=true;var app='';var nowRotate=0;var nowZoom=100;var smallWindowsState=false;var isDrag=false;var into=function(obj){if(isUndefined(obj)){player.add=player.into=into;return player}language=decodeURIString(language);if(!isUndefined(window.ckplayerLanguage)){language=mergeObj(language,window.ckplayerLanguage)}eventTarget();app=getApp();varsTemp={};for(var key in videoObjectDefault){varsTemp[key]=videoObjectDefault[key]}if(valType(obj)=='string'&&(obj.substr(0,8)=='website:'||obj.substr(0,4)=='url:')){var ajaxUrl='';if(obj.substr(0,8)=='website:'){ajaxUrl=obj.substring(8)}if(obj.substr(0,4)=='url:'){ajaxUrl=obj.substring(4)}ajax({url:ajaxUrl,success:function(data){if(data){return into(data)}else{showWindowsError(language['error']['ajax']+',url:'+ajaxUrl);return null}}})}else if(valType(obj)=='object'){varsTemp=standardization(varsTemp,obj);if(!isUndefined(obj['container'])&&obj['container']){CT=$(obj['container']);if(CT){return loadLanguage(obj)}else{return bodyReady(obj)}}else{return bodyReady(obj)}}else{showWindowsError(language['error']['noVideoContainer']);return null}},bodyReady=function(obj){documentReady(function(){if(!isUndefined(obj['container'])){CT=$(obj['container']);if(CT){return loadLanguage(obj)}else{showWindowsError(language['error']['noVideoContainer']);return null}}else{return ajaxWebsite(obj)}});return null},ajaxWebsite=function(obj){if(valType(obj['video'])=='string'&&(obj['video'].substr(0,8)=='website:'||obj['video'].substr(0,4)=='url:')){varsTemp=standardization(varsTemp,obj);var ajaxUrl='';if(obj['video'].substr(0,8)=='website:'){ajaxUrl=obj['video'].substring(8)}if(obj['video'].substr(0,4)=='url:'){ajaxUrl=obj['video'].substring(4)}ajax({url:ajaxUrl,success:function(data){if(data){return into(data)}else{showWindowsError(language['error']['ajax']+',url:'+ajaxUrl);return null}}})}else{showWindowsError(language['error']['noVideoContainer']);return null}},loadLanguage=function(obj){vars=standardization(varsTemp,obj);if(vars['language']){var path=getPath('language')+vars['language']+'.js';loadJs(path,function(){if(!isUndefined(window['ckplayerLanguage'])){language=mergeObj(language,window['ckplayerLanguage'])}return embed(obj)})}else{return embed(obj)}},embed=function(obj){mutedState=vars['volume']>0?false:true;if(!isUndefined(CT)&&CT!=null){if(valType(CT)=='htmlarray'){CT=CT.eq(0)}}else{return null}calculationFps();CT.htm('');CK=createlDiv('ckplayer-ckplayer');CT.append(CK);CM=createlDiv('ck-main');CK.append(CM);CV=createlDiv('ck-video');CM.append(CV);if(video){video.remove();video=null}if(valType(vars['video'])=='string'&&((vars['video'].substr(0,1)=='.'&&vars['video'].indexOf('/')==-1)||vars['video'].substr(0,1)=='#')){video=$(vars['video'])}if(!video){video=createlVideo();video.attr('width','100%').attr('height','100%');CV.append(video)}if(vars['autoplay']){video.attr('autoplay','autoplay');paused=false}else{video.attr('preload','metadata')}CT.loop=vars['loop'];if(CT.loop){video.attr('loop','loop')}video.volume=vars['volume'];if(vars['controls']){video.controls=true}else{video.controls=false}try{video.attr('controlslist','nodownload');video.attr('x-webkit-airplay','true');video.attr('x5-video-orientation','portraint');video.attr('playsinline','true');video.attr('webkit-playsinline','true');video.attr('x5-playsinline','true');if(vars['crossOrigin']){video.useCORS=true;video.crossOrigin=vars['crossOrigin']}}catch(event){}CT.smallWindows=true;CT.webFull=false;CT.theatre=false;loadFace();if(vars['rotate']>0){player.rotate(vars['rotate'])}if(vars['zoom']>0){player.zoom(vars['zoom'])}if(isUndefined(video.canPlayType)){CT.error={code:5,message:language['error']['supportVideoError']};eventTarget('error',CT.error);showError();return player}addAllListener();if(!isUndefined(vars['loaded'])){if(valType(vars['loaded'])=='function'){try{vars['loaded'](player)}catch(event){}}else if(valType(vars['loaded'])=='string'){try{eval(vars['loaded']+'(player)')}catch(event){}}}changeVideo(vars['video']);return player},changeVideo=function(vstr){var i=0;if(video.attr('src')||video.htm()){player.pause()}if(video.attr('src')){video.attr('src','');video.removeAttr('src')}if(!isUndefined(video.textTracks)&&video.textTracks.length>0){for(i=video.find('track').length-1;i>-1;i--){video.find('track').eq(i).remove()}}video.htm('');if(!isUndefined(vars['seek'])&&valType(vars['seek'])=='number'&&vars['seek']>0&&!seekTime){seekTime=vars['seek']}if(!isUndefined(vars['ad'])){ad=vars['ad']}var source='';if(valType(vstr)=='string'){if(vstr.substr(0,8)=='website:'||vstr.substr(0,4)=='url:'){var ajaxUrl='';if(vstr.substr(0,8)=='website:'){ajaxUrl=vstr.substring(8)}if(vstr.substr(0,4)=='url:'){ajaxUrl=vstr.substring(4)}ajax({url:ajaxUrl,success:function(data){if(data!=null){vars=standardization(varsTemp,data);changeVideo(vars['video'])}else{CT.error={code:8,message:language['error']['ajax']};eventTarget('error',CT.error);showError()}}});return}else{if(vars['plug']&&!canPlay(vstr)){plugPlayer(vstr)}else{video.attr('src',vstr)}loadTrack()}}else if(valType(vstr)=='array'){for(i=0;i1){source+=''}}}}if(source){video.htm(source)}loadTrack()}else if(valType(vstr)=='object'){if(vars['plug']){plugPlayer(vstr)}else{CT.error={code:10,message:language['error']['emptied']};eventTarget('error',CT.error);showError()}loadTrack()}if(!isUndefined(video.find('source'))&&video.find('source').length>0){video.find('source').eq(video.find('source').length-1).addListener('error',videoHandler.error)}checkBar();loadLogo();if(isChangeDef){checkDefinition()}},plugPlayer=function(url){switch(vars['plug']){case'hls.js':hlsPlayer(url);break;case'flv.js':flvPlayer(url);break;case'mpegts.js':mpegtsPlayer(url);break;case'dash.js':dashPlayer(url);break;default:if(valType(vars['plug'])=='function'){vars['plug'](video,url)}else{CT.error={code:10,message:language['error']['emptied']};eventTarget('error',CT.error);showError()}break}},hlsPlayer=function(url){var path=getPath('hls.js')+'hls.min.js';loadJs(path,function(){if(!isUndefined(Hls)&&Hls.isSupported()){hls=new Hls();hls.loadSource(url);hls.attachMedia(video);hls.on(Hls.Events.ERROR,function(event,data){var code=9;var message=language['error']['loadingFailed'];var fatal=data.fatal;if(!isUndefined(data.response)){if(!isUndefined(data.response.code)){code=data.response.code}if(!isUndefined(data.response.text)&&data.response.text){message=data.response.text}else{if(!isUndefined(event)){message=event}}}CT.error={code:code,message:message};eventTarget('error',CT.error);if(fatal){showError()}})}else if(canPlay(url)){video.attr('src',url)}})},flvPlayer=function(url){var path=getPath('flv.js')+'flv.min.js';loadJs(path,function(){if(typeof(flvjs)!='undefined'&&!isUndefined(flvjs)&&flvjs.isSupported()){var config={type:'flv',url:url};if(valType(url)=='object'){config=url}if(vars['live']){config['isLive']=true}if(pugPlayer){pugPlayer.pause();pugPlayer.unload();pugPlayer.detachMediaElement();pugPlayer.destroy();pugPlayer=null}pugPlayer=flvjs.createPlayer(config);pugPlayer.attachMediaElement(video);pugPlayer.load();pugPlayer.on(flvjs.Events.METADATA_ARRIVED,function(res){videoHandler.loadedMetaData()});pugPlayer.on(flvjs.Events.ERROR,function(errorType,errorDetail,errorInfo){CT.error={code:errorInfo['code'],message:errorInfo['msg']};eventTarget('error',CT.error);showError()})}})},mpegtsPlayer=function(url){var path=getPath('mpegts.js')+'mpegts.js';loadJs(path,function(){if(typeof(mpegts)!='undefined'&&!isUndefined(mpegts)&&mpegts.getFeatureList().mseLivePlayback){var config={type:'mse',url:url};if(valType(url)=='object'){config=url}if(vars['live']){config['isLive']=true}if(pugPlayer){pugPlayer.pause();pugPlayer.unload();pugPlayer.detachMediaElement();pugPlayer.destroy();pugPlayer=null}pugPlayer=mpegts.createPlayer(config);pugPlayer.attachMediaElement(video);pugPlayer.load();pugPlayer.on(mpegts.Events.METADATA_ARRIVED,function(res){videoHandler.loadedMetaData()});pugPlayer.on(mpegts.Events.ERROR,function(errorType,errorDetail,errorInfo){CT.error={code:errorInfo['code'],message:errorInfo['msg']};eventTarget('error',CT.error);showError()})}})},canPlay=function(vStr,num){var vTypeArr=[{vidType:'video/ogg',codType:'theora, vorbis'},{vidType:'video/mp4',codType:'avc1.4D401E, mp4a.40.2'},{vidType:'video/mp4',codType:'avc1'},{vidType:'video/mp4',codType:'hevc'},{vidType:'video/webm',codType:'vp8.0, vorbis'},{vidType:'video/webm',codType:'vp9'},{vidType:'',codType:'application/x-mpegURL'},{vidType:'',codType:'application/vnd.apple.mpegurl'}];var vType={ogg:vTypeArr[0],mp4:[vTypeArr[1],vTypeArr[2],vTypeArr[3]],webm:[vTypeArr[4],vTypeArr[5]],m3u8:[vTypeArr[6],vTypeArr[7]]};var arr=[];var k='';var supportType=function(obj){var vType=obj['vidType'];var str='';if(vType){str=vType+'; codecs="'+obj['codType']+'"'}else{str=obj['codType']}var sup=video.canPlayType(str);if(sup==''){sup='no'}return sup};var getExtension=function(filepath){return filepath.replace(/.+\./,'')};if(isUndefined(num)){if(valType(vStr)=='string'){if(vars['type']){for(k in vTypeArr){if(vTypeArr[k]['vidType']==vars['type']){arr.push(vTypeArr[k])}}}else{if(getExtension(vStr)&&getExtension(vStr)in vType){var temp=vType[getExtension(vStr)];if(valType(temp)=='array'){for(var i=0;i0){for(var i=0;i'}if(video){var html=video.htm()+track;video.htm(html)}if(video.find('track')&&!loadedTrack){loadedTrack=true;checkTrack()}}},loadedMetaData=function(){eventTarget('loadedMetaData',{width:CK.getWidth(),height:CK.getHeight(),videoWidth:CT.videoWidth,videoHeight:CT.videoHeight,duration:duration,volume:CT.volume});replaceInformation('videoWidth',CT.videoWidth);replaceInformation('videoHeight',CT.videoHeight);replaceInformation('volume',parseInt(CT.volume*100));replaceInformation('duration',parseInt(duration))};var videoHandler={loadStart:function(){if(!vars['controls']&&app!='iphone'){C['loading'].show()}C['centerPlay'].hide();eventTarget('loadstart')},canPlay:function(){C['loading'].hide();eventTarget('canplay')},loadedData:function(){eventTarget('loadeddata')},loadedMetaData:function(){duration=this.duration;if(!isUndefined(this.duration)&&vars['duration']){duration=vars['duration']}if(!vars['live']){C['time'].htm(formatSeconds(this.currentTime)+'/'+formatSeconds(duration));C['tempTime'].htm(formatSeconds(this.currentTime)+'/'+formatSeconds(duration))}C['loading'].hide();if(vars['poster']){video.attr('poster',vars['poster'])}if(!vars['autoplay']&&!vars['controls']){C['centerPlay'].show();C['buffer'].hide()}CT.duration=duration;CT.videoWidth=this.videoWidth;CT.videoHeight=this.videoHeight;CT.volume=this.volume;if(CT.videoWidth||CT.videoHeight||duration){loadedMetaData()}var len=0;if(!isUndefined(this.buffered)){len=this.buffered.length}if(len>0){changeLoad()}if(!vars['live']){changePreview(vars['preview'])}else{changePreview()}if(!isUndefined(vars['prompt'])&&valType(vars['prompt'])=='array'&&!vars['live']){changePrompt()}else{deletePrompt()}if(isChangeDef){checkDefinition();isChangeDef=false}pSliderMouseDown=false;loadedmetadataNum++;if(!isUndefined(ad)&&!isUndefined(ad['frontPlay'])&&ad['frontPlay']&&loadedmetadataNum>1){player.play();calculationAdFrontTime(duration)}if(!isUndefined(ad)&&!isUndefined(ad['frontPlay'])&&!ad['frontPlay']){player.volume(vars['volume']);player.play()}if(!vars['autoplay']&&loadMeta){loadMeta=false;player.pause();setTimeout(player.pause,300)}if('error'in C){C['error'].hide()}},timeUpDate:function(){if(!waited){waited=true;C['buffer'].hide();eventTarget('buffer','end')}var len=this.buffered.length;if(len>0){changeLoad()}if(!duration&&this.duration){duration=this.duration;CT.duration=duration;CT.videoWidth=this.videoWidth;CT.videoHeight=this.videoHeight;if(CT.videoWidth||CT.videoHeight||duration){loadedMetaData()}}oldTime=playTime;playTime=this.currentTime;if(maxSeeTime1){calculationAdFrontTime(duration-playTime)}if(!isUndefined(C['error'])&&C['error'].css('display')=='block'){C['error'].hide()}replaceInformation('audioDecodedByteCount',this.webkitAudioDecodedByteCount||this.audioDecodedByteCount||0);replaceInformation('videoDecodedByteCount',this.webkitVideoDecodedByteCount||this.videoDecodedByteCount||0)},ended:function(){if(!isUndefined(ad)&&!isUndefined(ad['frontPlay'])&&ad['frontPlay']){adFrontEnded()}else{C['bar']['playAndPause']['pause'].hide();C['bar']['playAndPause']['play'].hide();C['bar']['playAndPause']['refresh'].show();eventTarget('ended');showEnded();message()}},error:function(event){if(!isUndefined(event.type)){var errorInfo=this.error;var errorBak=function(){var code=12;var msg=language['error']['loadingFailed'];if(!isUndefined(errorInfo)){if(!isUndefined(errorInfo.code)){code=errorInfo.code}if(!isUndefined(errorInfo.message)){msg=errorInfo.message}CT.error={code:code,message:msg};showError()}else{CT.error={code:code,message:msg};if(event.target.attr('src')){showError()}}eventTarget('error',CT.error)};if(event.type=='error'){try{if(video.currentSrc){ajax({url:video.currentSrc,error:function(info){if(info&&valType(info)=='object'&&'code'in info&&info['code']){CT.error=info;eventTarget('error',CT.error);showError()}else{errorBak()}},success:function(data){if(!data){errorBak()}}})}else{errorBak()}}catch(event){errorBak()}}}},stalled:function(){eventTarget('stalled');CT.error={code:13,message:'load:stalled'};eventTarget('error',CT.error)},suspend:function(){eventTarget('suspend')},emptied:function(){eventTarget('emptied');CT.error={code:7,message:language['error']['emptied']};eventTarget('error',CT.error)},seeked:function(){if(paused){player.play()}pSliderMouseDown=false;eventTarget('seek',{time:this.currentTime,state:'seeked'});eventTarget('seeked')},seeking:function(){if(paused){player.play()}var seekingTime=this.currentTime;if(firstSeekTime==-1){firstSeekTime=seekingTime}switch(vars['timeScheduleAdjust']){case 0:if(oldTime!=seekingTime){waitingMessage=false;player.seek(oldTime);message(language['timeScheduleAdjust']['prohibit']);return}break;case 2:if(seekingTimeoldTime){waitingMessage=false;player.seek(oldTime);message(language['timeScheduleAdjust']['prohibitForward']);return}break;case 4:if(seekingTimemaxSeeTime){waitingMessage=false;player.seek(maxSeeTime);message(language['timeScheduleAdjust']['prohibitForwardNotViewed']);return}break}eventTarget('seek',{time:seekingTime,state:'seeking'});eventTarget('seeking');if(!vars['live']){C['time'].htm(formatSeconds(seekingTime)+'/'+formatSeconds(duration));C['tempTime'].htm(formatSeconds(seekingTime)+'/'+formatSeconds(duration))}},waiting:function(){waited=false;eventTarget('buffer','start');C['centerPlay'].hide();if(!vars['controls']){C['buffer'].show()}if(!waitingMessage){waitingMessage=true}else{message(language['waiting'])}},play:function(){paused=false;C['bar']['playAndPause']['play'].hide();C['bar']['playAndPause']['pause'].show();C['bar']['playAndPause']['refresh'].hide();C['centerPlay'].hide();if(playType=='button'){C['bar']['pbox'].removeClass('ck-bar-progress-out')}else{C['bar']['pbox'].addClass('ck-bar-progress-out')}hideBar();closePauseAd();playType='';if(!isUndefined(C['ended'])){player.closeLayer(C['ended'])}if('error'in C){C['error'].hide()}eventTarget('play');if(!isUndefined(ad)){if(!isUndefined(ad['front'])){if(isUndefined(ad['frontPlay'])){ad['frontPlayI']=0;ad['frontPlay']=true;player.pause();adFrontPlay();return}}}if(seekTime&&(isUndefined(vars['live'])||(!isUndefined(vars['live'])&&valType(vars['live'])=='boolean'&&!vars['live']))){player.seek(seekTime);seekTime=0}},pause:function(){paused=true;if(isUndefined(ad)||isUndefined(ad['frontPlay'])||(!isUndefined(ad['frontPlay'])&&!ad['frontPlay'])){if(!isUndefined(ad)&&!isUndefined(ad['pause'])){if(isUndefined(ad['pausePlayI'])){ad['pausePlayI']=0}adPausePlay()}else{if(!vars['controls']){C['centerPlay'].show();C['buffer'].hide()}}}else{if(!vars['controls']){C['centerPlay'].show();C['buffer'].hide()}}C['bar']['playAndPause']['pause'].hide();C['bar']['playAndPause']['play'].show();C['bar']['playAndPause']['refresh'].hide();C['bar']['pbox'].removeClass('ck-bar-progress-out');checkProgressSlider();eventTarget('pause');C['bar'].removeClass('ck-bar-out');CM.removeClass('ck-nocursor')},volumeChange:function(){if(this.volume==0&&!mutedState){this.muted=true}if(this.volume>0&&mutedState){this.muted=false}if(mutedState!=this.muted){mutedState=this.muted;changeMuted(this.muted);CT.muted=this.muted;eventTarget('muted',CT.muted)}CT.volume=this.volume;eventTarget('volume',this.volume);if(!isUndefined(C['bar']['vbox'])){var vol=parseInt(this.volume*100);C['bar']['vbox']['volume']['txt'].htm(vol);if(!C['bar']['vbox']['mouseDown']){changeVolumeSlider(this.muted?0:this.volume)}if(!this.muted){message(language['volume']+vol+'%')}}replaceInformation('volume',parseInt(this.volume*100))},resize:function(){var fullState=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen||document.msFullscreenElement;if(fullState){C['bar']['fullAndExit']['exitFull'].show();C['bar']['fullAndExit']['full'].hide();C['ad']['bottom']['fullAndExit']['exitFull'].show();C['ad']['bottom']['fullAndExit']['full'].hide();if(!CM.hasClass('ck-main-full')){CM.addClass('ck-main-full')}message(language['full']);C['bar']['webFullAndExit'].hide();C['bar']['theatreAndExit'].hide();if(!isUndefined(C['menu'])){CM.append(C['menu'])}}else{fullState=false;C['bar']['fullAndExit']['full'].show();C['bar']['fullAndExit']['exitFull'].hide();C['ad']['bottom']['fullAndExit']['full'].show();C['ad']['bottom']['fullAndExit']['exitFull'].hide();if(CM.hasClass('ck-main-full')){CM.removeClass('ck-main-full')}if(!isUndefined(vars['webFull'])&&vars['webFull']){C['bar']['webFullAndExit'].show()}if(!isUndefined(vars['theatre'])&&!CT.webFull){C['bar']['theatreAndExit'].show()}if(!isUndefined(C['menu'])){$('body').append(C['menu'])}if(CV.css('width')!=CM.css('width')){player.zoom(100)}}if(CT.full!=fullState){CT.full=fullState;eventTarget('full',fullState)}checkVideoRotate();changeProgress(player.time())},keydown:function(e){var keycode=e.keyCode||e.which;var v=player.volume();switch(keycode){case 32:e=window.event||event;if(e.preventDefault){e.preventDefault()}else{window.event.returnValue=false}player.playOrPause();break;case 37:player.fastBack();break;case 39:player.fastNext();break;case 38:player.volume(v+.1<1?v+=.1:1);break;case 40:player.volume(v-.1>0?v-=.1:0);break;default:break}}};var adFrontPlay=function(){if(ad['frontPlayI']==0){allBarHide(false);C['ad'].show();ad['front']['video']=false;if(!isUndefined(ad['front']['closeTime'])){if(ad['front']['closeTime']>0){C['ad']['top']['closeTime'].show();adFrontCloseTime()}else{C['ad']['top']['closeAd'].show()}}}if(!isUndefined(ad['front']['node'])&&ad['front']['node']!=null){CM.append(ad['front']['node']);player.closeLayer(ad['front']['node']);ad['front']['node']=null}C['ad']['picture'].htm('');C['ad']['picture'].hide();C['ad']['link'].hide();if(!isUndefined(ad['front']['list'][ad['frontPlayI']])){var adv=ad['front']['list'][ad['frontPlayI']];frontAdPlay=true;eventTarget('frontAd',adv);if(adv['type']=='picture'){adPicturePlay(adv)}else if(adv['type']=='node'){adNode(adv)}else{C['ad']['link'].attr('data-link',adv['link']);adVideoPlay(adv['file'])}if(!isUndefined(adv['link'])){C['ad']['bottom']['details'].show();C['ad']['bottom']['details'].htm(''+language['details']+'')}else{C['ad']['bottom']['details'].hide()}}},adFrontCloseTime=function(){if(!isUndefined(ad['front']['closeSetTime'])){clearTimeout(ad['front']['closeSetTime']);ad['front']['closeSetTime']=null}C['ad']['top']['closeTime'].htmReplace('{seconds}',ad['front']['closeTime'],language['closeTime']);ad['front']['closeTime']--;if(ad['front']['closeTime']>0){ad['front']['closeSetTime']=setTimeout(adFrontCloseTime,1000)}else{C['ad']['top']['closeAd'].show();C['ad']['top']['closeTime'].hide()}},calculationAdFrontTime=function(t){if(!isUndefined(t)){ad['front']['list'][ad['frontPlayI']]['time']=t}ad['front']['countDown']=0;for(var i=ad['frontPlayI'];i0){adv['time']--;ad['front']['countDown']--;C['ad']['top']['countDown'].htm(ad['front']['countDown']+language['second']);adFrontSetTime=setTimeout(adFrontCountDown,1000)}else{adFrontEnded()}},adFrontEnded=function(){if(ad['frontPlayI']0||h>0){if(adv['link']){var a=createlA('',adv['link']);a.append(this);C['ad']['picture'].append(a)}else{C['ad']['picture'].append(this)}img.unbind();img.click(function(){eventTarget('frontAdClick',adv)})}else{if(imgloadNum<10){imgloadNum++;imgLoadHandler()}}})};imgLoadHandler();calculationAdFrontTime();adFrontCountDown();C['ad']['bottom']['mutedAndExit'].hide()},adNode=function(adv){if(isUndefined(adv['content']))return;ad['front']['node']=player.layer(adv);ad['front']['node'].css({'z-index':1});C['ad'].append(ad['front']['node']);ad['front']['node'].unbind();ad['front']['node'].click(function(){eventTarget('frontAdClick',adv)});calculationAdFrontTime();adFrontCountDown();C['ad']['bottom']['mutedAndExit'].hide()},frontVideoClickHandler=function(){var url=C['ad']['link'].attr('data-link');window.open(url,'_blank')},closeFrontAd=function(){if(!isUndefined(ad)&&!isUndefined(ad['front'])&&!isUndefined(ad['front']['closeButtonClick'])){if(valType(ad['front']['closeButtonClick'])=='function'){try{ad['front']['closeButtonClick']()}catch(event){console.error(event)}}else if(valType(ad['front']['closeButtonClick'])=='string'){try{eval(ad['front']['closeButtonClick']+'()')}catch(event){console.error(event)}}}else{player.closeFrontAd()}},adPausePlay=function(){closePauseAd();if(!isUndefined(ad)&&!isUndefined(ad['pause'])&&!isUndefined(ad['pause']['list'])&&ad['pause']['list'].length-1>=ad['pausePlayI']){var adv=ad['pause']['list'][ad['pausePlayI']];if(!isUndefined(ad['pause']['close'])&&ad['pause']['close']){ad['pauseClose']=createlButton('ck-pause-close');ad['pauseClose'].click(function(){C['centerPlay'].show();C['buffer'].hide();closePauseAd()})}if(!isUndefined(adv['file'])){var img=null;var imgloadNum=0;var imgLoadHandler=function(){img=createlImg(adv['file']);C['adPause'].show();C['adPause'].htm('');C['adPause'].append(img);img.addListener('load',function(){var w=this.getWidth(),h=this.getHeight();if(w>0||h>0){C['adPause'].htm('');if(adv['link']){var a=createlA('',adv['link']);a.append(this);C['adPause'].append(a)}else{C['adPause'].append(this)}C['adPause'].css({'width':w+'px','height':h+'px'});if(ad['pauseClose']){C['adPause'].append(ad['pauseClose'])}img.click(function(){eventTarget('pauseAdClick',adv)})}else{if(imgloadNum<10){imgloadNum++;imgLoadHandler()}}})};imgLoadHandler()}else if(!isUndefined(adv['content'])){ad['pause']['node']=player.layer(adv);if(ad['pauseClose']){ad['pause']['node'].append(ad['pauseClose'])}ad['pause']['node'].click(function(){eventTarget('pauseAdClick',adv)})}eventTarget('pauseAd',adv);if(!isUndefined(adv['time'])&&adv['time']>0){adPauseSetTime=setTimeout(function(){ad['pausePlayI']++;if(ad['pausePlayI']>ad['pause']['list'].length-1){ad['pausePlayI']=0}adPausePlay()},adv['time']*1000)}}},closePauseAd=function(){if(adPauseSetTime){clearTimeout(adPauseSetTime);adPauseSetTime=null}C['adPause'].hide();if(!isUndefined(ad)&&!isUndefined(ad['pauseClose'])&&ad['pauseClose']!=null){ad['pauseClose'].remove();ad['pauseClose']=null}if(!isUndefined(ad)&&!isUndefined(ad['pause'])&&!isUndefined(ad['pause']['node'])&&ad['pause']['node']){ad['pause']['node'].unbind();player.closeLayer(ad['pause']['node']);eventTarget('pauseAdClose')}};var player={width:function(value){if(!isUndefined(value)){if(valType(value)=='number'){value+='px'}CT.css({'width':value});checkVideoRotate()}return CK.getWidth()},height:function(value){if(!isUndefined(value)){if(valType(value)=='number'){value+='px'}CT.css({'height':value});checkVideoRotate()}return CK.getHeight()},videoWidth:function(){if(video){return video.videoWidth}return null},videoHeight:function(){if(video){return video.videoHeight}return null},zoom:function(fn){if(!isUndefined(fn)){if(valType(fn)=='function'){newEvent.addEventListener('zoom',fn)}if(valType(fn)=='number'){var arr=[C['topBar']['zoomEle']['zoom50'],C['topBar']['zoomEle']['zoom75'],C['topBar']['zoomEle']['zoom100']];for(var i=0;ifn&&fn>0){rot=arr[fn]}else{if(arr.indexOf(fn)>-1){rot=fn}}if(rot!=nowRotate){eventTarget('rotate',rot);nowRotate=rot;checkVideoRotate()}}}},vars:function(obj,val){if(isUndefined(obj)){return}if(valType(obj)=='string'&&!isUndefined(val)){var temp={};temp[obj]=val;obj=temp}var isChange=false;for(var k in obj){if(k in vars&&obj[k]!=vars[k]){isChange=true;break}}if(isChange){vars=standardization(vars,obj)}if(!isUndefined(obj['video'])){isChangeDef=true;changeVideo(vars['video'])}if(!isUndefined(obj['title'])){C['topBar']['titleEle'].htm(obj['title'])}},loadstart:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('loadstart',fn)}},loadeddata:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('loadeddata',fn)}},loadedMetaData:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('loadedMetaData',fn)}},canplay:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('canplay',fn)}},play:function(fn){if(valType(fn)=='object'){if(fn['target']==C['bar']['playAndPause']['play']||fn['target']==C['bar']['playAndPause']['refresh']){playType='button'}}if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('play',fn)}else{if(loadedmetadataNum>0&&video){try{video.play()}catch(event){console.error(event)}}}return player},pause:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('pause',fn)}else{if(loadedmetadataNum>0&&video){try{video.pause()}catch(event){console.error(event)}}}return player},playOrPause:function(){if(paused){player.play()}else{player.pause()}return player},volume:function(fn){if(!isUndefined(fn)){if(valType(fn)=='function'){newEvent.addEventListener('volume',fn)}else if(valType(fn)=='number'&&video){if(fn<0)fn=0;if(fn>1)fn=1;if(video.muted){video.volume=fn*.5}video.volume=fn}}else if(video){return video.volume}return player},muted:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('muted',fn)}else if(video){video.muted=true}return player},exitMuted:function(){if(video){video.muted=false;if(video.volume==0){player.volume(.8)}}return player},time:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('time',fn)}else if(video){return video.currentTime||0}},seek:function(fn){if(!isUndefined(fn)){if(valType(fn)=='function'){newEvent.addEventListener('seek',fn)}if(valType(fn)=='number'&&video){switch(vars['timeScheduleAdjust']){case 0:message(language['timeScheduleAdjust']['prohibit']);return;break;case 1:break;case 2:if(fnoldTime){message(language['timeScheduleAdjust']['prohibitForward']);return}break;case 4:if(fnmaxSeeTime){waitingMessage=false;video.currentTime=maxSeeTime;message(language['timeScheduleAdjust']['prohibitForwardNotViewed']);return}break}pSliderMouseDown=false;video.currentTime=fn}}return player},buffer:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('buffer',fn)}return player},ended:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('ended',fn)}return player},error:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('error',fn)}return player},emptied:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('emptied',fn)}return player},duration:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('duration',fn)}else{return duration||0}},playbackRate:function(fn){if(!isUndefined(fn)){if(valType(fn)=='function'){newEvent.addEventListener('playbackRate',fn)}else if(valType(fn)=='number'&&video){video.playbackRate=fn;CT.playbackRate=fn;eventTarget('playbackRate',fn);changePlaybackrateVal(fn)}}else{return video.playbackRate}},track:function(fn){if(!isUndefined(fn)){if(valType(fn)=='function'){newEvent.addEventListener('track',fn)}else if(valType(fn)=='number'&&video){var track=null;if(!isUndefined(video.textTracks)){track=video.textTracks}if(track&&valType(track)=='texttracklist'){var arr=vars['track'];for(var i=track.length-1;i>-1;i--){video.find('track').eq(i).remove()}for(var i=0;i'}if(video){var html=video.htm()+track;video.htm(html)}changeTrackVal(fn)}}}else{return CT.track}},fastBack:function(num){if(duration==0)return;if(isUndefined(num)||valType(num)!='number'){num=20}var time=player.time();if(time-num>0){time-=num}else{time=0}player.seek(time);return player},fastNext:function(num){if(duration==0)return;if(isUndefined(num)||valType(num)!='number'){num=20}var time=player.time();if(time+num200)zIndex=200;if(isUndefined(ele.cssDisplay)){ele.cssPosition=ele.css('position');ele.cssDisplay=ele.css('display')}ele.css({'position':'absolute','z-index':zIndex});if(!cBar){CM.append(ele)}else{C['bar'].append(ele)}ele.CK=CK;ele.show()}return ele},closeLayer:function(ele){if(valType(ele)=='string'){var temp=$(ele);if(!isUndefined(temp)){if(temp.length>0){ele=temp.eq(0)}}}if(!isUndefined(ele)&&valType(ele)=='htmlobject'){if(!isUndefined(ele.captureParentNode)){var eleP=ele.captureParentNode;if(ele.nextElement){try{eleP.insertBefore(ele,ele.nextElement)}catch(event){eleP.append(ele)}}else if(ele.prevElement){try{eleP.insertAfter(ele,ele.prevElement)}catch(event){eleP.append(ele)}}else{eleP.append(ele)}ele.css({'display':ele.cssDisplay})}else{ele.remove()}if(!isUndefined(ele.cssDisplay)){ele.css({'display':ele.cssDisplay,'position':ele.cssPosition})}}return player},message:function(str){message(str);return player},closeFrontAd:function(){if(frontAdPlay&&!isUndefined(ad)&&!isUndefined(ad['front'])&&!isUndefined(ad['front']['list'])){ad['frontPlayI']=ad['front']['list'].length-1;adFrontEnded();clearAdFrontSetTime()}return player},addListener:function(name,fn){newEvent.addEventListener(name,fn)},removeListener:function(name,fn){newEvent.removeEventListener(name,fn)},bar:function(bool){barShow=bool;if(bool){C['bar'].show()}else{C['bar'].hide()}},rightBar:function(bool){rightBarShow=bool;if(bool){C['rightBar'].show()}else{C['rightBar'].hide()}},mouseActive:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('mouseActive',fn)}return this},remove:function(){var eventTemp={};if(eventTargetList!=null){for(var k in eventTargetList){eventTemp[k]=eventTargetList[k]}for(var k in eventTemp){var temp=eventTemp[k];if(temp){for(var i=0;i-1;i--){var pTemp=createlButton('ck-list-p',playbackrate[i]+language['playbackrateSuffix']);pTemp.attr('data-i',i).attr('data-val',playbackrate[i]);C['bar']['playbackrate']['bg']['p'].push(pTemp);C['bar']['playbackrate']['bg'].append(pTemp);pTemp.click(playbackrateClick)}C['bar']['playbackrate'].hide();if(!isUndefined(vars['playbackrateOpen'])&&vars['playbackrateOpen']){C['bar']['playbackrate'].show();C['bar']['playbackrate']['bgbox'].show();var w=C['bar']['playbackrate']['bg'].getWidth(),h=C['bar']['playbackrate']['bg'].getHeight();var bw=C['bar']['playbackrate']['button'].getWidth();C['bar']['playbackrate']['bg'].css({'width':w+10+'px'});w=C['bar']['playbackrate']['bg'].getWidth();if(getBarHeight()>C['bar'].getHeight()){h+=(getBarHeight()-C['bar'].getHeight())}C['bar']['playbackrate']['bgbox'].attr('style','');C['bar']['playbackrate']['bgbox'].css({'width':w+'px','height':(h+2)+'px','left':-(w-bw)*0.5+'px'});C['bar']['playbackrate']['button'].mouseover(function(){w=C['bar']['playbackrate']['bg'].getWidth();bw=C['bar']['playbackrate']['button'].getWidth();C['bar']['playbackrate']['bgbox'].css({'left':-(w-bw)*0.5+'px'})});changePlaybackrateVal(pbr)}},playbackrateClick=function(e){C['bar']['playbackrate']['bgbox'].hide();setTimeout(function(){C['bar']['playbackrate']['bgbox'].removeCss('display')},300);message(language['switchTo']+$(this).htm());player.playbackRate(parseFloat($(this).attr('data-val')))},changePlaybackrateVal=function(num){C['bar']['playbackrate']['bg'].find('button').each(function(index,ele){var val=parseFloat(ele.attr('data-val'));ele.removeClass('ck-list-p-focus');if(num==val){ele.addClass('ck-list-p-focus');if(num!=1){C['bar']['playbackrate']['button'].htm(ele.htm())}else{C['bar']['playbackrate']['button'].htm(language['playbackrate'])}}else{ele.removeClass('ck-list-p-focus')}})},checkTrack=function(){var track=vars['track'];var pbr=-1;C['bar']['track']['bgbox'].htm('');C['bar']['track']['bg']=createlDiv('ck-list-bg');C['bar']['track']['bgbox'].append(C['bar']['track']['bg']);C['bar']['track']['bg']['p']=[];var pTemp=null;for(var i=track.length-1;i>-1;i--){pTemp=createlButton('ck-list-p',track[i]['label']);pTemp.attr('data-i',i).attr('data-title',track[i]['label']);C['bar']['track']['bg']['p'].push(pTemp);C['bar']['track']['bg'].append(pTemp);if(!isUndefined(track[i]['default'])&&track[i]['default']){pbr=i}pTemp.click(trackClick)}pTemp=createlButton('ck-list-p',language['noTrack']);pTemp.attr('data-i',-1).attr('data-title',language['noTrack']);C['bar']['track']['bg']['p'].push(pTemp);C['bar']['track']['bg'].append(pTemp);pTemp.click(trackClick);C['bar']['track'].hide();C['bar']['track'].show();C['bar']['track']['bgbox'].show();var w=C['bar']['track']['bg'].getWidth(),h=C['bar']['track']['bg'].getHeight();var bw=C['bar']['track']['button'].getWidth();C['bar']['track']['bg'].css({'width':w+10+'px'});w=C['bar']['track']['bg'].getWidth();if(getBarHeight()>C['bar'].getHeight()){h+=(getBarHeight()-C['bar'].getHeight())}C['bar']['track']['bgbox'].attr('style','');C['bar']['track']['bgbox'].css({'width':w+'px','height':(h+2)+'px','left':-(w-bw)*0.5+'px'});C['bar']['track']['button'].mouseover(function(){w=C['bar']['track']['bg'].getWidth();bw=C['bar']['track']['button'].getWidth();C['bar']['track']['bgbox'].css({'left':-(w-bw)*0.5+'px'})});changeTrackVal(pbr)},trackClick=function(e){C['bar']['track']['bgbox'].hide();setTimeout(function(){C['bar']['track']['bgbox'].removeCss('display')},300);message(language['switchTo']+$(this).attr('data-title'));player.track(parseFloat($(this).attr('data-i')))},changeTrackVal=function(num){C['bar']['track']['bg'].find('button').each(function(index,ele){var i=parseInt(ele.attr('data-i'));if(num==i){C['bar']['track']['button'].htm(ele.attr('data-title'));if(i>-1){CT.track=vars['track'][i];eventTarget('track',vars['track'][i])}else{CT.track=null;eventTarget('track',null)}ele.addClass('ck-list-p-focus')}else{ele.removeClass('ck-list-p-focus')}})},checkDefinition=function(){var pi=-1;var videoUrl=video['currentSrc'];if(!isUndefined(C['bar']['definition']['bg'])){C['bar']['definition']['bgbox'].htm('');C['bar']['definition']['bgbox'].attr('style','');C['bar']['definition']['button'].htm(language['definition'])}if(valType(vars['video'])=='array'){var arr=vars['video'];C['bar']['definition']['bg']=createlDiv('ck-list-bg');C['bar']['definition']['bgbox'].append(C['bar']['definition']['bg']);C['bar']['definition']['bg']['p']=[];for(var i=arr.length-1;i>-1;i--){var pTemp=createlButton('ck-list-p',arr[i][2]);pTemp.attr('data-i',i).attr('data-video',arr[i][0]).attr('data-type',arr[i][1]).attr('data-title',arr[i][2]);C['bar']['definition']['bg']['p'].push(pTemp);C['bar']['definition']['bg'].append(pTemp);if(videoUrl&&videoUrl.indexOf(arr[i][0])>-1){pi=i}pTemp.click(definitionClick)}C['bar']['definition'].show();C['bar']['definition']['bgbox'].show();var w=C['bar']['definition']['bg'].getWidth(),h=C['bar']['definition']['bg'].getHeight();var bw=C['bar']['definition']['button'].getWidth();C['bar']['definition']['bg'].css({'width':w+10+'px'});w=C['bar']['definition']['bg'].getWidth();if(getBarHeight()>C['bar'].getHeight()){h+=(getBarHeight()-C['bar'].getHeight())}C['bar']['definition']['bgbox'].attr('style','');C['bar']['definition']['bgbox'].css({'width':w+'px','height':(h+2)+'px','left':-(w-bw)*0.5+'px'});C['bar']['definition']['button'].mouseover(function(){w=C['bar']['definition']['bg'].getWidth();bw=C['bar']['definition']['button'].getWidth();C['bar']['definition']['bgbox'].css({'left':-(w-bw)*0.5+'px'})})}if(pi>-1){C['bar']['definition']['bg'].find('button').each(function(index,ele){var i=parseInt(ele.attr('data-i'));if(pi==i){ele.addClass('ck-list-p-focus')}else{ele.removeClass('ck-list-p-focus')}})}},definitionClick=function(e){C['bar']['definition']['bgbox'].hide();setTimeout(function(){C['bar']['definition']['bgbox'].removeCss('display')},300);changeDefinition(parseInt($(this).attr('data-i')))},changeDefinition=function(num){C['bar']['definition']['bg'].find('button').each(function(index,ele){var i=parseInt(ele.attr('data-i'));if(num==i){if(!isUndefined(video.textTracks)&&video.textTracks.length>0){for(var y=video.find('track').length-1;y>-1;y--){video.find('track').eq(y).remove()}}seekTime=player.time();video.attr('autoplay','autoplay');changeVideo(ele.attr('data-video'));message(language['switchTo']+ele.htm());C['bar']['definition']['button'].htm(ele.htm());ele.addClass('ck-list-p-focus');eventTarget('definition',{id:i,video:ele.attr('data-video'),title:ele.attr('data-title')})}else{ele.removeClass('ck-list-p-focus')}})},deletePrompt=function(){var i=0;if(!isUndefined(C['prompt'])&&valType(C['prompt'])=='array'){for(i=C['prompt'].length;i>-1;i--){if(!isUndefined(C['prompt'][i])){C['prompt'][i].remove()}}C['prompt']=null}C['prompt']=[]},changePrompt=function(){deletePrompt();for(var i=0;i100)left=100;ele.css({'left':left+'%'});ele.mouseover(function(){if(this.attr('data-words')){showPromptWords(this)}});ele.mouseout(function(){if(this.attr('data-words')){showPromptWords()}});C['prompt'].push(ele)}}},showPromptWords=function(ele){if(isUndefined(C['promptWords'])){C['promptWords']=createlDiv('ck-prompt-words');CM.append(C['promptWords']);C['promptWords']['content']=createlDiv('ck-prompt-content');C['promptWords'].append(C['promptWords']['content'])}if(isUndefined(ele)){C['promptWords']['content'].htm('');C['promptWords'].hide();return}C['promptWords']['content'].htm(ele.attr('data-words'));C['promptWords'].show();var pW=C['promptWords'].getWidth(),pH=C['promptWords'].getHeight();var bg=C['bar']['pbox']['bg'];var time=parseFloat(ele.attr('data-time'));var top=CK.getHeight()-getBarHeight();var left=ele.offset()['left']-CK.offset()['left']+ele.getWidth()*.5-pW*.5;if(!isUndefined(C['preview'])){top=CK.getHeight()-parseFloat((getBarHeight()+C['preview']['smallHight']+parseInt(C['preview'].css('margin-bottom'))))}else{top=CK.getHeight()-parseFloat((getBarHeight()+C['tip']['minHeight']+parseInt(C['tip'].css('margin-bottom'))));top-=(getBarHeight()-C['bar'].getHeight())}top-=parseFloat(C['promptWords'].css('margin-bottom'));top-=pH;left-=parseFloat(C['promptWords'].css('margin-right'));if(left<0)left=0;if(left>CK.getWidth()-pW)left=CK.getWidth()-pW;C['promptWords'].css({'top':top+'px','left':left+'px'})},changePreview=function(preview){if(!isUndefined(C['preview'])){C['preview'].remove();C['preview']=null}if(!isUndefined(preview)){C['preview']=createlDiv('ck-preview');CM.append(C['preview']);if(isUndefined(vars['preview']['type'])){vars['preview']['type']=0}if(vars['preview']['type']==1){C['preview']['bg']=createlDiv('ck-preview-bg');C['preview'].append(C['preview']['bg'])}var files=[];var loadImg=function(bigW,bigH,smallW,smallH){if(vars['preview']['type']==1){C['preview']['bg']['img']=[];for(var i=0;i1){if(valType(vars['preview']['thumbnail'][0])=='number'){thumbnail[0]=vars['preview']['thumbnail'][0]}if(valType(vars['preview']['thumbnail'][1])=='number'){thumbnail[1]=vars['preview']['thumbnail'][1]}vars['preview']['thumbnail']=thumbnail}if(files[0]){var img=createlImg(files[0],'ck-preview-load-img').addListener('load',function(){loadImg(this.getWidth(),this.getHeight(),this.getWidth()/thumbnail[0],this.getHeight()/thumbnail[1]);this.remove()});CM.append(img)}}else{C['preview'].removeChild();C['preview']=null}}else{C['preview'].removeChild();C['preview']=null}}},showPreview=function(time){if(hidePreviewSetTime){clearTimeout(hidePreviewSetTime);hidePreviewSetTime=null}if(time<0){if(!isUndefined(C['preview'])){hidePreviewSetTime=setTimeout(function(){C['preview'].hide();hidePreviewSetTime=null},200);return}}if(!isUndefined(C['preview'])&&!isUndefined(vars['preview']['thumbnail'])&&duration>0){if(isUndefined(vars['preview']['type'])){vars['preview']['type']=0}var scale=2,thumbnail=vars['preview']['thumbnail'];if(!isUndefined(vars['preview']['scale'])){scale=vars['preview']['scale']}var divI=0,imgI=0;var left=0,frameLeft=0;var pW=0;var smallW=C['preview']['smallWidth'],smallH=C['preview']['smallHight'];var bgXw=time*C['bar']['pbox']['bg'].getWidth()/duration+(C['bar']['pbox']['bg'].offset()['left']-CK.offset()['left']);if(C['preview'].css('display')=='none'){C['preview'].show()}C['preview'].css({'height':smallH+'px',});if(vars['preview']['type']==1){divI=parseInt(time/(scale*thumbnail[0]));imgI=parseInt(time/scale);var minI=divI-5,maxI=divI+5;if(minI<0)minI=0;if(maxI>C['preview']['bg']['img'].length-1){maxI=C['preview']['bg']['img'].length-1}for(var i=minI;iC['preview'].getWidth()-C['preview']['frame'].getWidth()){var xz=frameLeft-(C['preview'].getWidth()-C['preview']['frame'].getWidth());frameLeft=C['preview'].getWidth()-C['preview']['frame'].getWidth();left-=xz}C['preview']['bg'].css({'left':left+'px'});C['preview']['frame'].css({'left':frameLeft+'px'})}else{var temp=(time/scale)/(thumbnail[0]*thumbnail[1]);imgI=parseInt(temp);var smallI=parseInt((temp-imgI)*100);var rows=parseInt(smallI/thumbnail[0]);var column=smallI%thumbnail[0];var files=vars['preview']['file'];left=bgXw-smallW*.5;if(left<0){left=0}if(left>CK.getWidth()-smallW){left=CK.getWidth()-smallW}C['preview'].css({'width':C['preview']['smallWidth']+'px','background':'url('+files[imgI]+') no-repeat','background-position':'-'+column*smallW+'px -'+rows*smallH+'px','left':left+'px'})}}},showError=function(){C['loading'].hide();if(vars['controls']){return}if(isUndefined(C['error'])){C['error']=createlDiv('ck-error');CM.append(C['error'])}var msg=CT.error['message'];if(!msg)msg=language['error']['noMessage'];var html=msg+'(code:'+CT.error['code']+')';C['error'].htm(html);C['error'].show()},showWindowsError=function(error){var ele=createlDiv('ckplayer-error',error);$('body').append(ele)},showNextEpisode=function(){if(isUndefined(vars['next']))return;if(valType(vars['next'])=='object'){if('content'in vars['next']){C['next']=player.layer(vars['next']);return}if('title'in vars['next']){tip(C['bar']['nextEpisode'],vars['next']['title']);return}}tip(C['bar']['nextEpisode'],language['next'])},nextClick=function(){if(valType(vars['next'])=='object'){if('link'in vars['next']){window.location.href=vars['next']['link']}}},showEnded=function(){if(!CT.loop&&!isUndefined(vars['ended'])){closePauseAd();C['ended']=player.layer(vars['ended']);if(C['ended']){C['centerPlay'].hide()}return}},windowScroll=function(){if(!CT.smallWindows)return;if(CT.webFull||CT.theatre||CT.full){exitSmallWindows();return}var scrollTop=document.documentElement.scrollTop||document.body.scrollTop;if(scrollTop>CT.offset()['top']+CT.getHeight()){if(!CK.hasClass('ckplayer-ckplayer-smallwindow')){CK.addClass('ckplayer-ckplayer-smallwindow');eventTarget('smallWindows',true);smallWindowsState=true;if(vars['smallWindowsDrag']){drag(true)}allBarHide();checkVideoRotate()}}else{exitSmallWindows()}},exitSmallWindows=function(){if(CK.hasClass('ckplayer-ckplayer-smallwindow')){CK.removeClass('ckplayer-ckplayer-smallwindow');if(vars['smallWindowsDrag']){drag()}eventTarget('smallWindows',false);smallWindowsState=false;allBarShow();checkVideoRotate()}},drag=function(state){var doc=$(document);var posX=0,posY=0,posXRecord=0,posYRecord=0;var open=false;if(!isUndefined(state)){open=state}var mouseDown=function(e){e.preventDefault&&e.preventDefault();e=e||window.event;var client=getClient(e);posXRecord=client['x'];posYRecord=client['y'];doc.mousemove(docMouseMove);doc.mouseup(docMouseUp);CK.css({'cursor':'move'})};var docMouseMove=function(e){e=e||window.event;var client=getClient(e);var eleOffset=CK.offset();posY=client['y']-posYRecord;posX=client['x']-posXRecord;posXRecord=client['x'];posYRecord=client['y'];var left=eleOffset['left']+posX;var top=eleOffset['top']+posY;CK.css({'left':left+'px','top':top+'px'});if(CK.css('position')!='fixed'){CK.css({'position':'fixed'})}isDrag=true};var docMouseUp=function(){doc.removeListener('mousemove',docMouseMove);doc.removeListener('mouseup',docMouseUp);CK.css({'cursor':'default'})};if(open){CK.mousedown(mouseDown)}else{CK.unbind('mousedown')}},checkVideoRotate=function(){var ckW=CK.getWidth()*nowZoom*0.01,ckH=CK.getHeight()*nowZoom*0.01;var vW=CV.getWidth(),vH=CV.getHeight();CV.css({'transform':'rotate('+nowRotate+'deg)','-ms-transform':'rotate('+nowRotate+'deg)','-moz-transform':'rotate('+nowRotate+'deg)','-webkit-transform':'rotate('+nowRotate+'deg)','-o-transform':'rotate('+nowRotate+'deg)','width':nowZoom+'%','height':nowZoom+'%'});if(nowRotate!=0&&nowRotate!=180){if(vH>ckW&&vW>ckH){if(vH/ckW>vW/ckH){CV.css({'height':nowZoom+'%','width':ckH+'px'})}else{CV.css({'width':nowZoom+'%','height':ckW+'px'})}return}if(vHckH){CV.css({'height':nowZoom+'%','width':ckH+'px'})}else{if(vH/vW>=ckW/ckH){CV.css({'width':nowZoom+'%','height':ckW+'px'})}else{CV.css({'height':nowZoom+'%','width':ckH+'px'})}}return}if(vH>=ckW&&vW<=ckH){CV.css({'width':nowZoom+'%','height':ckW+'px'});return}if(vW>=ckH&&vHC['bar'].getHeight()){top-=(getBarHeight()-C['bar'].getHeight())}if(w>ew){left=offset['left']-ckOffset['left']-(w-ew)*.5}else{left=offset['left']-ckOffset['left']+(ew-w)*.5}if(align=='left'){left=offset['left']-ckOffset['left']-w;top=offset['top']-ckOffset['top']}if(!isUndefined(cl)){left=cl['x']-ckOffset['left']-w*.5}if(left<0){left=0}if(top<0){top=0}if(left>CM.getWidth()-w){left=CM.getWidth()-w}if(top>CM.getHeight()-h){top=CM.getHeight()-h}C['tip'].css({'left':left+'px','top':top-parseInt(C['tip'].css('margin-bottom'))+'px'})},progressDragX=function(){var bg=C['bar']['pbox']['bg'],play=C['bar']['pbox']['play'],slider=C['bar']['pbox']['slider'],mouseLine=C['bar']['pbox']['mouseLine'];slider.unbind();bg.unbind();var pos=0,posRecord=0;var doc=$(document);var sliderDownTime=0;var sliderMouseDown=function(e){e.preventDefault&&e.preventDefault();if(!vars['timeScheduleAdjust']){return}e=e||window.event;var eleOffset=slider.offset(),bgOffset=bg.offset(),client=getClient(e);pSliderMouseDown=true;posRecord=client['x'];var left=eleOffset['left']-bgOffset['left'];sliderDownTime=left*duration/(bg.getWidth()-slider.getWidth());slider.removeListener('mousedown',sliderMouseDown);slider.removeListener('touchstart',sliderMouseDown);doc.mousemove(docMouseMove);doc.mouseup(docMouseUp);slider.touchmove(docMouseMove);slider.touchend(docMouseUp);noScrolling(true)};var docMouseMove=function(e){e=e||window.event;var eleOffset=slider.offset(),bgOffset=bg.offset(),client=getClient(e);pSliderMouseDown=true;pos=posRecord-client['x'];posRecord=client['x'];var left=eleOffset['left']-pos-bgOffset['left'];if(left<0){left=0}if(left>bg.getWidth()-slider.getWidth()){left=bg.getWidth()-slider.getWidth()}C['bar']['pbox'].addClass('ck-bar-progress-slider-move');var time='';if(!vars['live']){time=left*duration/(bg.getWidth()-slider.getWidth());switch(vars['timeScheduleAdjust']){case 2:if(timesliderDownTime){left=-1000;message(language['timeScheduleAdjust']['prohibitForward']);return}break;case 4:if(timemaxSeeTime){left=-1000;player.seek(maxSeeTime);message(language['timeScheduleAdjust']['prohibitForwardNotViewed']);return}break}time=formatSeconds(time)}else{time=formatLiveTime(left*getLiveTime()/(bg.getWidth()-slider.getWidth()))}tip(slider,time);if(left>=0){slider.css({'left':left+'px'});play.css({'width':left+slider.getWidth()*.5+'px'})}else{pSliderMouseDown=false}};var docMouseUp=function(){noScrolling();doc.removeListener('mousemove',docMouseMove);doc.removeListener('mouseup',docMouseUp);slider.removeListener('touchmove',docMouseMove);slider.removeListener('touchend',docMouseUp);slider.mousedown(sliderMouseDown);slider.touchstart(sliderMouseDown);if(!vars['live']){var time=play.getWidth()*duration/(bg.getWidth()-slider.getWidth()*.5);if(time>duration){time=duration}seekTime=0;player.seek(time)}else{var playbackTime=parseInt(vars['live']+play.getWidth()*getLiveTime()/(bg.getWidth()-slider.getWidth()*.5));eventTarget('playback',{time:playbackTime,date:date('Y-m-d H:i:s',playbackTime)});eventTarget('seek',{time:playbackTime,state:'seeking',date:date('Y-m-d H:i:s',playbackTime)})}C['bar']['pbox'].removeClass('ck-bar-progress-slider-move');if(isMouseLeave){tip()}};var isMouseLeave=true;var sliderMouseOver=function(){var time='';if(!vars['live']){time=formatSeconds(parseInt(slider.css('left'))*duration/(bg.getWidth()-slider.getWidth()))}else{time=language['live']}isMouseLeave=false;tip(slider,time)};var sliderMouseLeave=function(){isMouseLeave=true};slider.mousedown(sliderMouseDown);slider.mouseover(sliderMouseOver);slider.mouseleave(sliderMouseLeave);slider.touchstart(sliderMouseDown);var bgMouseDown=function(e){e=e||window.event;var client=getClient(e);var bgOffset=bg.offset();var w=client['x']-bgOffset['left'];if(CT.full){w+=CK.offset()['left']}if(!vars['live']){var time=duration*w/bg.getWidth();switch(vars['timeScheduleAdjust']){case 0:message(language['timeScheduleAdjust']['prohibit']);return;break;case 2:if(timeoldTime){message(language['timeScheduleAdjust']['prohibitForward']);return}break;case 4:if(timemaxSeeTime){message(language['timeScheduleAdjust']['prohibitForwardNotViewed']);return}break}seekTime=0;player.seek(time)}else{var playbackTime=parseInt(vars['live']+getLiveTime()*w/bg.getWidth());eventTarget('playback',{time:playbackTime,date:date('Y-m-d H:i:s',playbackTime)});eventTarget('seek',{time:playbackTime,state:'seeking',date:date('Y-m-d H:i:s',playbackTime)})}if(w>bg.getWidth()-slider.getWidth()*.5){w=bg.getWidth()-slider.getWidth()*.5}if(wmaxTop){sliderTop=maxTop}slider.css({'top':sliderTop+'px'});var ppMarginTop=sliderTop-minTop+slider.getHeight()*0.5;pp.css({'margin-top':ppMarginTop+'px'});var vol=(bg.getHeight()-ppMarginTop-slider.getHeight()*0.5)/(bg.getHeight()-slider.getHeight());player.volume(vol)};var docMouseUp=function(){noScrolling();doc.removeListener('mousemove',docMouseMove);doc.removeListener('mouseup',docMouseUp);slider.removeListener('touchmove',docMouseMove);slider.removeListener('touchend',docMouseUp);slider.mousedown(sliderMouseDown);slider.touchstart(sliderMouseDown);C['bar']['vbox']['mouseDown']=false};slider.mousedown(sliderMouseDown);slider.touchstart(sliderMouseDown);var bgMouseDown=function(e){e=e||window.event;var client=getClient(e);var bgOffset=bg.offset();var h=client['y']-bgOffset['top'];var max=bg.getHeight();var vol=1-h/max;player.volume(vol)};bg.mousedown(bgMouseDown)},changeProgress=function(time){if((valType(vars['live'])=='boolean'&&vars['live'])){return}if(!pSliderMouseDown){var bg=C['bar']['pbox']['bg'],slider=C['bar']['pbox']['slider'];var playW=(time/duration)*100;if(valType(vars['live'])=='number'){playW='100'}C['bar']['pbox']['play'].css({'width':playW+'%'});var sliderW=(slider.getWidth()/bg.getWidth())*100;var sliderLeft=playW-sliderW*.5;if(sliderLeft<0){sliderLeft=0}if(sliderLeft>100-sliderW){sliderLeft=100-sliderW}C['bar']['pbox']['slider'].css({'left':sliderLeft+'%'});checkProgressSlider()}},checkProgressSlider=function(){var bg=C['bar']['pbox']['bg'],slider=C['bar']['pbox']['slider'];var st=0;if(C['bar']['pbox'].css('transition-duration')){st=parseFloat(C['bar']['pbox'].css('transition-duration'))*1000+20}var checkThis=function(){var sliderLeft=parseInt(C['bar']['pbox']['slider'].css('left'));if(sliderLeft<0){sliderLeft=0;C['bar']['pbox']['slider'].css({'left':sliderLeft+'px'})}if(sliderLeft>bg.getWidth()-slider.getWidth()){sliderLeft=bg.getWidth()-slider.getWidth();C['bar']['pbox']['slider'].css({'left':sliderLeft+'px'})}};setTimeout(checkThis,st)},changeTopTime=function(){C['topBar']['timeEle'].htm(date('H:i:s'));setTimeout(changeTopTime,1000)},changeVolumeSlider=function(vol){if(!isUndefined(C['bar']['vbox'])){var box=C['bar']['vbox']['volume']['box'],bg=C['bar']['vbox']['volume']['bg'],pp=C['bar']['vbox']['volume']['pp'],slider=C['bar']['vbox']['volume']['slider'];C['bar']['vbox']['volume']['txt'].htm(parseInt(vol*100));var bgH=bg.getHeight();if(bgH){var ppMarginTop=bgH-vol*bgH;pp.css({'margin-top':ppMarginTop+'px'});var sliderTop=bg.offset()['top']-box.offset()['top']+ppMarginTop-slider.getHeight()*0.5;slider.css({'top':sliderTop+'px'})}}},changeLoad=function(){if(video){var len=video.buffered.length;if(len>0){var bufferEnd=video.buffered.end(len-1);if(loadTime=1000){last+=offset;appendFps(fps);fps=0}requestAnimationFrame(step)};var appendFps=function(fps){if(fps!=CT.fps){CT.fps=fps;replaceInformation('fps',fps);eventTarget('fps',fps)}};if(isUndefined(CT.fps)){CT.fps=0}step()},getElement=function(content){var ele=$(content);if(isUndefined(ele))return;if(valType(ele)=='htmlarray'){ele=ele[0]}if(isUndefined(ele.captureParentNode)){ele.captureParentNode=ele.parentNode;ele.prevElement=ele.prev();ele.nextElement=ele.next()}return ele},$=function(obj,eL){var parent=null;if(document){parent=document}if(!isUndefined(eL)){parent=eL}var res=[];if(obj){if(valType(obj)=='htmlobject'||valType(obj)=='object'){res=obj;if(!isUndefined(res.ckplayer)){return res}}else if(valType(obj)=='string'&&obj!=''){switch(obj.substr(0,1)){case'.':obj=obj.substr(1,obj.length);if(parent.getElementsByClassName){res=parent.getElementsByClassName(obj);if(!res.length){return null}}else if(!parent&&document.getElementsByClassName){res=document.getElementsByClassName(obj);if(!res.length){return null}}else{var reg=new RegExp(' '+obj+' ','i');var ele=null;if(parent.getElementsByTagName){ele=parent.getElementsByTagName('*')}else{ele=document.getElementsByTagName('*')}for(var i=0;i1){b=arr[1].substr(0,1).toLocaleUpperCase()+arr[1].substr(1,arr[1].length-1)}if(arr.length>2){b=arr[2].substr(0,1).toLocaleUpperCase()+arr[2].substr(1,arr[2].length-1)}return a+b+c}return str};if(isUndefined(value)){if(!isUndefined(key)&&valType(key)=='string'){if(this.currentStyle){return this.currentStyle[key]}else{return document.defaultView.getComputedStyle(this,null)[key]}}if(isUndefined(key)){if(this.currentStyle){return this.currentStyle}else{return document.defaultView.getComputedStyle(this,null)}}}if(valType(key)!='object'){var newKey=keyNew(key);if(this.length>1){for(var i=0;i=m+1){return this[m]}return null}return null};for(var i=0;imaxZ){maxZ=parseInt(temp)}}return maxZ}function getWindowSize(){return{width:window.innerWidth,height:window.innerHeight}}function standardization(o,n){var h={};var k;for(k in o){h[k]=o[k]}for(k in n){if(k in h){h[k]=n[k]}}return h}function mergeObj(o,n){var h={};var k;for(k in o){h[k]=o[k]}for(k in n){if(k in h){switch(valType(h[k])){case'object':if(valType(n[k])=='object'){h[k]=mergeObj(h[k],n[k])}break;default:if(valType(h[k])==valType(n[k])){h[k]=n[k]}break}}}return h}function valType(val){if(typeof val==='undefined')return'undefined';var str=Object.prototype.toString.call(val).split(' ')[1].replace(']','').toLowerCase();if(str.substr(0,4)=='html'&&(str.substr(-7)=='element'||str.substr(-8)=='document'||str=='window')){str='htmlobject'}if(str=='htmlcollection'||str=='nodelist'){str='htmlarray'}return str}function isUndefined(val){try{return valType(val)==='undefined'||val===undefined||val===null||(valType(val)==='number'&&isNaN(val))}catch(event){return true}return false}function prev(ele){var e=ele.previousSibling;if(e==null){return null}if(e.nodeType==3){var t=prev(e);if(t&&t.nodeType==1){return t}}else{if(e.nodeType==1){return e}else{return false}}}function next(ele){var e=ele.nextSibling;if(e==null){return null}if(e.nodeType==3){var t=next(e);if(t&&t.nodeType==1){return t}}else{if(e.nodeType==1){return e}else{return false}}}function addListener(ele,e,f,t){if(isUndefined(t)){t=false}if(ele.addEventListener){try{ele.addEventListener(e,f,t)}catch(event){}}else if(ele.attachEvent){try{ele.attachEvent('on'+e,f)}catch(event){}}else{ele['on'+e]=f}if(isUndefined(ele.listenerList)){ele.listenerList=[]}ele.listenerList.push([e,f]);return ele};function removeListener(ele,e,f,t){if(isUndefined(t)){t=false}if(ele.removeEventListener){try{ele.removeEventListener(e,f,t)}catch(e){}}else if(ele.detachEvent){try{ele.detachEvent('on'+e,f)}catch(e){}}else{ele['on'+e]=null}if(!isUndefined(ele.listenerList)){var temp=[];for(var i=0;i>0},W:function(){var a=f.z(),b=364+f.L()-a;var nd2,nd=(new Date(jsdate.getFullYear()+'/1/1').getDay()||7)-1;if(b<=2&&((jsdate.getDay()||7)-1)<=2-b){return 1}else{if(a<=2&&nd>=4&&a>=(6-nd)){nd2=new Date(jsdate.getFullYear()-1+'/12/31');return date('W',Math.round(nd2.getTime()/1000))}else{return(1+(nd<=3?((a+nd)/7):(a-(7-nd))/7)>>0)}}},F:function(){return txt_months[f.n()]},m:function(){return pad(f.n(),2)},M:function(){return f.F().substr(0,3)},n:function(){return jsdate.getMonth()+1},t:function(){var n;if((n=jsdate.getMonth()+1)==2){return 28+f.L()}else{if(n&1&&n<8||!(n&1)&&n>7){return 31}else{return 30}}},L:function(){var y=f.Y();return(!(y&3)&&(y%1e2||!(y%4e2)))?1:0},Y:function(){return jsdate.getFullYear()},y:function(){return(jsdate.getFullYear()+'').slice(2)},a:function(){return jsdate.getHours()>11?'pm':'am'},A:function(){return f.a().toUpperCase()},B:function(){var off=(jsdate.getTimezoneOffset()+60)*60;var theSeconds=(jsdate.getHours()*3600)+(jsdate.getMinutes()*60)+jsdate.getSeconds()+off;var beat=Math.floor(theSeconds/86.4);if(beat>1000)beat-=1000;if(beat<0)beat+=1000;if((String(beat)).length==1)beat='00'+beat;if((String(beat)).length==2)beat='0'+beat;return beat},g:function(){return jsdate.getHours()%12||12},G:function(){return jsdate.getHours()},h:function(){return pad(f.g(),2)},H:function(){return pad(jsdate.getHours(),2)},i:function(){return pad(jsdate.getMinutes(),2)},s:function(){return pad(jsdate.getSeconds(),2)},O:function(){var t=pad(Math.abs(jsdate.getTimezoneOffset()/60*100),4);if(jsdate.getTimezoneOffset()>0)t='-'+t;else t='+'+t;return t},P:function(){var O=f.O();return(O.substr(0,3)+':'+O.substr(3,2))},c:function(){return f.Y()+'-'+f.m()+'-'+f.d()+'T'+f.h()+':'+f.i()+':'+f.s()+f.P()},U:function(){return Math.round(jsdate.getTime()/1000)}};return format.replace(/([a-zA-Z])/g,function(t,s){var ret='';if(t!=s){ret=s}else if(f[s]){ret=f[s]()}else{ret=s}return ret})}function dataURLtoBlob(dataurl){var arr=dataurl.split(','),mime=arr[0].match(/:(.*?);/)[1],bstr=atob(arr[1]),n=bstr.length,u8arr=new Uint8Array(n);while(n--){u8arr[n]=bstr.charCodeAt(n)}return new Blob([u8arr],{type:mime})}function decodeURIString(obj){for(var k in obj){if(valType(obj[k])=='string'&&obj[k]){try{obj[k]=decodeURI(obj[k])}catch(event){}}if(valType(obj[k])=='object'){obj[k]=decodeURIString(obj[k])}}return obj}function getApp(){var u=navigator.userAgent.toLowerCase();if(u.indexOf('iphone')>-1){return'iphone'}}return ckplayerEmbed})); \ No newline at end of file