PageSourceSearch

https://www.octohbay.net/static/ckplayer-RenameForUse/ckplayer.js

js octohbay.net collected 2026-10-04 10:24:56 UTC 209,806 bytes, 6,802 lines download raw bytes

1/*
2	软件名称:ckplayer
3	软件版本:X
4	软件作者:http://www.ckplayer.com
5	---------------------------------------------------------------------------------------------
6	开发说明:
7	使用的主要程序语言:javascript(js)及actionscript3.0(as3.0)(as3.0主要用于flashplayer部分的开发,不在该页面呈现)
8	功能:播放视频
9	特点:兼容HTML5-VIDEO(优先)以及FlashPlayer
10	=====================================================================================================================
11*/
12function ckplayerConfig() {
13	return {
14		flashvars: {}, //用来补充flashvars里的对象
15		languagePath: '', //语言包文件地址
16		stylePath: '', //风格包文件地址
17		config: {
18			fullInteractive: true, //是否开启交互功能
19			delay: 30, //延迟加载视频,单位:毫秒
20			timeFrequency: 100, //计算当前播放时间和加载量的时间频率,单位:毫秒
21			autoLoad: true, //视频是否自动加载
22			loadNext: 0, //多段视频预加载的段数,设置成0则全部加载
23			definition: true, //是否使用清晰度组件
24			smartRemove: true, //是否使用智能清理,使用该功能则在多段时当前播放段之前的段都会被清除出内存,减少对内存的使用
25			bufferTime: 200, //缓存区的长度,单位:毫秒,不要小于10
26			click: true, //是否支持屏幕单击暂停
27			doubleClick: true, //是否支持屏幕双击全屏
28			doubleClickInterval: 200, //判断双击的标准,即二次单击间隔的时间差之内判断为是双击,单位:毫秒
29			keyDown: {
30				space: true, //是否启用空格键切换播放/暂停
31				left: true, //是否启用左方向键快退
32				right: true, //是否启用右方向键快进
33				up: true, //是否支持上方向键增加音量
34				down: true //是否支持下方向键减少音量
35			},
36			timeJump: 10, //快进快退时的秒数
37			volumeJump: 0.1, //音量调整的数量,大于0小于1的小数
38			timeScheduleAdjust: 1, //是否可调节调节栏,0不启用,1是启用,2是只能前进(向右拖动),3是只能后退,4是只能前进但能回到第一次拖动时的位置,5是看过的地方可以随意拖动
39			previewDefaultLoad: true, //预览图片是否默认加载,优点是鼠标第一次经过进度条即可显示预览图片
40			promptSpotTime: false, //提示点文字是否在前面加上对应时间
41			buttonMode: {
42				player: false, //鼠标在播放器上是否显示可点击形态
43				controlBar: false, //鼠标在控制栏上是否显示可点击形态
44				timeSchedule: true, //鼠标在时间进度条上是否显示可点击形态
45				volumeSchedule: true //鼠标在音量调节栏上是否显示可点击形态
46			},
47			liveAndVod: { //直播+点播=回播功能
48				open: false, //是否开启,开启该功能需要设置flashvars里live=true
49				vodTime: 2, //可以回看的整点数
50				start: 'start' //回看请求参数
51			},
52			errorNum: 3, //错误重连次数
53			playCorrect: false, //是否需要错误修正,这是针对rtmp的
54			timeCorrect: true, //http视频播放时间错误纠正,有些因为视频格式的问题导致视频没有实际播放结束视频文件就返回了stop命令
55			m3u8Definition: { //m3u8自动清晰度时按关键字来进行判断
56				//tags:['200k','110k','400k','600k','1000k']
57			},
58			m3u8MaxBufferLength: 30, //m3u8每次缓冲时间,单位:秒数
59			split: ',', //当视频地址采用字符形式并且需要使用逗号或其它符号来切割数组里定义
60			timeStamp: '', //一个地址,用来请求当前时间戳,用于播放器内部时间效准
61			addCallback: 'adPlay,adPause,playOrPause,videoPlay,videoPause,videoMute,videoEscMute,videoClear,changeVolume,fastBack,fastNext,videoSeek,newVideo,getMetaDate,videoRotation,videoBrightness,videoContrast,videoSaturation,videoHue,videoZoom,videoProportion,videoError,addListener,removeListener,addElement,getElement,deleteElement,animate,animateResume,animatePause,deleteAnimate,changeConfig,getConfig,openUrl,fullScreen,quitFullScreen,switchFull,screenshot,custom,changeControlBarShow,getCurrentSrc'
62			//需要支持的事件
63		},
64		menu: { //版权名称支持
65			ckkey: '',
66			name: '',
67			link: '',
68			version: '',
69			domain: '',
70			more: []
71		},
72		style: { //风格部分内容配置,这里主要配置loading和logo以及广告的部分内容
73			loading: {
74				file: 'data:image/swf;base64,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',
75				align: 'center',
76				vAlign: 'middle',
77				offsetX: -100,
78				offsetY: -40
79			},
80			logo: {
81				//file: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFcAAAAUCAYAAAD4BKGuAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAVTSURBVHja1Fl/aJVVGP4cw/mH5tUWi3I53cA0WbeIzMgaq6lQoVawm0S6glHhIKM/TELICotqCxMSGWQRdFfRLEhc9mMxqA0rbdS2wsV0GkZXuaKUWlHvgeeNh7f3u1du3Ft74eGcnXu+c873vD/Pt0nZbDZyZL2gWZAQTBH8IjggeEjgPZASPIB+g/P7EsGT6J/BfHfjHFIv2Jpjj/+dlDskvCm42Jk7X3C7YJOgw/z2oOBGwdEYRW0RVAjOCZ4ugNggqwU3CTLRBJFyQ+xuwVRY14igB78tE9QKpgmeEHwkGKRnq9AeMesHRWwEsYGUxwSdBZ51ecweE4Lct0DsOVjaZvptA8jfC4JfghWpXIJ2jMY+EDShf1pwh6DvX5x1GtpDE43cNFlfhyFWpQ9xd5FgFo3fRi++C+2nCBNBRgU3O6RsEyyEQv4QLMb4CcE9RlFBLqS1WZ6BZ83A35ofVhuvfE5QJrjWebdgCJOx51qM1QgewbMzsO57MDQrB9DeC8ObHd5Xyb2eiNiQQxmtgkZBr+OuZwV7BIcF1RgbF1wTE2MbEccX48VY9sMzBilhTke/m+b1Q9lefpgruI7OsYhIGzPJuAnn3+6EM7vu1YKl5vkrYRSfCGZivCxoMklk7M5j6eFlXyRNRSAvAoFf0Fo/CC7LkbwuQjsZsf0qwbuI9wlYgIqGl6NEzDYibJ/gbmAfxpKoMDRcaSK8xZzjZbK+NMhSYoNSngV5e+ksKXp+JdqZwDDmdpSbsqa9gNAyi5JalSGv3iQ+dtNK9HvI+sNBh2AhvNYVaH+msRtAdsa4ehoKCuQsoP2PY8+kCSkJ5IRWjD2FZ4/BOFSWYv9KhI40eUKQ31CqdnLM1c1OOnHufKSS+iEZvgHNhji8g1yT5VZKdCnHO+ajvrYK/I7GkuSWjwvq8Mzl5M79NF89aCHaBNXmWv0sQVUUZEDwsDnbr2i9s31lKyGuFs7kITEBC+snJaToRYIFrRN0CeYgoSUxJ23WUm85eB41b4IUuIvGtyIMVMY8lzHGMoYworF7J/onKYk10/wVQL6zXYr+Zq9aOEhuXZPDel8Q3If+HMzTeHPKlForEK+mws3SMfH2UMxNLIJbasKsoIQZwVLbKFkN4T1C3HxUMM+EkCAfgjwNV40Y304KriOP+jIHqa+jvYsqnH/kqzKaGCFZxWnoTqooxky8+dHUsOGwr6Jf
81i9jmlVVTHGLnot9L3qGWqCToWYYRF5fDa96mtb93yI2g8B0IWxlTHWmi/hOG00D4mEJfJ5WhQX7ySCsDUaNkJeud6+sgXCgs3OLEG2/xdZSh10JBeiB1zQU0HuQdSib60rOdm9kFToIL8hmFiRHzm1YM0ylet5k579OFpcUk4I0oD0/QuJ7tcBy5ERY6ixdrh5uNwN3bUV7pd4E+J958HmPxbRRydqK/in6vxj5aH9din/udEPKtuU1GqBL24xJwBInQWiHLcbQVKBXTzkVpHP0tWHsIpZUqPeWcrScXuX2ImRkqlufBhdQl15ig3WLKH0/SeAmtD+uprBqGx1ThhlWN5LKG4lcNKbDblFDjVDU0wWK7yLLqnPNk6cKzKsfXt1GQmQQXSuwymhd3tr9lkvPJMUV152kc2PsmUEMxtzdPRk2SNX2DQ3Vhr02Is18LXjHVAz/bG0NEK8johus3UBiwyfkYlDkQUyLaWrwZBrbHMaB8Z3PJLaYk8IIVKKPSJdxbv3ecynNzLNr33GKLV1YVW4IyfycXfq0UxP4X5HJdXCqX4Wv0AKqYkkipw4LG6WxMNi+GhAtH+M/K8wVe7wuWvwQYAFT+UsGCXmX3AAAAAElFTkSuQmCC',
82				file:'',
83				align: 'right',
84				vAlign: 'top',
85				offsetX: -100,
86				offsetY: 10
87			},
88			advertisement: { //广告相关的配置
89				time: 5, //广告默认播放时长以及多个广告时每个广告默认播放时间,单位:秒
90				method: 'get', //广告监测地址默认请求方式,get/post
91				videoForce: false, //频广告是否强制播放结束
92				videoVolume: 0.8, //视频音量
93				skipButtonShow: true, //是否显示跳过广告按钮
94				linkButtonShow: true, //是否显示广告链接按钮,如果选择显示,只有在提供了广告链接地址时才会显示
95				muteButtonShow: true, //是否显示跳过广告按钮
96				closeButtonShow: true, //暂停时是否显示关闭广告按钮
97				closeOtherButtonShow: true, //其它广告是否需要关闭广告按钮
98				frontSkipButtonDelay: 0, //前置广告跳过广告按钮延时显示的时间,单位:秒
99				insertSkipButtonDelay: 0, //插入广告跳过广告按钮延时显示的时间,单位:秒
100				endSkipButtonDelay: 0, //后置广告跳过广告按钮延时显示的时间,单位:秒
101				frontStretched: 2, //前置广告拉伸方式,0=原始大小,1=自动缩放,2=只有当广告的宽或高大于播放器宽高时才进行缩放,3=参考播放器宽高,4=宽度参考播放器宽、高度自动,5=高度参考播放器高、宽度自动
102				insertStretched: 2, //插入广告拉伸方式,0=原始大小,1=自动缩放,2=只有当广告的宽或高大于播放器宽高时才进行缩放,3=参考播放器宽高,4=宽度参考播放器宽、高度自动,5=高度参考播放器高、宽度自动
103				pauseStretched: 2, //暂停广告拉伸方式,0=原始大小,1=自动缩放,2=只有当广告的宽或高大于播放器宽高时才进行缩放,3=参考播放器宽高,4=宽度参考播放器宽、高度自动,5=高度参考播放器高、宽度自动
104				endStretched: 2 //结束广告拉伸方式,0=原始大小,1=自动缩放,2=只有当广告的宽或高大于播放器宽高时才进行缩放,3=参考播放器宽高,4=宽度参考播放器宽、高度自动,5=高度参考播放器高、宽度自动
105			},
106			video: { //视频的默认比例
107				defaultWidth: 4, //宽度
108				defaultHeight: 3 //高度
109			}
110		}
111	};
112}
113!(function() {
114	var javascriptPath = '';
115	! function() {
116		var scriptList = document.scripts,
117			thisPath = scriptList[scriptList.length - 1].src;
118		javascriptPath = thisPath.substring(0, thisPath.lastIndexOf('/') + 1);
119	}();
120	var ckplayer = function(obj) {
121		/*
122			javascript部分开发所用的注释说明:
123			1:初始化-程序调用时即运行的代码部分
124			2:定义样式-定义容器(div,p,canvas等)的样式表,即css
125			3:监听动作-监听元素节点(单击-click,鼠标进入-mouseover,鼠标离开-mouseout,鼠标移动-mousemove等)事件
126			4:监听事件-监听视频的状态(播放,暂停,全屏,音量调节等)事件
127			5:共用函数-这类函数在外部也可以使用
128			6:全局变量-定义成全局使用的变量
129			7:其它相关注释
130			全局变量说明:
131			在本软件中所使用到的全局变量(变量(类型)包括Boolean,String,Int,Object(包含元素对象和变量对象),Array,Function等)
132			下面列出重要的全局变量:
133				V:Object:视频对象
134				VA:Array:视频列表(包括视频地址,类型,清晰度说明)
135				ID:String:视频ID
136				CB:Object:控制栏各元素的集合对象
137				PD:Object:内部视频容器对象
138			---------------------------------------------------------------------------------------------
139			程序开始
140			下面为需要初始化配置的全局变量
141			初始化配置
142			config:全局变量/变量类型:Object/功能:定义一些基本配置
143		*/
144		this.config = {
145			videoClick: true, //是否支持单击播放/暂停动作
146			videoDbClick: true, //是否支持双击全屏/退出全屏动作
147			errorTime: 100, //延迟判断失败的时间,单位:毫秒
148			videoDrawImage: false //是否使用视频drawImage功能,注意,该功能在移动端表现不了
149		};
150		//全局变量/变量类型:Object/功能:播放器默认配置,在外部传递过来相应配置后,则进行相关替换
151		this.varsConfig = {
152			playerID: '', //播放器ID
153			container: '', //视频容器的ID
154			variable: 'ckplayer', //播放函数(变量)名称
155			volume: 0.8, //默认音量,范围0-1
156			poster: '', //封面图片地址
157			autoplay: false, //是否自动播放
158			loop: false, //是否需要循环播放
159			live: false, //是否是直播
160			duration: 0, //指定总时间
161			seek: 0, //默认需要跳转的秒数
162			drag: '', //拖动时支持的前置参数
163			front: '', //前一集按钮动作
164			next: '', //下一集按钮动作
165			loaded: '', //加载播放器后调用的函数
166			flashplayer: false, //设置成true则强制使用flashplayer
167			html5m3u8: false, //PC平台上是否使用h5播放器播放m3u8
168			track: null, //字幕轨道
169			cktrack: null, //ck字幕
170			preview: null, //预览图片对象
171			prompt: null, //提示点功能
172			video: null, //视频地址
173			config: '', //调用配置函数名称
174			type: '', //视频格式
175			crossorigin: '', //设置html5视频的crossOrigin属性
176			crossdomain: '', //安全策略文件地址
177			unescape: false, //默认flashplayer里需要解码
178			mobileCkControls: false, //移动端h5显示控制栏
179			playbackrate: 1, //默认倍速
180			debug: false //是否开启调试模式
181		};
182		this.vars = {};
183		//全局变量/变量类型:Object/功能:语言配置
184		this.language = {
185			volume: '音量:',
186			play: '点击播放',
187			pause: '点击暂停',
188			full: '点击全屏',
189			escFull: '退出全屏',
190			mute: '点击静音',
191			escMute: '取消静音',
192			front: '上一集',
193			next: '下一集',
194			definition: '点击选择清晰度',
195			playbackRate: '点击选择速度',
196			error: '加载出错'
197		};
198		//全局变量/变量类型:Array/功能:右键菜单:[菜单标题,类型(link:链接,default:灰色,function:调用函数,javascript:调用js函数),执行内容(包含链接地址,函数名称),[line(间隔线)]]
199		this.contextMenu = [
200			['ckplayer', 'link', 'http://www.ckplayer.com'],
201			['version:X', 'default', 'line']
202		];
203		//全局变量/变量类型:Array/功能:错误列表
204		this.errorList = [
205			['000', 'Object does not exist'],
206			['001', 'Variables type is not a object'],
207			['002', 'Video object does not exist'],
208			['003', 'Video object format error'],
209			['004', 'Video object format error'],
210			['005', 'Video object format error'],
211			['006', '[error] does not exist '],
212			['007', 'Ajax error'],
213			['008', 'Ajax error'],
214			['009', 'Ajax object format error'],
215			['010', 'Ajax.status:[error]']
216		];
217		//全局变量/变量类型:Array/功能:HTML5变速播放的值数组/如果不需要可以设置成null
218		this.playbackRateArr = [
219			[0.5, '0.5倍'],
220			[1, '正常'],
221			[1.25, '1.25倍'],
222			[1.5, '1.5倍'],
223			[2, '2倍速'],
224			[4, '4倍速']
225		];
226		//全局变量/变量类型:Array/功能:HTML5默认变速播放的值
227		this.playbackRateDefault = 1;
228		//全局变量/变量类型:String/功能:定义logo
229		this.logo = '';
230		//全局变量/变量类型:Boolean/功能:是否加载了播放器
231		this.loaded = false;
232		//全局变量/变量类型:计时器/功能:监听视频加载出错的状态
233		this.timerError = null;
234		//全局变量/变量类型:Boolean/功能:是否出错
235		this.error = false;
236		//全局变量/变量类型:Array/功能:出错地址的数组
237		this.errorUrl = [];
238		//全局变量/变量类型:计时器/功能:监听全屏与非全屏状态
239		this.timerFull = null;
240		//全局变量/变量类型:Boolean/功能:是否全屏状态
241		this.full = false;
242		//全局变量/变量类型:计时器/功能:监听当前的月/日 时=分=秒
243		this.timerTime = null;
244		//全局变量/变量类型:计时器/功能:监听视频加载
245		this.timerBuffer = null;
246		//全局变量/变量类型:Boolean/功能:设置进度按钮及进度条是否跟着时间变化,该属性主要用来在按下进度按钮时暂停进度按钮移动和进度条的长度变化
247		this.isTimeButtonMove = true;
248		//全局变量/变量类型:Boolean/功能:进度栏是否有效,如果是直播,则不需要监听时间让进度按钮和进度条变化
249		this.isTimeButtonDown = false;
250		//全局变量/变量类型:Boolean/功能:用来模拟双击功能的判断
251		this.isClick = false;
252		//全局变量/变量类型:计时器/功能:用来模拟双击功能的计时器
253		this.timerClick = null;
254		//全局变量/变量类型:计时器/功能:旋转loading
255		this.timerLoading = null;
256		//全局变量/变量类型:计时器/功能:监听鼠标在视频上移动显示控制栏
257		this.timerCBar = null;
258		//全局变量/变量类型:Int/功能:播放视频时如果该变量的值大于0,则进行跳转后设置该值为0
259		this.needSeek = 0;
260		//全局变量/变量类型:Int/功能:当前音量
261		this.volume = 0;
262		//全局变量/变量类型:Int/功能:静音时保存临时音量
263		this.volumeTemp = 0;
264		//全局变量/变量类型:Number/功能:当前播放时间
265		this.time = 0;
266		//全局变量/变量类型:Boolean/功能:定义首次调用
267		this.isFirst = true;
268		//全局变量/变量类型:Boolean/功能:是否使用HTML5-VIDEO播放
269		this.html5Video = true;
270		//全局变量/变量类型:Object/功能:记录视频容器节点的x;y
271		this.pdCoor = {
272			x: 0,
273			y: 0
274		};
275		//全局变量/变量类型:String/功能:判断当前使用的播放器类型,html5video或flashplayer
276		this.playerType = '';
277		//全局变量/变量类型:Int/功能:加载进度条的长度
278		this.loadTime = 0;
279		//全局变量/body对象
280		this.body = document.body || document.documentElement;
281		//全局变量/V/播放器
282		this.V = null;
283		//全局变量/保存外部js监听事件数组
284		this.listenerJsArr = [];
285		//全局变量/保存控制栏显示元素的总宽度
286		this.buttonLen = 0;
287		//全局变量/保存控制栏显示元素的数组
288		this.buttonArr = [];
289		//全局变量/保存按钮元素的宽
290		this.buttonWidth = {};
291		//全局变量/保存播放器上新增元件的数组
292		this.elementArr = [];
293		//全局变量/字幕内容
294		this.track = [];
295		//全局变量/字幕索引
296		this.trackIndex = 0;
297		//全局变量/当前显示的字幕内容
298		this.nowTrackShow = {
299			sn: ''
300		};
301		//全局变量/保存字幕元件数组
302		this.trackElement = [];
303		//全局变量/将视频转换为图片
304		this.timerVCanvas = null;
305		//全局变量/animate
306		this.animateArray = [];
307		//全局变量/保存animate的元件
308		this.animateElementArray = [];
309		//全局变量/保存需要在暂停时停止缓动的数组
310		this.animatePauseArray = [];
311		//全局变量/预览图片加载状态/0=没有加载,1=正在加载,2=加载完成
312		this.previewStart = 0;
313		//全局变量/预览图片容器
314		this.previewDiv = null;
315		//全局变量/预览框
316		this.previewTop = null;
317		//全局变量/预览框的宽
318		this.previewWidth = 120;
319		//全局变量/预览图片容器缓动函数
320		this.previewTween = null;
321		//全局变量/是否是m3u8格式,是的话则可以加载hls.js
322		this.isM3u8 = false;
323		//全局变量/保存提示点数组
324		this.promptArr = [];
325		//全局变量/显示提示点文件的容器
326		this.promptElement = null;
327		//配置文件函数
328		this.ckplayerConfig = {};
329		//控制栏是否显示
330		this.showFace = true;
331		//是否监听过h5的错误
332		this.errorAdd = false;
333		//是否发送了错误
334		this.errorSend = false;
335		//控制栏是否隐藏
336		this.controlBarIsShow = true;
337		//字体
338		this.fontFamily = '"Microsoft YaHei"; YaHei; "\5FAE\8F6F\96C5\9ED1"; SimHei; "\9ED1\4F53";Arial';
339		//记录第一次拖动进度按钮时的位置
340		this.timeSliderLeftTemp = 0;
341
342		// 默认调用
343		if(obj) {
344			this.embed(obj);
345		}
346	};
347	
348	ckplayer.prototype = {
349		/*
350			主要函数部分开始
351			主接口函数:
352			调用播放器需初始化该函数
353		*/
354		embed: function(c) {
355			//c:Object:是调用接口传递的属性对象
356			if(window.location.href.substr(0, 7) == 'file://') {
357				alert('Please use the HTTP protocol to open the page');
358				return;
359			}
360			if(c == undefined || !c) {
361				this.eject(this.errorList[0]);
362				return;
363			}
364			if(typeof(c) != 'object') {
365				this.eject(this.errorList[1]);
366			}
367			this.vars = this.standardization(this.varsConfig, c);
368
369			if(!this.vars['mobileCkControls'] && this.isMobile()) {
370				this.vars['flashplayer'] = false;
371				this.showFace = false;
372			}
373			var videoString = this.vars['video'];
374			// 视频路径
375			if(!videoString) {
376				this.eject(this.errorList[2]);
377				return;
378			}
379			// 添加 iframe
380			var thirdUrl =["my.tv.sohu.com","sohu.com","qq.com","youtube.com",'youku.com','tudou.com','iqiyi.com','bilibili.com'];
381			var isThirdUrl = (function(){
382				for(var i =0; i < thirdUrl.length; i++){
383					if(videoString.indexOf(thirdUrl[i]) > -1){
384						return true;
385					}
386				}
387				return false;
388			})();
389			if (isThirdUrl){
390				var iframebox = document.getElementById( this.vars['container'].substring(1));
391				iframebox.innerHTML = "<iframe id='third-iframe'  src='"+videoString+"' style='position:absolute;left:0;top:0;z-index:50;width:100%;height:100%;' frameborder=0 width='100%' height='100%' scrolling='no' allowfullscreen></iframe>";
392				// 设置高度
393				var iframeDom =  document.getElementById('third-iframe');
394				iframeDom.onload = function(){
395					try{
396						var ofw  = iframebox.clientWidth;
397						var ofh =  iframeDom.contentWindow.document.body.offsetHeight;
398						var bodyH = document.documentElement.clientHeight *0.8; // 可视
399						ofh = ofh > bodyH ?  bodyH: ofh;
400						var ofrate = (ofh/ofw).toFixed(4);
401						iframebox.style.paddingBottom = (ofrate*100)+'%';
402					}catch(err){
403						console.log('error:------------');
404						console.log(err);
405						iframebox.style.minHeight = 200+'px';
406					}
407				}
408				return;
409			}
410			if(typeof(videoString) == 'string') {
411				if(videoString.substr(0, 3) == 'CK:' || videoString.substr(0, 3) == 'CE:' || videoString.substr(8, 3) == 'CK:' || videoString.substr(8, 3) == 'CE:') {
412					this.vars['flashplayer'] = true;
413				}
414			}
415			if(this.vars['config']) {
416				this.ckplayerConfig = eval(this.vars['config'] + '()');
417			} else {
418				this.ckplayerConfig = ckplayerConfig();
419			}
420			if((!this.supportVideo() && this.vars['flashplayer'] != '') || (this.vars['flashplayer'] && this.uploadFlash()) || !this.isMsie()) {
421				this.html5Video = false;
422				this.getVideo();
423			} else if(videoString) {
424				//判断视频数据类型
425				this.analysedVideoUrl(videoString);
426				return this;
427			} else {
428				this.eject(this.errorList[2]);
429			}
430		},
431		/*
432			内部函数
433			根据外部传递过来的video开始分析视频地址
434		*/
435		analysedVideoUrl: function(video) {
436			var i = 0,
437				y = 0;
438			var thisTemp = this;
439			//定义全局变量VA:Array:视频列表(包括视频地址,类型,清晰度说明)
440			this.VA = [];
441			if(typeof(video) == 'string') { //如果是字符形式的则判断后缀进行填充
442				if(video.substr(0, 8) != 'website:') {
443					this.VA = [
444						[video, '', '', 0]
445					];
446					var fileExt = this.getFileExt(video);
447					switch(fileExt) {
448						case '.mp4':
449							this.VA[0][1] = 'video/mp4';
450							break;
451						case '.ogg':
452							this.VA[0][1] = 'video/ogg';
453							break;
454						case '.webm':
455							this.VA[0][1] = 'video/webm';
456							break;
457						default:
458							break;
459					}
460					this.getVideo();
461				} else {
462					if(this.html5Video) {
463						var ajaxObj = {
464							url: video.substr(8),
465							success: function(data) {
466								if(data) {
467									thisTemp.analysedUrl(data);
468								} else {
469									thisTemp.eject(thisTemp.errorList[5]);
470									this.VA = video;
471									thisTemp.getVideo();
472								}
473							}
474						};
475						this.ajax(ajaxObj);
476					} else {
477						this.VA = video;
478						this.getVideo();
479					}
480
481				}
482			} else if(typeof(video) == 'object') { //对象或数组
483				if(!this.isUndefined(typeof(video.length))) { //说明是数组
484					if(!this.isUndefined(typeof(video[0].length))) { //说明是数组形式的数组
485						this.VA = video;
486					}
487					this.getVideo();
488				} else {
489					/*
490						如果video格式是对象形式,则分二种
491						如果video对象里包含type,则直接播放
492					*/
493					if(!this.isUndefined(video['type'])) {
494						this.VA.push([video['file'], video['type'], '', 0]);
495						this.getVideo();
496					} else {
497						this.eject(this.errorList[5]);
498					}
499				}
500			} else {
501				this.eject(this.errorList[4]);
502			}
503		},
504		/*
505			对请求到的视频地址进行重新分析
506		*/
507		analysedUrl: function(data) {
508			this.vars = this.standardization(this.vars, data);
509			if(!this.isUndefined(data['video'])) {
510				this.vars['video'] = data['video'];
511			}
512			this.analysedVideoUrl(this.vars['video']);
513		},
514		/*
515			内部函数
516			检查浏览器支持的视频格式,如果是则将支持的视频格式重新分组给播放列表
517		*/
518		getHtml5Video: function() {
519			var va = this.VA;
520			var nva = [];
521			var mobile = false;
522			var video = document.createElement('video');
523			var codecs = function(type) {
524				var cod = '';
525				switch(type) {
526					case 'video/mp4':
527						cod = 'avc1.4D401E, mp4a.40.2';
528						break;
529					case 'video/ogg':
530						cod = 'theora, vorbis';
531						break;
532					case 'video/webm':
533						cod = 'vp8.0, vorbis';
534						break;
535					default:
536						break;
537				}
538				return cod;
539			};
540			var supportType = function(vidType, codType) {
541				if(!video.canPlayType) {
542					this.html5Video = false;
543					return;
544				}
545				var isSupp = video.canPlayType(vidType + ';codecs="' + codType + '"');
546				if(isSupp == '') {
547					return false
548				}
549				return true;
550			};
551			if(this.vars['flashplayer'] || !this.isMsie()) {
552				this.html5Video = false;
553				return;
554			}
555			if(this.isMobile()) {
556				mobile = true;
557			}
558			for(var i = 0; i < va.length; i++) {
559				var v = va[i];
560				if(v) {
561					if(v[1] != '' && !mobile && supportType(v[1], codecs(v[1])) && v[0].substr(0, 4) != 'rtmp') {
562						nva.push(v);
563					}
564					if((this.getFileExt(v[0]) == '.m3u8' || this.vars['type']=='video/m3u8' || this.vars['type']=='m3u8' || v[1]=='video/m3u8' || v[1]=='m3u8') && this.vars['html5m3u8']) {
565						this.isM3u8 = true;
566						nva.push(v);
567					}
568				}
569			}
570			if(nva.length > 0) {
571				this.VA = nva;
572			} else {
573				if(!mobile) {
574					this.html5Video = false;
575				}
576			}
577		},
578		/*
579			内部函数
580			根据视频地址开始构建播放器
581		*/
582		getVideo: function() {
583			//如果存在字幕则加载
584			if(this.V) { //如果播放器已存在,则认为是从newVideo函数发送过来的请求
585				this.changeVideo();
586				return;
587			}
588			if(this.vars['cktrack']) {
589				this.loadTrack();
590			}
591			if(this.supportVideo() && !this.vars['flashplayer']) {
592				this.getHtml5Video(); //判断浏览器支持的视频格式
593			}
594			var thisTemp = this;
595			var v = this.vars;
596			var src = '',
597				source = '',
598				poster = '',
599				loop = '',
600				autoplay = '',
601				track = '';
602			var video = v['video'];
603			var i = 0;
604			this.CD = this.getByElement(v['container']);
605			volume = v['volume'];
606			if(!this.CD) {
607				this.eject(this.errorList[6], v['container']);
608				return false;
609			}
610			//开始构建播放容器
611			var playerID = 'ckplayer' + this.randomString();
612			var playerDiv = document.createElement('div');
613			playerDiv.className = playerID;
614			this.V = undefined;
615			this.CD.innerHTML = '';
616			this.CD.appendChild(playerDiv);
617			this.PD = this.getByElement(playerID); //PD:定义播放器容器对象全局变量
618			this.css(this.CD, {
619				backgroundColor: '#000000',
620				overflow: 'hidden',
621				position: 'relative'
622			});
623			this.css(this.PD, {
624				backgroundColor: '#000000',
625				width: '100%',
626				height: '100%',
627				fontFamily: this.fontFamily
628			});
629			if(this.html5Video) { //如果支持HTML5-VIDEO则默认使用HTML5-VIDEO播放器
630				//禁止播放器容器上鼠标选择文本
631				this.PD.onselectstart = this.PD.ondrag = function() {
632					return false;
633				};
634				//播放容器构建完成并且设置好样式
635				//构建播放器
636				if(this.VA.length == 1) {
637					src = ' src="' + decodeURIComponent(this.VA[0][0]) + '"';
638				} else {
639					var videoArr = this.VA.slice(0);
640					videoArr = this.arrSort(videoArr);
641					for(i = 0; i < videoArr.length; i++) {
642						var type = '';
643						var va = videoArr[i];
644						if(va[1]) {
645							type = ' type="' + va[1] + '"';
646							if(type == ' type="video/m3u8"' || type == ' type="m3u8"') {
647								type = '';
648							}
649						}
650						source += '<source src="' + decodeURIComponent(va[0]) + '"' + type + '>';
651					}
652				}
653				//分析视频地址结束
654				if(v['autoplay']) {
655					autoplay = ' autoplay="autoplay"';
656				}
657				if(v['poster']) {
658					poster = ' poster="' + v['poster'] + '"';
659				}
660				if(v['loop']) {
661					loop = ' loop="loop"';
662				}
663				if(v['seek'] > 0) {
664					this.needSeek = v['seek'];
665				}
666				if(v['track'] != null && v['cktrack'] == null) {
667					var trackArr = v['track'];
668					var trackDefault = '';
669					var defaultHave = false;
670					for(i = 0; i < trackArr.length; i++) {
671						var trackObj = trackArr[i];
672						if(trackObj['default'] && !defaultHave) {
673							trackDefault = ' default';
674							defaultHave = true;
675						} else {
676							trackDefault = '';
677						}
678						track += '<track kind="' + trackObj['kind'] + '" src="' + trackObj['src'] + '" srclang="' + trackObj['srclang'] + '" label="' + trackObj['label'] + '"' + trackDefault + '>';
679					}
680				}
681				var autoLoad = this.ckplayerConfig['config']['autoLoad'];
682				var preload = '';
683				if(!autoLoad) {
684					preload = ' preload="meta"';
685				}
686				var vid = this.randomString();
687				var controls = '';
688				if(!this.showFace) {
689					controls = ' controls="controls"';
690				}
691				var html = '';
692				if(!this.isM3u8) {
693					html = '<video id="' + vid + '"' + src + ' width="100%" height="100%"' + autoplay + poster + loop + preload + controls + ' x5-playsinline="" playsinline="" webkit-playsinline="true">' + source + track + '</video>';
694				} else {
695					html = '<video id="' + vid + '" width="100%" height="100%"' + poster + loop + preload + controls + ' x5-playsinline="" playsinline="" webkit-playsinline="true">' + track + '</video>';
696				}
697				this.PD.innerHTML = html;
698				this.V = this.getByElement('#' + vid); //V:定义播放器对象全局变量
699				if(this.vars['crossorigin']) {
700					this.V.crossOrigin = this.vars['crossorigin'];
701				}
702				try {
703					this.V.volume = volume; //定义音量
704					if(this.playbackRateArr && this.vars['playbackrate'] > -1) {
705						if(this.vars['playbackrate'] < this.playbackRateArr.length) {
706							this.playbackRateDefault = this.vars['playbackrate'];
707						}
708						this.V.playbackRate = this.playbackRateArr[this.playbackRateDefault][0]; //定义倍速
709					}
710				} catch(error) {}
711				this.css(this.V, {
712					width: '100%',
713					height: '100%'
714				});
715				if(this.isM3u8) {
716					var loadJsHandler = function() {
717						thisTemp.embedHls(thisTemp.VA[0][0], v['autoplay']);
718					};
719					this.loadJs(javascriptPath + 'hls/hls.min.js', loadJsHandler);
720				}
721				this.css(this.V, 'backgroundColor', '#000000');
722				//创建一个画布容器
723				if(this.config['videoDrawImage']) {
724					var canvasID = 'vcanvas' + this.randomString();
725					var canvasDiv = document.createElement('div');
726					canvasDiv.className = canvasID;
727					this.PD.appendChild(canvasDiv);
728					this.MD = this.getByElement(canvasID); //定义画布存储容器
729					this.css(this.MD, {
730						backgroundColor: '#000000',
731						width: '100%',
732						height: '100%',
733						position: 'absolute',
734						display: 'none',
735						cursor: 'pointer',
736						left: '0px',
737						top: '0px',
738						zIndex: '10'
739					});
740					var cvid = 'ccanvas' + this.randomString();
741					this.MD.innerHTML = this.newCanvas(cvid, this.PD.offsetWidth, this.PD.offsetHeight);
742					this.MDC = this.getByElement(cvid + '-canvas');
743					this.MDCX = this.MDC.getContext('2d');
744				}
745				this.playerType = 'html5video';
746				//播放器构建完成并且设置好样式
747				//建立播放器的监听函数,包含操作监听及事件监听
748				this.addVEvent();
749				//根据清晰度的值构建清晰度切换按钮
750				if(this.showFace) {
751					this.definition();
752					if(!this.vars['live'] && this.playbackRateArr && this.vars['playbackrate'] > -1) {
753						this.playbackRate();
754					}
755					if(v['autoplay']) {
756						this.loadingStart(true);
757					}
758				}
759				this.playerLoad();
760			} else { //如果不支持HTML5-VIDEO则调用flashplayer
761				this.embedSWF();
762			}
763		},
764		/*
765			内部函数
766			发送播放器加载成功的消息
767		*/
768		playerLoad: function() {
769			var thisTemp = this;
770			if(this.isFirst) {
771				this.isFirst = false;
772				window.setTimeout(function() {
773					thisTemp.loadedHandler();
774				}, 1);
775			}
776		},
777		/*
778			内部函数
779			建立播放器的监听函数,包含操作监听及事件监听
780		*/
781		addVEvent: function() {
782			var thisTemp = this;
783			//监听视频单击事件
784			var eventVideoClick = function(event) {
785				thisTemp.videoClick();
786			};
787			this.addListenerInside('click', eventVideoClick);
788			this.addListenerInside('click', eventVideoClick, this.MDC);
789			//延迟计算加载失败事件
790			this.timerErrorFun();
791			//监听视频加载到元数据事件
792			var eventJudgeIsLive = function(event) {
793				thisTemp.sendJS('loadedmetadata');
794				thisTemp.sendJS('duration', thisTemp.V.duration);
795				thisTemp.judgeIsLive();
796			};
797			this.addListenerInside('loadedmetadata', eventJudgeIsLive);
798			//监听视频播放事件
799			var eventPlaying = function(event) {
800				thisTemp.playingHandler();
801				thisTemp.sendJS('play');
802				thisTemp.sendJS('paused', false);
803			};
804			this.addListenerInside('playing', eventPlaying);
805			//监听视频暂停事件
806			var eventPause = function(event) {
807				thisTemp.pauseHandler();
808				thisTemp.sendJS('pause');
809				thisTemp.sendJS('paused', true);
810			};
811			this.addListenerInside('pause', eventPause);
812			//监听视频播放时间事件
813			var eventTimeupdate = function(event) {
814				if(thisTemp.timerLoading != null) {
815					thisTemp.loadingStart(false);
816				}
817				if(thisTemp.time) {
818					thisTemp.sendJS('time', thisTemp.time);
819				}
820			};
821			this.addListenerInside('timeupdate', eventTimeupdate);
822			//监听视频缓冲事件
823			var eventWaiting = function(event) {
824				thisTemp.loadingStart(true);
825			};
826			this.addListenerInside('waiting', eventWaiting);
827			//监听视频seek开始事件
828			var eventSeeking = function(event) {
829				thisTemp.sendJS('seek', 'start');
830			};
831			this.addListenerInside('seeking', eventSeeking);
832			//监听视频seek结束事件
833			var eventSeeked = function(event) {
834				thisTemp.seekedHandler();
835				thisTemp.sendJS('seek', 'ended');
836			};
837			this.addListenerInside('seeked', eventSeeked);
838			//监听视频播放结束事件
839			var eventEnded = function(event) {
840				thisTemp.endedHandler();
841				thisTemp.sendJS('ended');
842			};
843			this.addListenerInside('ended', eventEnded);
844			//监听视频音量
845			var eventVolumeChange = function(event) {
846				try {
847					thisTemp.volumechangeHandler();
848					thisTemp.sendJS('volume', thisTemp.volume || thisTemp.V.volume);
849				} catch(event) {}
850			};
851			this.addListenerInside('volumechange', eventVolumeChange);
852			//监听全屏事件
853			var eventFullChange = function(event) {
854				var fullState = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen;
855				thisTemp.sendJS('full', fullState);
856			};
857			this.addListenerInside('fullscreenchange', eventFullChange);
858			this.addListenerInside('webkitfullscreenchange', eventFullChange);
859			this.addListenerInside('mozfullscreenchange', eventFullChange);
860			//建立界面
861			if(this.showFace) {
862				this.interFace();
863			}
864		},
865		/*
866			内部函数
867			重置界面元素
868		*/
869		resetPlayer: function() {
870			this.timeTextHandler();
871			if(this.showFace) {
872				this.timeProgress(0, 1); //改变时间进度条宽
873				this.changeLoad(0);
874				this.initPlayPause(); //判断显示播放或暂停按钮
875				this.definition(); //构建清晰度按钮
876				this.showFrontNext(); //构建上一集下一集按钮
877				this.deletePrompt(); //删除提示点
878				this.deletePreview(); //删除预览图
879				this.trackHide(); //重置字幕
880				this.resetTrack();
881				this.trackElement = [];
882				this.track = [];
883			}
884		},
885		/*
886			内部函数
887			构建界面元素
888		 */
889		interFace: function() {
890			this.showFace = true;
891			var thisTemp = this;
892			var html = ''; //控制栏内容
893			var i = 0;
894			var bWidth = 38, //按钮的宽
895				bHeight = 38; //按钮的高
896			var bBgColor = '#FFFFFF', //按钮元素默认颜色
897				bOverColor = '#0782F5'; //按钮元素鼠标经过时的颜色
898			var timeInto = this.formatTime(0) + ' / ' + this.formatTime(this.vars['duration']); //时间显示框默认显示内容
899			var randomS = this.randomString(10); //获取一个随机字符串
900			/*
901				以下定义界面各元素的ID,统一以ID结束
902			*/
903			var controlBarBgID = 'controlbgbar' + randomS, //控制栏背景
904				controlBarID = 'controlbar' + randomS, //控制栏容器
905				timeProgressBgID = 'timeprogressbg' + randomS, //播放进度条背景
906				loadProgressID = 'loadprogress' + randomS, //加载进度条
907				timeProgressID = 'timeprogress' + randomS, //播放进度条
908				timeBOBGID = 'timebobg' + randomS, //播放进度按钮容器,该元素为一个透明覆盖在播放进度条上
909				timeBOID = 'timebo' + randomS, //播放进度可拖动按钮外框
910				timeBWID = 'timebw' + randomS, //播放进度可拖动按钮内框
911				timeTextID = 'timetext' + randomS, //时间文本框
912				playID = 'play' + randomS, //播放按钮
913				pauseID = 'pause' + randomS, //暂停按钮
914				frontID = 'front' + randomS, //前一集按钮
915				nextID = 'next' + randomS, //下一集按钮
916				fullID = 'full' + randomS, //全屏按钮
917				escFullID = 'escfull' + randomS, //退出全屏按钮
918				muteID = 'mute' + randomS, //静音按钮
919				escMuteID = 'escmute' + randomS, //取消静音按钮				
920				volumeID = 'volume' + randomS, //音量调节框容器
921				volumeDbgID = 'volumedbg' + randomS, //音量调节框容器背景
922				volumeBgID = 'volumebg' + randomS, //音量调节框背景层
923				volumeUpID = 'volumeup' + randomS, //音量调节框可变宽度层
924				volumeBOID = 'volumebo' + randomS, //音量调节按钮外框
925				volumeBWID = 'volumebw' + randomS, //音量调节按钮内框
926				definitionID = 'definition' + randomS, //清晰度容器
927				definitionPID = 'definitionp' + randomS, //清晰度列表容器
928				playbackRateID = 'playbackrate' + randomS, //清晰度容器
929				playbackRatePID = 'playbackratep' + randomS, //清晰度列表容器
930				promptBgID = 'promptbg' + randomS, //提示框背景
931				promptID = 'prompt' + randomS, //提示框
932				dlineID = 'dline' + randomS, //分隔线共用前缀
933				menuID = 'menu' + randomS, //右键容器
934				pauseCenterID = 'pausecenter' + randomS, //中间暂停按钮
935				loadingID = 'loading' + randomS, //缓冲
936				errorTextID = 'errortext' + randomS, //错误文本框
937				logoID = 'logo' + randomS; //logo
938			//构建一些PD(播放器容器)里使用的元素
939			var controlBarBg = document.createElement('div'),
940				controlBar = document.createElement('div'),
941				timeProgressBg = document.createElement('div'),
942				timeBoBg = document.createElement('div'),
943				pauseCenter = document.createElement('div'),
944				errorText = document.createElement('div'),
945				promptBg = document.createElement('div'),
946				prompt = document.createElement('div'),
947				menuDiv = document.createElement('div'),
948				definitionP = document.createElement('div'),
949				playbackrateP = document.createElement('div'),
950				loading = document.createElement('div'),
951				logo = document.createElement('div');
952
953			controlBarBg.className = controlBarBgID;
954			controlBar.className = controlBarID;
955			timeProgressBg.className = timeProgressBgID;
956			timeBoBg.className = timeBOBGID;
957			promptBg.className = promptBgID;
958			prompt.className = promptID;
959			menuDiv.className = menuID;
960			definitionP.className = definitionPID;
961			definitionP.id = 'definitionSelect';
962			playbackrateP.className = playbackRatePID;
963			pauseCenter.className = pauseCenterID;
964			loading.className = loadingID;
965			logo.className = logoID;
966			errorText.className = errorTextID;
967
968			this.PD.appendChild(controlBarBg);
969			this.PD.appendChild(controlBar);
970			this.PD.appendChild(timeProgressBg);
971			this.PD.appendChild(timeBoBg);
972			this.PD.appendChild(promptBg);
973			this.PD.appendChild(prompt);
974			this.PD.appendChild(definitionP);
975			this.PD.appendChild(playbackrateP);
976			this.PD.appendChild(pauseCenter);
977
978			this.PD.appendChild(loading);
979			this.PD.appendChild(errorText);
980			this.PD.appendChild(logo);
981			this.body.appendChild(menuDiv);
982			//构建一些PD(播放器容器)里使用的元素结束
983
984			if(this.vars['live']) { //如果是直播,时间显示文本框里显示当前系统时间
985				timeInto = this.getNowDate();
986			}
987			//构建控制栏的内容
988			html += '<div class="' + playID + '" data-title="' + thisTemp.language['play'] + '">' + this.newCanvas(playID, bWidth, bHeight) + '</div>'; //播放按钮
989			html += '<div class="' + pauseID + '" data-title="' + thisTemp.language['pause'] + '">' + this.newCanvas(pauseID, bWidth, bHeight) + '</div>'; //暂停按钮
990			html += '<div class="' + dlineID + '-la"></div>'; //分隔线
991			html += '<div class="' + frontID + '" data-title="' + thisTemp.language['front'] + '">' + this.newCanvas(frontID, bWidth, bHeight) + '</div>'; //前一集按钮
992			html += '<div class="' + dlineID + '-lb"></div>'; //分隔线
993			html += '<div class="' + nextID + '" data-title="' + thisTemp.language['next'] + '">' + this.newCanvas(nextID, bWidth, bHeight) + '</div>'; //下一集按钮
994			html += '<div class="' + dlineID + '-lc"></div>'; //分隔线
995
996			html += '<div class="' + timeTextID + '">' + timeInto + '</div>';
996 //时间文本
997			html += '<div class="' + fullID + '" data-title="' + thisTemp.language['full'] + '">' + this.newCanvas(fullID, bWidth, bHeight) + '</div>'; //全屏按钮
998			html += '<div class="' + escFullID + '" data-title="' + thisTemp.language['escFull'] + '">' + this.newCanvas(escFullID, bWidth, bHeight) + '</div>'; //退出全屏按钮
999			html += '<div class="' + dlineID + '-ra"></div>'; //分隔线
1000			html += '<div class="' + definitionID + '" data-title="' + thisTemp.language['definition'] + '"></div>'; //清晰度容器
1001			html += '<div class="' + dlineID + '-rb"></div>'; //分隔线
1002			html += '<div class="' + playbackRateID + '" data-title="' + thisTemp.language['playbackRate'] + '"></div>'; //倍速
1003			html += '<div class="' + dlineID + '-rc"></div>'; //分隔线
1004			html += '<div class="' + volumeID + '"><div class="' + volumeDbgID + '"><div class="' + volumeBgID + '"><div class="' + volumeUpID + '"></div></div><div class="' + volumeBOID + '"><div class="' + volumeBWID + '"></div></div></div></div>'; //音量调节框,音量调节按钮
1005			html += '<div class="' + muteID + '" data-title="' + thisTemp.language['mute'] + '">' + this.newCanvas(muteID, bWidth, bHeight) + '</div>'; //静音按钮
1006			html += '<div class="' + escMuteID + '" data-title="' + thisTemp.language['escMute'] + '">' + this.newCanvas(escMuteID, bWidth, bHeight) + '</div>'; //退出静音按钮
1007			html += '<div class="' + dlineID + '-rd"></div>'; //分隔线
1008			this.getByElement(controlBarID).innerHTML = html;
1009			//构建控制栏内容结束
1010			//构建进度条内容
1011			this.getByElement(timeProgressBgID).innerHTML = '<div class="' + loadProgressID + '"></div><div class="' + timeProgressID + '"></div>';
1012			this.getByElement(timeBOBGID).innerHTML = '<div class="' + timeBOID + '"><div class="' + timeBWID + '"></div></div>';
1013			//构建进度条内容结束
1014			this.getByElement(pauseCenterID).innerHTML = this.newCanvas(pauseCenterID, 80, 80); //构建中间暂停按钮
1015			this.getByElement(loadingID).innerHTML = this.newCanvas(loadingID, 60, 60); //构建中间缓冲时显示的图标
1016			this.getByElement(errorTextID).innerHTML = this.language['error']; //构建错误时显示的文本框
1017			if(this.ckplayerConfig['style']['logo']) {
1018				if(this.ckplayerConfig['style']['logo']['file']) {
1019					var logoFile = this.ckplayerConfig['style']['logo']['file'];
1020					if(logoFile.substr(0, 15) == 'data:image/png;' || logoFile.substr(0, 15) == 'data:image/jpg;' || logoFile.substr(0, 15) == 'data:image/jpeg;') {
1021						this.getByElement(logoID).innerHTML = '<img src="' + logoFile + '" border="0">'; //构建logo
1022					}
1023				}
1024			} else {
1025				this.getByElement(logoID).innerHTML = this.vars['logo'] || this.logo || ''; //构建logo
1026			}
1027			//CB:Object:全局变量,将一些全局需要用到的元素统一放在CB对象里
1028			var pd = this.PD;
1029			this.CB = {
1030				controlBarBg: this.getByElement(controlBarBgID, pd),
1031				controlBar: this.getByElement(controlBarID, pd),
1032				promptBg: this.getByElement(promptBgID, pd),
1033				prompt: this.getByElement(promptID, pd),
1034				timeProgressBg: this.getByElement(timeProgressBgID, pd),
1035				loadProgress: this.getByElement(loadProgressID, pd),
1036				timeProgress: this.getByElement(timeProgressID, pd),
1037				timeBoBg: this.getByElement(timeBOBGID, pd),
1038				timeButton: this.getByElement(timeBOID, pd),
1039				timeText: this.getByElement(timeTextID, pd),
1040				play: this.getByElement(playID, pd),
1041				front: this.getByElement(frontID, pd),
1042				next: this.getByElement(nextID, pd),
1043				pause: this.getByElement(pauseID, pd),
1044				definition: this.getByElement(definitionID, pd),
1045				definitionP: this.getByElement(definitionPID, pd),
1046				definitionLine: this.getByElement(dlineID + '-rb', pd),
1047				playbackrate: this.getByElement(playbackRateID, pd),
1048				playbackrateP: this.getByElement(playbackRatePID, pd),
1049				playbackrateLine: this.getByElement(dlineID + '-rc', pd),
1050				full: this.getByElement(fullID, pd),
1051				escFull: this.getByElement(escFullID, pd),
1052				mute: this.getByElement(muteID, pd),
1053				escMute: this.getByElement(escMuteID, pd),
1054				volume: this.getByElement(volumeID, pd),
1055				volumeBg: this.getByElement(volumeBgID, pd),
1056				volumeUp: this.getByElement(volumeUpID, pd),
1057				volumeBO: this.getByElement(volumeBOID, pd),
1058				pauseCenter: this.getByElement(pauseCenterID, pd),
1059				menu: this.getByElement(menuID),
1060				loading: this.getByElement(loadingID, pd),
1061				loadingCanvas: this.getByElement(loadingID + '-canvas', pd),
1062				errorText: this.getByElement(errorTextID, pd),
1063				logo: this.getByElement(logoID, pd),
1064				playLine: this.getByElement(dlineID + '-la', pd),
1065				frontLine: this.getByElement(dlineID + '-lb', pd),
1066				nextLine: this.getByElement(dlineID + '-lc', pd),
1067				fullLine: this.getByElement(dlineID + '-ra'),
1068				definitionLine: this.getByElement(dlineID + '-rb', pd),
1069				muteLine: this.getByElement(dlineID + '-rd', pd)
1070			};
1071			this.buttonWidth = {
1072				play: bWidth,
1073				full: bWidth,
1074				front: bWidth,
1075				next: bWidth,
1076				mute: bWidth
1077			};
1078			//定义界面元素的样式
1079			//控制栏背景
1080			this.css(controlBarBgID, {
1081				width: '100%',
1082				height: bHeight + 'px',
1083				backgroundColor: '#000000',
1084				position: 'absolute',
1085				bottom: '0px',
1086				filter: 'alpha(opacity:0.8)',
1087				opacity: '0.8',
1088				zIndex: '90'
1089			});
1090			//控制栏容器
1091			this.css(controlBarID, {
1092				width: '100%',
1093				height: bHeight + 'px',
1094				position: 'absolute',
1095				bottom: '0px',
1096				zIndex: '90'
1097			});
1098			//中间暂停按钮
1099			this.css(pauseCenterID, {
1100				width: '80px',
1101				height: '80px',
1102				borderRadius: '50%',
1103				position: 'absolute',
1104				display: 'none',
1105				cursor: 'pointer',
1106				zIndex: '100'
1107			});
1108			//loading
1109			this.css(loadingID, {
1110				width: '60px',
1111				height: '60px',
1112				position: 'absolute',
1113				display: 'none',
1114				zIndex: '100'
1115			});
1116			//出错文本框
1117			this.css(errorTextID, {
1118				width: '120px',
1119				height: '30px',
1120				lineHeight: '30px',
1121				color: '#FFFFFF',
1122				fontSize: '14px',
1123				textAlign: 'center',
1124				position: 'absolute',
1125				display: 'none',
1126				zIndex: '101',
1127				cursor: 'default',
1128				zIndex: '100'
1129			});
1130			//定义logo文字的样式
1131			this.css(logoID, {
1132				height: '30px',
1133				lineHeight: '30px',
1134				color: '#FFFFFF',
1135				fontFamily: 'Arial',
1136				fontSize: '28px',
1137				textAlign: 'center',
1138				position: 'absolute',
1139				float: 'left',
1140				left: '-1000px',
1141				top: '20px',
1142				zIndex: '100',
1143				filter: 'alpha(opacity:0.8)',
1144				opacity: '0.8',
1145				cursor: 'default'
1146			});
1147
1148			this.css(this.CB['loadingCanvas'], {
1149				transform: 'rotate(0deg)',
1150				msTransform: 'rotate(0deg)',
1151				mozTransform: 'rotate(0deg)',
1152				webkitTransform: 'rotate(0deg)',
1153				oTransform: 'rotate(0deg)'
1154			});
1155			//定义提示语的样式
1156			this.css([promptBgID, promptID], {
1157				height: '30px',
1158				lineHeight: '30px',
1159				color: '#FFFFFF',
1160				fontSize: '14px',
1161				textAlign: 'center',
1162				position: 'absolute',
1163				borderRadius: '5px',
1164				paddingLeft: '5px',
1165				paddingRight: '5px',
1166				bottom: '0px',
1167				display: 'none',
1168				zIndex: '95'
1169			});
1170			this.css(promptBgID, {
1171				backgroundColor: '#000000',
1172				filter: 'alpha(opacity:0.5)',
1173				opacity: '0.5'
1174			});
1175			//时间进度条背景容器
1176			this.css(timeProgressBgID, {
1177				width: '100%',
1178				height: '6px',
1179				backgroundColor: '#3F3F3F',
1180				overflow: 'hidden',
1181				position: 'absolute',
1182				bottom: '38px',
1183				zIndex: '88'
1184			});
1185			//加载进度和时间进度
1186			this.css([loadProgressID, timeProgressID], {
1187				width: '1px',
1188				height: '6px',
1189				position: 'absolute',
1190				bottom: '38px',
1191				top: '0px',
1192				zIndex: '91'
1193			});
1194			this.css(loadProgressID, 'backgroundColor', '#6F6F6F');
1195			this.css(timeProgressID, 'backgroundColor', bOverColor);
1196			//时间进度按钮
1197			this.css(timeBOBGID, {
1198				width: '100%',
1199				height: '14px',
1200				overflow: 'hidden',
1201				position: 'absolute',
1202				bottom: '34px',
1203				cursor: 'pointer',
1204				zIndex: '92'
1205			});
1206			this.css(timeBOID, {
1207				width: '14px',
1208				height: '14px',
1209				overflow: 'hidden',
1210				borderRadius: '50%',
1211				backgroundColor: bBgColor,
1212				cursor: 'pointer',
1213				position: 'absolute',
1214				top: '0px',
1215				zIndex: '20'
1216			});
1217			this.css(timeBWID, {
1218				width: '8px',
1219				height: '8px',
1220				overflow: 'hidden',
1221				borderRadius: '50%',
1222				position: 'absolute',
1223				backgroundColor: bOverColor,
1224				left: '3px',
1225				top: '3px'
1226			});
1227			this.css(timeTextID, {
1228				lineHeight: bHeight + 'px',
1229				color: '#FFFFFF',
1230				fontFamily: 'arial',
1231				fontSize: '16px',
1232				paddingLeft: '10px',
1233				float: 'left',
1234				overflow: 'hidden',
1235				cursor: 'default'
1236			});
1237			//分隔线
1238			this.css([dlineID + '-la', dlineID + '-lb', dlineID + '-lc', dlineID + '-ra', dlineID + '-rb', dlineID + '-rc', dlineID + '-rd'], {
1239				width: '0px',
1240				height: bHeight + 'px',
1241				overflow: 'hidden',
1242				borderLeft: '1px solid #303030',
1243				borderRight: '1px solid #151515',
1244				filter: 'alpha(opacity:0.9)',
1245				opacity: '0.9'
1246			});
1247			this.css([dlineID + '-la', dlineID + '-lb', dlineID + '-lc'], 'float', 'left');
1248			this.css([dlineID + '-ra', dlineID + '-rb', dlineID + '-rc', dlineID + '-rd'], 'float', 'right');
1249			this.css([dlineID + '-lb', dlineID + '-lc', dlineID + '-rb', dlineID + '-rc'], 'display', 'none');
1250			//播放/暂停/上一集/下一集按钮
1251			this.css([playID, pauseID, frontID, nextID], {
1252				width: bWidth + 'px',
1253				height: bHeight + 'px',
1254				float: 'left',
1255				overflow: 'hidden',
1256				cursor: 'pointer'
1257			});
1258			this.css([frontID, nextID], 'display', 'none');
1259			//初始化判断播放/暂停按钮隐藏项
1260			this.initPlayPause();
1261
1262			//设置静音/取消静音的按钮样式
1263			this.css([muteID, escMuteID], {
1264				width: bWidth + 'px',
1265				height: bHeight + 'px',
1266				float: 'right',
1267				overflow: 'hidden',
1268				cursor: 'pointer'
1269			});
1270			if(this.vars['volume'] > 0) {
1271				this.css(escMuteID, 'display', 'none');
1272			} else {
1273				this.css(muteID, 'display', 'none');
1274			}
1275			//音量调节框
1276			this.css([volumeID, volumeDbgID], {
1277				width: '110px',
1278				height: bHeight + 'px',
1279				overflow: 'hidden',
1280				float: 'right'
1281			});
1282			this.css(volumeDbgID, {
1283				position: 'absolute'
1284			});
1285			this.css([volumeBgID, volumeUpID], {
1286				width: '100px',
1287				height: '6px',
1288				overflow: 'hidden',
1289				borderRadius: '5px',
1290				cursor: 'pointer'
1291			});
1292			this.css(volumeBgID, {
1293				position: 'absolute',
1294				top: '16px'
1295			});
1296			this.css(volumeBgID, 'backgroundColor', '#666666');
1297			this.css(volumeUpID, 'backgroundColor', bOverColor);
1298			this.buttonWidth['volume'] = 100;
1299			//音量调节按钮
1300			this.css(volumeBOID, {
1301				width: '12px',
1302				height: '12px',
1303				overflow: 'hidden',
1304				borderRadius: '50%',
1305				position: 'absolute',
1306				backgroundColor: bBgColor,
1307				top: '13px',
1308				left: '0px',
1309				cursor: 'pointer'
1310			});
1311			this.css(volumeBWID, {
1312				width: '6px',
1313				height: '6px',
1314				overflow: 'hidden',
1315				borderRadius: '50%',
1316				position: 'absolute',
1317				backgroundColor: bOverColor,
1318				left: '3px',
1319				top: '3px'
1320			});
1321			//清晰度容器
1322			this.css(definitionID, {
1323				lineHeight: bHeight + 'px',
1324				color: '#FFFFFF',
1325				float: 'right',
1326				fontSize: '14px',
1327				textAlign: 'center',
1328				overflow: 'hidden',
1329				display: 'none',
1330				cursor: 'pointer'
1331			});
1332			this.css(definitionPID, {
1333				lineHeight: (bHeight - 8) + 'px',
1334				color: '#FFFFFF',
1335				overflow: 'hidden',
1336				position: 'absolute',
1337				bottom: '4px',
1338				backgroundColor: '#000000',
1339				textAlign: 'center',
1340				zIndex: '95',
1341				cursor: 'pointer',
1342				display: 'none'
1343			});
1344			//倍速容器
1345			this.css(playbackRateID, {
1346				lineHeight: bHeight + 'px',
1347				color: '#FFFFFF',
1348				float: 'right',
1349				fontSize: '14px',
1350				textAlign: 'center',
1351				overflow: 'hidden',
1352				display: 'none',
1353				cursor: 'pointer'
1354			});
1355			this.css(playbackRatePID, {
1356				lineHeight: (bHeight - 8) + 'px',
1357				color: '#FFFFFF',
1358				overflow: 'hidden',
1359				position: 'absolute',
1360				bottom: '4px',
1361				backgroundColor: '#000000',
1362				textAlign: 'center',
1363				zIndex: '95',
1364				cursor: 'pointer',
1365				display: 'none'
1366			});
1367			//设置全屏/退出全屏按钮样式
1368			this.css([fullID, escFullID], {
1369				width: bWidth + 'px',
1370				height: bHeight + 'px',
1371				float: 'right',
1372				overflow: 'hidden',
1373				cursor: 'pointer'
1374			});
1375			this.css(escFullID, 'display', 'none');
1376			//构建各按钮的形状
1377			//播放按钮
1378			var cPlay = this.getByElement(playID + '-canvas').getContext('2d');
1379			var cPlayFillRect = function() {
1380				thisTemp.canvasFill(cPlay, [
1381					[12, 10],
1382					[29, 19],
1383					[12, 28]
1384				]);
1385			};
1386			cPlay.fillStyle = bBgColor;
1387			cPlayFillRect();
1388			var cPlayOver = function(event) {
1389				cPlay.clearRect(0, 0, bWidth, bHeight);
1390				cPlay.fillStyle = bOverColor;
1391				cPlayFillRect();
1392			};
1393			var cPlayOut = function(event) {
1394				cPlay.clearRect(0, 0, bWidth, bHeight);
1395				cPlay.fillStyle = bBgColor;
1396				cPlayFillRect();
1397			};
1398
1399			this.addListenerInside('mouseover', cPlayOver, this.getByElement(playID + '-canvas'));
1400			this.addListenerInside('mouseout', cPlayOut, this.getByElement(playID + '-canvas'));
1401			//暂停按钮
1402			var cPause = this.getByElement(pauseID + '-canvas').getContext('2d');
1403			var cPauseFillRect = function() {
1404				thisTemp.canvasFillRect(cPause, [
1405					[10, 10, 5, 18],
1406					[22, 10, 5, 18]
1407				]);
1408			};
1409			cPause.fillStyle = bBgColor;
1410			cPauseFillRect();
1411			var cPauseOver = function(event) {
1412				cPause.clearRect(0, 0, bWidth, bHeight);
1413				cPause.fillStyle = bOverColor;
1414				cPauseFillRect();
1415			};
1416			var cPauseOut = function(event) {
1417				cPause.clearRect(0, 0, bWidth, bHeight);
1418				cPause.fillStyle = bBgColor;
1419				cPauseFillRect();
1420			};
1421			this.addListenerInside('mouseover', cPauseOver, this.getByElement(pauseID + '-canvas'));
1422			this.addListenerInside('mouseout', cPauseOut, this.getByElement(pauseID + '-canvas'));
1423			//前一集按钮
1424			var cFront = this.getByElement(frontID + '-canvas').getContext('2d');
1425			var cFrontFillRect = function() {
1426				thisTemp.canvasFill(cFront, [
1427					[16, 19],
1428					[30, 10],
1429					[30, 28]
1430				]);
1431				thisTemp.canvasFillRect(cFront, [
1432					[8, 10, 5, 18]
1433				]);
1434			};
1435			cFront.fillStyle = bBgColor;
1436			cFrontFillRect();
1437			var cFrontOver = function(event) {
1438				cFront.clearRect(0, 0, bWidth, bHeight);
1439				cFront.fillStyle = bOverColor;
1440				cFrontFillRect();
1441			};
1442			var cFrontOut = function(event) {
1443				cFront.clearRect(0, 0, bWidth, bHeight);
1444				cFront.fillStyle = bBgColor;
1445				cFrontFillRect();
1446			};
1447
1448			this.addListenerInside('mouseover', cFrontOver, this.getByElement(frontID + '-canvas'));
1449			this.addListenerInside('mouseout', cFrontOut, this.getByElement(frontID + '-canvas'));
1450			//下一集按钮
1451			var cNext = this.getByElement(nextID + '-canvas').getContext('2d');
1452			var cNextFillRect = function() {
1453				thisTemp.canvasFill(cNext, [
1454					[8, 10],
1455					[22, 19],
1456					[8, 28]
1457				]);
1458				thisTemp.canvasFillRect(cNext, [
1459					[25, 10, 5, 18]
1460				]);
1461			};
1462			cNext.fillStyle = bBgColor;
1463			cNextFillRect();
1464			var cNextOver = function(event) {
1465				cNext.clearRect(0, 0, bWidth, bHeight);
1466				cNext.fillStyle = bOverColor;
1467				cNextFillRect();
1468			};
1469			var cNextOut = function(event) {
1470				cNext.clearRect(0, 0, bWidth, bHeight);
1471				cNext.fillStyle = bBgColor;
1472				cNextFillRect();
1473			};
1474			this.addListenerInside('mouseover', cNextOver, this.getByElement(nextID + '-canvas'));
1475			this.addListenerInside('mouseout', cNextOut, this.getByElement(nextID + '-canvas'));
1476			//全屏按钮
1477			var cFull = this.getByElement(fullID + '-canvas').getContext('2d');
1478			var cFullFillRect = function() {
1479				thisTemp.canvasFillRect(cFull, [
1480					[19, 10, 9, 3],
1481					[25, 13, 3, 6],
1482					[10, 19, 3, 9],
1483					[13, 25, 6, 3]
1484				]);
1485			};
1486			cFull.fillStyle = bBgColor;
1487			cFullFillRect();
1488			var cFullOver = function() {
1489				cFull.clearRect(0, 0, bWidth, bHeight);
1490				cFull.fillStyle = bOverColor;
1491				cFullFillRect();
1492			};
1493			var cFullOut = function() {
1494				cFull.clearRect(0, 0, bWidth, bHeight);
1495				cFull.fillStyle = bBgColor;
1496				cFullFillRect();
1497			};
1498			this.addListenerInside('mouseover', cFullOver, this.getByElement(fullID + '-canvas'));
1499			this.addListenerInside('mouseout', cFullOut, this.getByElement(fullID + '-canvas'));
1500			//定义退出全屏按钮样式
1501			var cEscFull = this.getByElement(escFullID + '-canvas').getContext('2d');
1502			var cEscFullFillRect = function() {
1503				thisTemp.canvasFillRect(cEscFull, [
1504					[20, 9, 3, 9],
1505					[23, 15, 6, 3],
1506					[9, 20, 9, 3],
1507					[15, 23, 3, 6]
1508				]);
1509			};
1510			cEscFull.fillStyle = bBgColor;
1511			cEscFullFillRect();
1512
1513			var cEscFullOver = function() {
1514				cEscFull.clearRect(0, 0, bWidth, bHeight);
1515				cEscFull.fillStyle = bOverColor;
1516				cEscFullFillRect();
1517			};
1518			var cEscFullOut = function() {
1519				cEscFull.clearRect(0, 0, bWidth, bHeight);
1520				cEscFull.fillStyle = bBgColor;
1521				cEscFullFillRect();
1522			};
1523			this.addListenerInside('mouseover', cEscFullOver, this.getByElement(escFullID + '-canvas'));
1524			this.addListenerInside('mouseout', cEscFullOut, this.getByElement(escFullID + '-canvas'));
1525			//定义全屏按钮的样式
1526			var cMute = this.getByElement(muteID + '-canvas').getContext('2d');
1527			var cMuteFillRect = function() {
1528				thisTemp.canvasFill(cMute, [
1529					[10, 15],
1530					[15, 15],
1531					[21, 10],
1532					[21, 28],
1533					[15, 23],
1534					[10, 23]
1535				]);
1536				thisTemp.canvasFillRect(cMute, [
1537					[23, 15, 2, 8],
1538					[27, 10, 2, 18]
1539				]);
1540			};
1541			cMute.fillStyle = bBgColor;
1542			cMuteFillRect();
1543			var cMuteOver = function() {
1544				cMute.clearRect(0, 0, bWidth, bHeight);
1545				cMute.fillStyle = bOverColor;
1546				cMuteFillRect();
1547			};
1548			var cMuteOut = function() {
1549				cMute.clearRect(0, 0, bWidth, bHeight);
1550				cMute.fillStyle = bBgColor;
1551				cMuteFillRect();
1552			};
1553			this.addListenerInside('mouseover', cMuteOver, this.getByElement(muteID + '-canvas'));
1554			this.addListenerInside('mouseout', cMuteOut, this.getByElement(muteID + '-canvas'));
1555			//定义退出全屏按钮样式
1556			var cEscMute = this.getByElement(escMuteID + '-canvas').getContext('2d');
1557			var cEscMuteFillRect = function() {
1558				thisTemp.canvasFill(cEscMute, [
1559					[10, 15],
1560					[15, 15],
1561					[21, 10],
1562					[21, 28],
1563					[15, 23],
1564					[10, 23]
1565				]);
1566				thisTemp.canvasFill(cEscMute, [
1567					[23, 13],
1568					[24, 13],
1569					[33, 25],
1570					[32, 25]
1571				]);
1572				thisTemp.canvasFill(cEscMute, [
1573					[32, 13],
1574					[33, 13],
1575					[24, 25],
1576					[23, 25]
1577				]);
1578			};
1579			cEscMute.fillStyle = bBgColor;
1580			cEscMuteFillRect();
1581			var cEscMuteOver = function() {
1582				cEscMute.clearRect(0, 0, bWidth, bHeight);
1583				cEscMute.fillStyle = bOverColor;
1584				cEscMuteFillRect();
1585			};
1586			var cEscMuteOut = function() {
1587				cEscMute.clearRect(0, 0, bWidth, bHeight);
1588				cEscMute.fillStyle = bBgColor;
1589				cEscMuteFillRect();
1590			};
1591			this.addListenerInside('mouseover', cEscMuteOver, this.getByElement(escMuteID + '-canvas'));
1592			this.addListenerInside('mouseout', cEscMuteOut, this.getByElement(escMuteID + '-canvas'));
1593			//定义loading样式
1594			var cLoading = this.getByElement(loadingID + '-canvas').getContext('2d');
1595			var cLoadingFillRect = function() {
1596				cLoading.save();
1597				var grad = cLoading.createLinearGradient(0, 0, 60, 60);
1598				grad.addColorStop(0, bBgColor);
1599				var grad2 = cLoading.createLinearGradient(0, 0, 80, 60);
1600				grad2.addColorStop(1, bOverColor);
1601				var grad3 = cLoading.createLinearGradient(0, 0, 80, 60);
1602				grad3.addColorStop(1, '#FF9900');
1603				var grad4 = cLoading.createLinearGradient(0, 0, 80, 60);
1604				grad4.addColorStop(1, '#CC3300');
1605				cLoading.strokeStyle = grad; //设置描边样式
1606				cLoading.lineWidth = 8; //设置线宽
1607				cLoading.beginPath(); //路径开始
1608				cLoading.arc(30, 30, 25, 0, 0.4 * Math.PI, false); //用于绘制圆弧context.arc(x坐标,y坐标,半径,起始角度,终止角度,
1608顺时针/逆时针)
1609				cLoading.stroke(); //绘制
1610				cLoading.closePath(); //路径结束
1611				cLoading.beginPath(); //路径开始
1612				cLoading.strokeStyle = grad2; //设置描边样式
1613				cLoading.arc(30, 30, 25, 0.5 * Math.PI, 0.9 * Math.PI, false); //用于绘制圆弧context.arc(x坐标,y坐标,半径,起始角度,终止角度,顺时针/逆时针)
1614				cLoading.stroke(); //绘制
1615				cLoading.beginPath(); //路径开始
1616				cLoading.strokeStyle = grad3; //设置描边样式
1617				cLoading.arc(30, 30, 25, Math.PI, 1.4 * Math.PI, false); //用于绘制圆弧context.arc(x坐标,y坐标,半径,起始角度,终止角度,顺时针/逆时针)
1618				cLoading.stroke(); //绘制
1619				cLoading.beginPath(); //路径开始
1620				cLoading.strokeStyle = grad4; //设置描边样式
1621				cLoading.arc(30, 30, 25, 1.5 * Math.PI, 1.9 * Math.PI, false); //用于绘制圆弧context.arc(x坐标,y坐标,半径,起始角度,终止角度,顺时针/逆时针)
1622				cLoading.stroke(); //绘制
1623				cLoading.closePath(); //路径结束
1624				cLoading.restore();
1625			};
1626			cLoading.fillStyle = bBgColor;
1627			cLoadingFillRect();
1628			//定义中间暂停按钮的样式
1629			var cPauseCenter = this.getByElement(pauseCenterID + '-canvas').getContext('2d');
1630			var cPauseCenterFillRect = function() {
1631				thisTemp.canvasFill(cPauseCenter, [
1632					[28, 22],
1633					[59, 38],
1634					[28, 58]
1635				]);
1636				/* 指定几个颜色 */
1637				cPauseCenter.save();
1638				cPauseCenter.lineWidth = 5; //设置线宽
1639				cPauseCenter.beginPath(); //路径开始
1640				cPauseCenter.arc(40, 40, 35, 0, 2 * Math.PI, false); //用于绘制圆弧context.arc(x坐标,y坐标,半径,起始角度,终止角度,顺时针/逆时针)
1641				cPauseCenter.stroke(); //绘制
1642				cPauseCenter.closePath(); //路径结束
1643				cPauseCenter.restore();
1644			};
1645			cPauseCenter.fillStyle = bBgColor;
1646			cPauseCenter.strokeStyle = bBgColor;
1647			cPauseCenterFillRect();
1648			var cPauseCenterOver = function() {
1649				cPauseCenter.clearRect(0, 0, 80, 80);
1650				cPauseCenter.fillStyle = bOverColor;
1651				cPauseCenter.strokeStyle = bOverColor;
1652				cPauseCenterFillRect();
1653			};
1654			var cPauseCenterOut = function() {
1655				cPauseCenter.clearRect(0, 0, 80, 80);
1656				cPauseCenter.fillStyle = bBgColor;
1657				cPauseCenter.strokeStyle = bBgColor;
1658				cPauseCenterFillRect();
1659			};
1660			this.addListenerInside('mouseover', cPauseCenterOver, this.getByElement(pauseCenterID + '-canvas'));
1661			this.addListenerInside('mouseout', cPauseCenterOut, this.getByElement(pauseCenterID + '-canvas'));
1662
1663			//鼠标经过/离开音量调节按钮
1664			var volumeBOOver = function() {
1665				thisTemp.css(volumeBOID, 'backgroundColor', bOverColor);
1666				thisTemp.css(volumeBWID, 'backgroundColor', bBgColor);
1667			};
1668			var volumeBOOut = function() {
1669				thisTemp.css(volumeBOID, 'backgroundColor', bBgColor);
1670				thisTemp.css(volumeBWID, 'backgroundColor', bOverColor);
1671			};
1672			this.addListenerInside('mouseover', volumeBOOver, this.getByElement(volumeBOID));
1673			this.addListenerInside('mouseout', volumeBOOut, this.getByElement(volumeBOID));
1674			//鼠标经过/离开进度按钮
1675			var timeBOOver = function() {
1676				thisTemp.css(timeBOID, 'backgroundColor', bOverColor);
1677				thisTemp.css(timeBWID, 'backgroundColor', bBgColor);
1678			};
1679			var timeBOOut = function() {
1680				thisTemp.css(timeBOID, 'backgroundColor', bBgColor);
1681				thisTemp.css(timeBWID, 'backgroundColor', bOverColor);
1682			};
1683			this.addListenerInside('mouseover', timeBOOver, this.getByElement(timeBOID));
1684			this.addListenerInside('mouseout', timeBOOut, this.getByElement(timeBOID));
1685
1686			this.addButtonEvent(); //注册按钮及音量调节,进度操作事件
1687			this.newMenu(); //单独设置右键的样式和事件
1688			this.controlBarHide(); //单独注册控制栏隐藏事件
1689			this.keypress(); //单独注册键盘事件
1690			//初始化音量调节框
1691			this.changeVolume(this.vars['volume']);
1692			//初始化判断是否需要显示上一集和下一集按钮
1693			this.showFrontNext();
1694			window.setTimeout(function() {
1695				thisTemp.elementCoordinate(); //调整中间暂停按钮/loading的位置/error的位置
1696			}, 100);
1697			this.checkBarWidth();
1698			var resize = function() {
1699				thisTemp.elementCoordinate();
1700				thisTemp.timeUpdateHandler();
1701				thisTemp.changeLoad();
1702				thisTemp.checkBarWidth();
1703				thisTemp.changeElementCoor(); //修改新加元件的坐标
1704				thisTemp.changePrompt();
1705			};
1706			this.addListenerInside('resize', resize, window);
1707		},
1708		/*
1709			内部函数
1710			创建按钮,使用canvas画布
1711		*/
1712		newCanvas: function(id, width, height) {
1713			return '<canvas class="' + id + '-canvas" width="' + width + '" height="' + height + '"></canvas>';
1714		},
1715		/*
1716			内部函数
1717			注册按钮,音量调节框,进度操作框事件
1718		*/
1719		addButtonEvent: function() {
1720			var thisTemp = this;
1721			//定义按钮的单击事件
1722			var playClick = function(event) {
1723				thisTemp.videoPlay();
1724				thisTemp.sendJS('clickEvent', 'actionScript->videoPlay');
1725			};
1726			this.addListenerInside('click', playClick, this.CB['play']);
1727			this.addListenerInside('click', playClick, this.CB['pauseCenter']);
1728			var pauseClick = function(event) {
1729				thisTemp.videoPause();
1730				thisTemp.sendJS('clickEvent', 'actionScript->videoPause');
1731			};
1732			this.addListenerInside('click', pauseClick, this.CB['pause']);
1733			var frontClick = function(event) {
1734				if(thisTemp.vars['front']) {
1735					eval(thisTemp.vars['front'] + '()');
1736					thisTemp.sendJS('clickEvent', 'actionScript->' + thisTemp.vars['front']);
1737				}
1738			};
1739			this.addListenerInside('click', frontClick, this.CB['front']);
1740			var nextClick = function(event) {
1741				if(thisTemp.vars['next']) {
1742					eval(thisTemp.vars['next'] + '()');
1743					thisTemp.sendJS('clickEvent', 'actionScript->' + thisTemp.vars['next']);
1744				}
1745			};
1746			this.addListenerInside('click', nextClick, this.CB['next']);
1747			var muteClick = function(event) {
1748				thisTemp.videoMute();
1749				thisTemp.sendJS('clickEvent', 'actionScript->videoMute');
1750			};
1751			this.addListenerInside('click', muteClick, this.CB['mute']);
1752			var escMuteClick = function(event) {
1753				thisTemp.videoEscMute();
1754				thisTemp.sendJS('clickEvent', 'actionScript->videoEscMute');
1755			};
1756			this.addListenerInside('click', escMuteClick, this.CB['escMute']);
1757			var fullClick = function(event) {
1758				thisTemp.fullScreen();
1759				thisTemp.sendJS('clickEvent', 'actionScript->fullScreen');
1760			};
1761			this.addListenerInside('click', fullClick, this.CB['full']);
1762			var escFullClick = function(event) {
1763				thisTemp.quitFullScreen();
1764				thisTemp.sendJS('clickEvent', 'actionScript->quitFullScreen');
1765			};
1766			this.addListenerInside('click', escFullClick, this.CB['escFull']);
1767			//定义各个按钮的鼠标经过/离开事件
1768			var promptHide = function(event) {
1769				thisTemp.promptShow(false);
1770			};
1771			var playOver = function(event) {
1772				thisTemp.promptShow(thisTemp.CB['play']);
1773			};
1774			this.addListenerInside('mouseover', playOver, this.CB['play']);
1775			this.addListenerInside('mouseout', promptHide, this.CB['play']);
1776			var pauseOver = function(event) {
1777				thisTemp.promptShow(thisTemp.CB['pause']);
1778			};
1779			this.addListenerInside('mouseover', pauseOver, this.CB['pause']);
1780			this.addListenerInside('mouseout', promptHide, this.CB['pause']);
1781			var frontOver = function(event) {
1782				thisTemp.promptShow(thisTemp.CB['front']);
1783			};
1784			this.addListenerInside('mouseover', frontOver, this.CB['front']);
1785			this.addListenerInside('mouseout', promptHide, this.CB['front']);
1786			var nextOver = function(event) {
1787				thisTemp.promptShow(thisTemp.CB['next']);
1788			};
1789			this.addListenerInside('mouseover', nextOver, this.CB['next']);
1790			this.addListenerInside('mouseout', promptHide, this.CB['next']);
1791			var muteOver = function(event) {
1792				thisTemp.promptShow(thisTemp.CB['mute']);
1793			};
1794			this.addListenerInside('mouseover', muteOver, this.CB['mute']);
1795			this.addListenerInside('mouseout', promptHide, this.CB['mute']);
1796			var escMuteOver = function(event) {
1797				thisTemp.promptShow(thisTemp.CB['escMute']);
1798			};
1799			this.addListenerInside('mouseover', escMuteOver, this.CB['escMute']);
1800			this.addListenerInside('mouseout', promptHide, this.CB['escMute']);
1801			var fullOver = function(event) {
1802				thisTemp.promptShow(thisTemp.CB['full']);
1803			};
1804			this.addListenerInside('mouseover', fullOver, this.CB['full']);
1805			this.addListenerInside('mouseout', promptHide, this.CB['full']);
1806			var escFullOver = function(event) {
1807				thisTemp.promptShow(thisTemp.CB['escFull']);
1808			};
1809			this.addListenerInside('mouseover', escFullOver, this.CB['escFull']);
1810			this.addListenerInside('mouseout', promptHide, this.CB['escFull']);
1811			var definitionOver = function(event) {
1812				thisTemp.promptShow(thisTemp.CB['definition']);
1813			};
1814			this.addListenerInside('mouseover', definitionOver, this.CB['definition']);
1815			this.addListenerInside('mouseout', promptHide, this.CB['definition']);
1816			var playbackrateOver = function(event) {
1817				thisTemp.promptShow(thisTemp.CB['playbackrate']);
1818			};
1819			this.addListenerInside('mouseover', playbackrateOver, this.CB['playbackrate']);
1820			this.addListenerInside('mouseout', promptHide, this.CB['playbackrate']);
1821			//定义音量和进度按钮的滑块事件
1822
1823			var volumePrompt = function(vol) {
1824				var volumeBOXY = thisTemp.getCoor(thisTemp.CB['volumeBO']);
1825				var promptObj = {
1826					title: thisTemp.language['volume'] + vol + '%',
1827					x: volumeBOXY['x'] + thisTemp.CB['volumeBO'].offsetWidth * 0.5,
1828					y: volumeBOXY['y']
1829				};
1830				thisTemp.promptShow(false, promptObj);
1831			};
1832			var volumeObj = {
1833				slider: this.CB['volumeBO'],
1834				follow: this.CB['volumeUp'],
1835				refer: this.CB['volumeBg'],
1836				grossValue: 'volume',
1837				pd: true,
1838				startFun: function(vol) {},
1839				monitorFun: function(vol) {
1840					thisTemp.changeVolume(vol * 0.01, false, false);
1841					volumePrompt(vol);
1842				},
1843				endFun: function(vol) {},
1844				overFun: function(vol) {
1845					volumePrompt(vol);
1846				}
1847			};
1848			this.slider(volumeObj);
1849			var volumeClickObj = {
1850				refer: this.CB['volumeBg'],
1851				grossValue: 'volume',
1852				fun: function(vol) {
1853					thisTemp.changeVolume(vol * 0.01, true, true);
1854				}
1855			};
1856			this.progressClick(volumeClickObj);
1857			this.timeButtonMouseDown(); //用单击的函数来判断是否需要建立控制栏监听
1858			//鼠标经过/离开音量调节框时的
1859			var volumeBgMove = function(event) {
1860				var volumeBgXY = thisTemp.getCoor(thisTemp.CB['volumeBg']);
1861				var eventX = thisTemp.client(event)['x'];
1862				var eventVolume = parseInt((eventX - volumeBgXY['x']) * 100 / thisTemp.CB['volumeBg'].offsetWidth);
1863				var buttonPromptObj = {
1864					title: thisTemp.language['volume'] + eventVolume + '%',
1865					x: eventX,
1866					y: volumeBgXY['y']
1867				};
1868				thisTemp.promptShow(false, buttonPromptObj);
1869			};
1870			this.addListenerInside('mousemove', volumeBgMove, this.CB['volumeBg']);
1871			this.addListenerInside('mouseout', promptHide, this.CB['volumeBg']);
1872			this.addListenerInside('mouseout', promptHide, this.CB['volumeBO']);
1873			//注册清晰度相关事件
1874			this.addDefListener();
1875			//注册倍速相关事件
1876			this.addPlaybackrate();
1877		},
1878		/*
1879			内部函数
1880			注册单击视频动作
1881		*/
1882		videoClick: function() {
1883			var thisTemp = this;
1884			var clearTimerClick = function() {
1885				if(thisTemp.timerClick != null) {
1886					if(thisTemp.timerClick.runing) {
1887						thisTemp.timerClick.stop();
1888					}
1889					thisTemp.timerClick = null;
1890				}
1891			};
1892			var timerClickFun = function() {
1893				clearTimerClick();
1894				thisTemp.isClick = false;
1895				thisTemp.playOrPause();
1896
1897			};
1898			clearTimerClick();
1899			if(this.isClick) {
1900				this.isClick = false;
1901				if(thisTemp.config['videoDbClick']) {
1902					if(!this.full) {
1903						thisTemp.fullScreen();
1904					} else {
1905						thisTemp.quitFullScreen();
1906					}
1907				}
1908
1909			} else {
1910				this.isClick = true;
1911				this.timerClick = new this.timer(300, timerClickFun, 1)
1912				//this.timerClick.start();
1913			}
1914
1915		},
1916		/*
1917			内部函数
1918			注册鼠标经过进度滑块的事件
1919		*/
1920		timeButtonMouseDown: function() {
1921			var thisTemp = this;
1922			var timePrompt = function(time) {
1923				if(isNaN(time)) {
1924					time = 0;
1925				}
1926				var timeButtonXY = thisTemp.getCoor(thisTemp.CB['timeButton']);
1927				var promptObj = {
1928					title: thisTemp.formatTime(time),
1929					x: timeButtonXY['x'] - thisTemp.pdCoor['x'] + thisTemp.CB['timeButton'].offsetWidth * 0.5,
1930					y: timeButtonXY['y'] - thisTemp.pdCoor['y']
1931				};
1932				thisTemp.promptShow(false, promptObj);
1933			};
1934			var timeObj = {
1935				slider: this.CB['timeButton'],
1936				follow: this.CB['timeProgress'],
1937				refer: this.CB['timeBoBg'],
1938				grossValue: 'time',
1939				pd: false,
1940				startFun: function(time) {
1941					thisTemp.isTimeButtonMove = false;
1942				},
1943				monitorFun: function(time) {},
1944				endFun: function(time) {
1945					if(thisTemp.V) {
1946						if(thisTemp.V.duration > 0) {
1947							thisTemp.needSeek = 0;
1948							thisTemp.videoSeek(parseInt(time));
1949						}
1950					}
1951				},
1952				overFun: function(time) {
1953					timePrompt(time);
1954				}
1955			};
1956			var timeClickObj = {
1957				refer: this.CB['timeBoBg'],
1958				grossValue: 'time',
1959				fun: function(time) {
1960					if(thisTemp.V) {
1961						if(thisTemp.V.duration > 0) {
1962							thisTemp.needSeek = 0;
1963							thisTemp.videoSeek(parseInt(time));
1964						}
1965					}
1966				}
1967			};
1968			var timeBoBgmousemove = function(event) {
1969				var timeBoBgXY = thisTemp.getCoor(thisTemp.CB['timeBoBg']);
1970				var eventX = thisTemp.client(event)['x'];
1971				var eventTime = parseInt((eventX - timeBoBgXY['x']) * thisTemp.V.duration / thisTemp.CB['timeBoBg'].offsetWidth);
1972				var buttonPromptObj = {
1973					title: thisTemp.formatTime(eventTime),
1974					x: eventX,
1975					y: timeBoBgXY['y']
1976				};
1977				thisTemp.promptShow(false, buttonPromptObj);
1978				var def = false;
1979				if(!thisTemp.isUndefined(thisTemp.CB['definitionP'])) {
1980					if(thisTemp.css(thisTemp.CB['definitionP'], 'display') != 'block') {
1981						def = true;
1982					}
1983				}
1984				if(thisTemp.vars['preview'] != null && def) {
1985					buttonPromptObj['time'] = eventTime;
1986					thisTemp.preview(buttonPromptObj);
1987				}
1988			};
1989			var promptHide = function(event) {
1990				thisTemp.promptShow(false);
1991				if(thisTemp.previewDiv != null) {
1992					thisTemp.css([thisTemp.previewDiv, thisTemp.previewTop], 'display', 'none');
1993				}
1994			};
1995			if(!this.vars['live']) { //如果不是直播
1996				this.isTimeButtonDown = true;
1997				this.addListenerInside('mousemove', timeBoBgmousemove, this.CB['timeBoBg']);
1998				this.addListenerInside('mouseout', promptHide, this.CB['timeBoBg']);
1999			} else {
2000				this.isTimeButtonDown = false;
2001				timeObj['removeListenerInside'] = true;
2002				timeClickObj['removeListenerInside'] = true;
2003			}
2004			this.slider(timeObj);
2005			this.progressClick(timeClickObj);
2006
2007		},
2008		/*
2009			内部函数
2010			注册调节框上单击事件,包含音量调节框和播放时度调节框
2011		*/
2012		progressClick: function(obj) {
2013			/*
2014				refer:参考对象
2015				fun:返回函数
2016				refer:参考元素,即背景
2017				grossValue:调用的参考值类型
2018				pd:
2019			*/
2020			//建立参考元素的mouseClick事件,用来做为鼠标在其上按下时触发的状态
2021			var thisTemp = this;
2022			var referMouseClick = function(event) {
2023				var referX = thisTemp.client(event)['x'] - thisTemp.getCoor(obj['refer'])['x'];
2024				var rWidth = obj['refer'].offsetWidth;
2025				var grossValue = 0;
2026				if(obj['grossValue'] == 'volume') {
2027					grossValue = 100;
2028				} else {
2029					if(thisTemp.V) {
2030						grossValue = thisTemp.V.duration;
2031					}
2032				}
2033				var nowZ = parseInt(referX * grossValue / rWidth);
2034				if(obj['fun']) {
2035					if(obj['grossValue'] === 'time') {
2036						var sliderXY = thisTemp.getCoor(thisTemp.CB['timeButton']);
2037						sliderLeft = sliderXY['x'];
2038						if(!thisTemp.checkSlideLeft(referX, sliderLeft, rWidth)) {
2039							return;
2040						}
2041						var bimeButtonWB = thisTemp.CB['timeButton'].offsetWidth * 0.5;
2042						thisTemp.css(thisTemp.CB['timeButton'], 'left', (referX - bimeButtonWB) + 'px');
2043						thisTemp.css(thisTemp.CB['timeProgress'], 'width', (referX) + 'px');
2044					}
2045					obj['fun'](nowZ);
2046				}
2047			};
2048			if(this.isUndefined(obj['removeListenerInside'])) {
2049				this.addListenerInside('click', referMouseClick, obj['refer']);
2050			} else {
2051				this.removeListenerInside('click', referMouseClick, obj['refer']);
2052			}
2053
2054		},
2055
2056		/*
2057			内部函数
2058			共用的注册滑块事件
2059		*/
2060		slider: function(obj) {
2061			/*
2062				obj={
2063					slider:滑块元素
2064					follow:跟随滑块的元素
2065					refer:参考元素,即背景
2066					grossValue:调用的参考值类型
2067					startFun:开始调用的元素
2068					monitorFun:监听函数
2069					endFun:结束调用的函数
2070					overFun:鼠标放上去后调用的函数
2071					pd:是否需要修正
2072				}
2073			*/
2074			var thisTemp = this;
2075			var clientX = 0,
2076				criterionWidth = 0,
2077				sliderLeft = 0,
2078				referLeft = 0;
2079			var value = 0;
2080			var calculation = function() { //根据滑块的left计算百分比
2081				var sLeft = parseInt(thisTemp.css(obj['slider'], 'left'));
2082				var rWidth = obj['refer'].offsetWidth - obj['slider'].offsetWidth;
2083				var grossValue = 0;
2084				if(thisTemp.isUndefined(sLeft) || isNaN(sLeft)) {
2085					sLeft = 0;
2086				}
2087				if(obj['grossValue'] == 'volume') {
2088					grossValue = 100;
2089				} else {
2090					if(thisTemp.V) {
2091						grossValue = thisTemp.V.duration;
2092					}
2093				}
2094				return parseInt(sLeft * grossValue / rWidth);
2095			};
2096			var mDown = function(event) {
2097				thisTemp.addListenerInside('mousemove', mMove, document);
2098				thisTemp.addListenerInside('mouseup', mUp, document);
2099				var referXY = thisTemp.getCoor(obj['refer']);
2100				var sliderXY = thisTemp.getCoor(obj['slider']);
2101				clientX = thisTemp.client(event)['x'];
2102				referLeft = referXY['x'];
2103				sliderLeft = sliderXY['x'];
2104				criterionWidth = clientX - sliderLeft;
2105				if(obj['startFun']) {
2106					obj['startFun'](calculation());
2107				}
2108			};
2109			var mMove = function(event) {
2110				clientX = thisTemp.client(event)['x'];
2111				var newX = clientX - criterionWidth - referLeft;
2112				if(newX < 0) {
2113					newX = 0;
2114				}
2115				if(newX > obj['refer'].offsetWidth - obj['slider'].offsetWidth) {
2116					newX = obj['refer'].offsetWidth - obj['slider'].offsetWidth;
2117				}
2118				if(obj['slider'] === thisTemp.CB['timeButton']) {
2119					if(!thisTemp.checkSlideLeft(newX, sliderLeft, obj['refer'].offsetWidth)) {
2120						return;
2121					}
2122				}
2123				thisTemp.css(obj['slider'], 'left', newX + 'px');
2124				thisTemp.css(obj['follow'], 'width', (newX + obj['slider'].offsetWidth * 0.5) + 'px');
2125				var nowZ = calculation();
2126				if(obj['monitorFun']) {
2127					obj['monitorFun'](nowZ);
2128				}
2129			};
2130			var mUp = function(event) {
2131				thisTemp.removeListenerInside('mousemove', mMove, document);
2132				thisTemp.removeListenerInside('mouseup', mUp, document);
2133				if(obj['endFun']) {
2134					obj['endFun'](calculation());
2135				}
2136			};
2137			var mOver = function(event) {
2138				if(obj['overFun']) {
2139					obj['overFun'](calculation());
2140				}
2141
2142			};
2143			if(this.isUndefined(obj['removeListenerInside'])) {
2144				this.addListenerInside('mousedown', mDown, obj['slider']);
2145				this.addListenerInside('mouseover', mOver, obj['slider']);
2146			} else {
2147				this.removeListenerInside('mousedown', mDown, obj['slider']);
2148				this.removeListenerInside('mouseover', mOver, obj['slider']);
2149			}
2150		},
2151		/*
2152			内部函数
2153			判断是否可以拖动进度按钮或点击进度栏
2154		*/
2155		checkSlideLeft: function(newX, sliderLeft, refer) {
2156			var timeSA = this.ckplayerConfig['config']['timeScheduleAdjust'];
2157			switch(timeSA) {
2158				case 0:
2159					return false;
2160					break;
2161				case 2:
2162					if(newX < sliderLeft) {
2163						return false;
2164					}
2165					break;
2166				case 3:
2167					if(newX > sliderLeft) {
2168						return false;
2169					}
2170					break;
2171				case 4:
2172					if(!this.timeSliderLeftTemp) {
2173						this.timeSliderLeftTemp = sliderLeft / refer;
2174					}
2175					if(newX < this.timeSliderLeftTemp * refer) {
2176						return false;
2177					}
2178					break;
2179				case 5:
2180					if(!this.timeSliderLeftTemp) {
2181						this.timeSliderLeftTemp = sliderLeft / refer;
2182					} else {
2183						var timeSliderMax = sliderLeft / refer;
2184						if(timeSliderMax > this.timeSliderLeftTemp) {
2185							this.timeSliderLeftTemp = timeSliderMax;
2186						}
2187					}
2188					if(newX > this.timeSliderLeftTemp * refer) {
2189						return false;
2190					}
2191					break;
2192				default:
2193					return true;
2194					break;
2195			}
2196			return true;
2197		},
2198		/*
2199			内部函数
2200			显示loading
2201		*/
2202		loadingStart: function(rot) {
2203			var thisTemp = this;
2204			if(this.isUndefined(rot)) {
2205				rot = true;
2206			}
2207			if(this.showFace) {
2208				this.css(thisTemp.CB['loading'], 'display', 'none');
2209			}
2210			if(this.timerLoading != null) {
2211				if(this.timerLoading.runing) {
2212					this.timerLoading.stop();
2213				}
2214				this.timerLoading = null;
2215			}
2216			var buffer = 0;
2217			var loadingFun = function() {
2218				var nowRotate = '0';
2219				try {
2220					nowRotate = thisTemp.css(thisTemp.CB['loadingCanvas'], 'transform') || thisTemp.css(thisTemp.CB['loadingCanvas'], '-ms-transform') || thisTemp.css(thisTemp.CB['loadingCanvas'], '-moz-transform') || thisTemp.css(thisTemp.CB['loadingCanvas'], '-webkit-transform') || thisTemp.css(thisTemp.CB['loadingCanvas'], '-o-transform') || '0';
2221				} catch(event) {}
2222				nowRotate = parseInt(nowRotate.replace('rotate(', '').replace('deg);', ''));
2223				nowRotate += 4;
2224				if(nowRotate > 360) {
2225					nowRotate = 0;
2226				}
2227				if(thisTemp.showFace) {
2228					thisTemp.css(thisTemp.CB['loadingCanvas'], {
2229						transform: 'rotate(' + nowRotate + 'deg)',
2230						msTransform: 'rotate(' + nowRotate + 'deg)',
2231						mozTransform: 'rotate(' + nowRotate + 'deg)',
2232						webkitTransform: 'rotate(' + nowRotate + 'deg)',
2233						oTransform: 'rotate(' + nowRotate + 'deg)'
2234					});
2235				}
2236				buffer++;
2237				if(buffer >= 99) {
2238					buffer = 99;
2239				}
2240				thisTemp.sendJS('buffer', buffer);
2241			};
2242			if(rot) {
2243				this.timerLoading = new this.timer(10, loadingFun);
2244				//this.timerLoading.start();
2245				if(this.showFace) {
2246					this.css(thisTemp.CB['loading'], 'display', 'block');
2247				}
2248			} else {
2249				thisTemp.sendJS('buffer', 100);
2250			}
2251		},
2252		/*
2253			内部函数
2254			判断是否需要显示上一集和下一集
2255		*/
2256		showFrontNext: function() {
2257			if(!this.showFace) {
2258				return;
2259			}
2260			if(this.vars['front']) {
2261				this.css([this.CB['front'], this.CB['frontLine']], 'display', 'block');
2262			} else {
2263				this.css([this.CB['front'], this.CB['frontLine']], 'display', 'none');
2264			}
2265			if(this.vars['next']) {
2266				this.css([this.CB['next'], this.CB['nextLine']], 'display', 'block');
2267			} else {
2268				this.css([this.CB['next'], this.CB['nextLine']], 'display', 'none');
2269			}
2270		},
2271		/*
2272			内部函数
2273			显示提示语
2274		*/
2275		promptShow: function(ele, data) {
2276			if(!this.showFace) {
2277				return;
2278			}
2279			var obj = {};
2280			if(ele || data) {
2281				if(!this.isUndefined(data)) {
2282					obj = data;
2283				} else {
2284					var offsetCoor = this.getCoor(ele);
2285					obj = {
2286						title: this.getDataset(ele, 'title'),
2287						x: offsetCoor['x'] + ele.offsetWidth * 0.5,
2288						y: offsetCoor['y']
2289					};
2290				}
2291				this.CB['prompt'].innerHTML = obj['title'];
2292				this.css(this.CB['prompt'], 'display', 'block');
2293				var promoptWidth = this.getStringLen(obj['title']) * 10;
2294				this.css(this.CB['promptBg'], 'width', promoptWidth + 'px');
2295				this.css(this.CB['prompt'], 'width', promoptWidth + 'px');
2296				promoptWidth += 10;
2297				var x = obj['x'] - (promoptWidth * 0.5);
2298				var y = this.PD.offsetHeight - obj['y'] + 8;
2299				if(x < 0) {
2300					x = 0;
2301				}
2302				if(x > this.PD.offsetWidth - promoptWidth) {
2303					x = this.PD.offsetWidth - promoptWidth;
2304				}
2305				this.css([this.CB['promptBg'], this.CB['prompt']], {
2306					display: 'block',
2307					left: x + 'px',
2308					bottom: y + 'px'
2309				});
2310			} else {
2311				this.css([this.CB['promptBg'], this.CB['prompt']], {
2312					display: 'none'
2313				});
2314			}
2315		},
2316		/*
2317			内部函数
2318			监听错误
2319		*/
2320		timerErrorFun: function() {
2321			var thisTemp = this;
2322			this.errorSend = false;
2323			var clearIntervalError = function(event) {
2324				if(thisTemp.timerError != null) {
2325					if(thisTemp.timerError.runing) {
2326						thisTemp.timerError.stop();
2327					}
2328					thisTemp.timerError = null;
2329				}
2330			};
2331			var errorFun = function(event) {
2332				clearIntervalError();
2333				thisTemp.error = true;
2334				//提取错误播放地址
2335				thisTemp.errorUrl = thisTemp.getVideoUrl();
2336				//提取错误播放地址结束
2337				if(!thisTemp.errorSend) {
2338					thisTemp.errorSend = true;
2339					thisTemp.sendJS('error');
2340				}
2341				if(thisTemp.showFace) {
2342					thisTemp.css(thisTemp.CB['errorText'], 'display', 'block');
2343					thisTemp.css(thisTemp.CB['pauseCenter'], 'display', 'none');
2344					thisTemp.css(thisTemp.CB['loading'], 'display', 'none');
2345				}
2346				thisTemp.V.removeAttribute('poster');
2347				thisTemp.resetPlayer();
2348			};
2349			var errorListenerFun = function(event) {
2350				window.setTimeout(function() {
2351					if(isNaN(thisTemp.V.duration)) {
2352						errorFun(event);
2353					}
2354				}, 500);
2355
2356			};
2357			if(!this.errorAdd) {
2358				this.errorAdd = true;
2359				this.addListenerInside('error', errorListenerFun, this.V);
2360			}
2361			clearIntervalError();
2362			var timerErrorFun = function() {
2363				if(thisTemp.V && parseInt(thisTemp.V.networkState) == 3) {
2364					errorFun();
2365				}
2366			};
2367			this.timerError = new this.timer(this.config['errorTime'], timerErrorFun);
2368			//this.timerError.start();
2369		},
2370		/*
2371			内部函数
2372			构建判断全屏还是非全屏的判断
2373		*/
2374		judgeFullScreen: function() {
2375			var thisTemp = this;
2376			if(this.timerFull != null) {
2377				if(this.timerFull.runing) {
2378					this.timerFull.stop();
2379				}
2380				this.timerFull = null;
2381			}
2382			var fullFun = function() {
2383				thisTemp.isFullScreen();
2384			};
2385			this.timerFull = new this.timer(20, fullFun);
2386		},
2387		/*
2388			内部函数
2389			判断是否是全屏
2390		*/
2391		isFullScreen: function() {
2392			if(!this.showFace) {
2393				return;
2394			}
2395			var fullState = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement;
2396			if(fullState && !this.full) {
2397				this.full = true;
2398				this.sendJS('full', true);
2399				this.elementCoordinate();
2400				this.css(this.CB['full'], 'display', 'none');
2401				this.css(this.CB['escFull'], 'display', 'block');
2402				if(this.vars['live'] == 0) {
2403					this.timeUpdateHandler();
2404				}
2405				this.PD.appendChild(this.CB['menu']);
2406			}
2407			if(!fullState && this.full) {
2408				this.full = false;
2409				this.sendJS('full', false);
2410				this.elementCoordinate();
2411				this.css(this.CB['full'], 'display', 'block');
2412				this.css(this.CB['escFull'], 'display', 'none');
2413				if(this.timerFull != null) {
2414					if(this.timerFull.runing) {
2415						this.timerFull.stop();
2416					}
2417					this.timerFull = null;
2418				}
2419				if(this.vars['live'] == 0) {
2420					this.timeUpdateHandler();
2421				}
2422				this.body.appendChild(this.CB['menu']);
2423			}
2424		},
2425		/*
2426			内部函数
2427			构建右键内容及注册相关动作事件
2428		*/
2429		newMenu: function() {
2430			var thisTemp = this;
2431			var i = 0;
2432			this.css(this.CB['menu'], {
2433				backgroundColor: '#FFFFFF',
2434				padding: '5px',
2435				position: 'absolute',
2436				left: '10px',
2437				top: '20px',
2438				display: 'none',
2439				zIndex: '999',
2440				color: '#A1A9BE',
2441				boxShadow: '2px 2px 3px #AAAAAA'
2442			});
2443			var mArr = this.contextMenu;
2444			var cMenu = this.ckplayerConfig['menu'];
2445			if(cMenu['name']) {
2446				if(cMenu['link']) {
2447					mArr[0] = [cMenu['name'], 'link', cMenu['link']];
2448				} else {
2449					mArr[0] = [cMenu['name'], 'default'];
2450				}
2451			}
2452			if(cMenu['version']) {
2453				mArr[1] = [cMenu['version'], 'default', 'line'];
2454			}
2455			if(cMenu['more']) {
2456				if(typeof(cMenu['more']) == 'object') {
2457					if(cMenu['more'].length > 0) {
2458						var moreArr = cMenu['more'];
2459						for(i = 0; i < moreArr.length; i++) {
2460							var mTemp = moreArr[i];
2461							var arrTemp = [];
2462							if(mTemp['name']) {
2463								arrTemp.push(mTemp['name']);
2464							}
2465							if(mTemp['clickEvent'] && mTemp['clickEvent'] != 'none') {
2466								var eveObj = this.clickEvent(mTemp['clickEvent']);
2467								arrTemp.push(eveObj['type']);
2468								if(eveObj['fun']) {
2469									arrTemp.push(eveObj['fun']);
2470								}
2471								if(eveObj['link']) {
2472									arrTemp.push(eveObj['link']);
2473								}
2474								if(eveObj['target']) {
2475									arrTemp.push(' target="' + eveObj['target'] + '"');
2476								}
2477							}
2478							if(mTemp['separatorBefore']) {
2479								arrTemp.push('line');
2480							}
2481							mArr.push(arrTemp);
2482						}
2483					}
2484				}
2485			}
2486			var html = '';
2487			for(i = 0; i < mArr.length; i++) {
2488				var me = mArr[i];
2489				switch(me[1]) {
2490					case 'default':
2491						html += '<p>' + me[0] + '</p>';
2492						break;
2493					case 'link':
2494						html += '<p><a href="' + me[2] + '"' + me[3] + '>
2494' + me[0] + '</a></p>';
2495						break;
2496					case 'javaScript':
2497						html += '<p><a href="javascript:' + me[2] + '">' + me[0] + '</a></p>';
2498						break;
2499					case 'actionScript':
2500						html += '<p><a href="javascript:' + this.vars['variable'] + me[2].replace('thisTemp', '') + '">' + me[0] + '</a></p>';
2501						break;
2502					default:
2503						break;
2504				}
2505			}
2506			this.CB['menu'].innerHTML = html;
2507			var pArr = this.CB['menu'].childNodes;
2508			for(i = 0; i < pArr.length; i++) {
2509				this.css(pArr[i], {
2510					height: '30px',
2511					lineHeight: '30px',
2512					margin: '0px',
2513					fontFamily: this.fontFamily,
2514					fontSize: '12px',
2515					paddingLeft: '10px',
2516					paddingRight: '30px'
2517				});
2518				if(mArr[i][mArr[i].length - 1] == 'line') {
2519					this.css(pArr[i], 'borderBottom', '1px solid #e9e9e9');
2520				}
2521				var aArr = pArr[i].childNodes;
2522				for(var n = 0; n < aArr.length; n++) {
2523					if(aArr[n].localName == 'a') {
2524						this.css(aArr[n], {
2525							color: '#000000',
2526							textDecoration: 'none'
2527						});
2528					}
2529				}
2530			}
2531			this.PD.oncontextmenu = function(event) {
2532				var eve = event || window.event;
2533				var client = thisTemp.client(event);
2534				if(eve.button == 2) {
2535					eve.returnvalue = false;
2536					var x = client['x'] + thisTemp.pdCoor['x'] - 2;
2537					var y = client['y'] + thisTemp.pdCoor['y'] - 2;
2538					thisTemp.css(thisTemp.CB['menu'], {
2539						display: 'block',
2540						left: x + 'px',
2541						top: y + 'px'
2542					});
2543					return false;
2544				}
2545				return true;
2546			};
2547			var setTimeOutPClose = function() {
2548				if(setTimeOutP) {
2549					window.clearTimeout(setTimeOutP);
2550					setTimeOutP = null;
2551				}
2552			};
2553			var setTimeOutP = null;
2554			var mouseOut = function(event) {
2555				setTimeOutPClose();
2556				setTimeOutP = window.setTimeout(function(event) {
2557					thisTemp.css(thisTemp.CB['menu'], 'display', 'none');
2558				}, 500);
2559			};
2560			this.addListenerInside('mouseout', mouseOut, thisTemp.CB['menu']);
2561			var mouseOver = function(event) {
2562				setTimeOutPClose();
2563			};
2564			this.addListenerInside('mouseover', mouseOver, thisTemp.CB['menu']);
2565
2566		},
2567		/*
2568			内部函数
2569			构建控制栏隐藏事件
2570		*/
2571		controlBarHide: function(hide) {
2572			var thisTemp = this;
2573			var client = {
2574					x: 0,
2575					y: 0
2576				},
2577				oldClient = {
2578					x: 0,
2579					y: 0
2580				};
2581			var cShow = true,
2582				force = false;
2583			var oldCoor = [0, 0];
2584			var controlBarShow = function(show) {
2585				if(show && !cShow && thisTemp.controlBarIsShow) {
2586					cShow = true;
2587					thisTemp.sendJS('controlBar', true);
2588					thisTemp.css(thisTemp.CB['controlBarBg'], 'display', 'block');
2589					thisTemp.css(thisTemp.CB['controlBar'], 'display', 'block');
2590					thisTemp.css(thisTemp.CB['timeProgressBg'], 'display', 'block');
2591					thisTemp.css(thisTemp.CB['timeBoBg'], 'display', 'block');
2592					thisTemp.changeVolume(thisTemp.volume);
2593					thisTemp.changeLoad();
2594					if(!thisTemp.timerBuffer) {
2595						thisTemp.bufferEdHandler();
2596					}
2597				} else {
2598					if(cShow) {
2599						cShow = false;
2600						var paused = thisTemp.getMetaDate()['paused'];
2601						if(force) {
2602							paused = false;
2603						}
2604						if(!paused) {
2605							thisTemp.sendJS('controlBar', false);
2606							thisTemp.css(thisTemp.CB['controlBarBg'], 'display', 'none');
2607							thisTemp.css(thisTemp.CB['controlBar'], 'display', 'none');
2608							thisTemp.css(thisTemp.CB['timeProgressBg'], 'display', 'none');
2609							thisTemp.css(thisTemp.CB['timeBoBg'], 'display', 'none');
2610							thisTemp.promptShow(false);
2611
2612						}
2613					}
2614				}
2615			};
2616			var cbarFun = function(event) {
2617				if(client['x'] == oldClient['x'] && client['y'] == oldClient['y']) {
2618					var cdH = parseInt(thisTemp.CD.offsetHeight);
2619					if((client['y'] < cdH - 50 || client['y'] > cdH - 2) && cShow) {
2620						controlBarShow(false);
2621					}
2622				} else {
2623					if(!cShow) {
2624						controlBarShow(true);
2625					}
2626				}
2627				oldClient = {
2628					x: client['x'],
2629					y: client['y']
2630				}
2631			};
2632			this.timerCBar = new this.timer(2000, cbarFun);
2633			var cdMove = function(event) {
2634				var getClient = thisTemp.client(event);
2635				client['x'] = getClient['x'];
2636				client['y'] = getClient['y'];
2637				if(!cShow) {
2638					controlBarShow(true);
2639				}
2640			};
2641			this.addListenerInside('mousemove', cdMove, thisTemp.CD);
2642			this.addListenerInside('ended', cdMove);
2643			this.addListenerInside('resize', cdMove, window);
2644			if(hide === true) {
2645				cShow = true;
2646				force = true;
2647				controlBarShow(false);
2648			}
2649			if(hide === false) {
2650				cShow = false;
2651				force = true;
2652				controlBarShow(true);
2653			}
2654		},
2655
2656		/*
2657			内部函数
2658			注册键盘按键事件
2659		*/
2660		keypress: function() {
2661			var thisTemp = this;
2662			var keyDown = function(eve) {
2663				var keycode = eve.keyCode || eve.which;
2664				switch(keycode) {
2665					case 32:
2666						thisTemp.playOrPause();
2667						break;
2668					case 37:
2669						thisTemp.fastBack();
2670						break;
2671					case 39:
2672						thisTemp.fastNext();
2673						break;
2674					case 38:
2675						now = thisTemp.volume + thisTemp.ckplayerConfig['config']['volumeJump'];
2676						thisTemp.changeVolume(now > 1 ? 1 : now);
2677						break;
2678					case 40:
2679						now = thisTemp.volume - thisTemp.ckplayerConfig['config']['volumeJump'];
2680						thisTemp.changeVolume(now < 0 ? 0 : now);
2681						break;
2682					default:
2683						break;
2684				}
2685			};
2686			this.addListenerInside('keydown', keyDown, window || document);
2687		},
2688		/*
2689			内部函数
2690			注册倍速相关
2691		*/
2692		playbackRate: function() {
2693			if(!this.showFace) {
2694				return;
2695			}
2696			var thisTemp = this;
2697			var vArr = this.playbackRateArr;
2698			var html = '';
2699			var nowD = ''; //当前的清晰度
2700			var i = 0;
2701			if(!nowD) {
2702				nowD = vArr[this.playbackRateDefault][1];
2703			}
2704			if(vArr.length > 1) {
2705				var zlen = 0;
2706				for(i = 0; i < vArr.length; i++) {
2707					html = '<p>' + vArr[i][1] + '</p>' + html;
2708					var dlen = this.getStringLen(vArr[i][1]);
2709					if(dlen > zlen) {
2710						zlen = dlen;
2711					}
2712				}
2713				if(html) {
2714					html += '<p>' + nowD + '</p>';
2715				}
2716				this.CB['playbackrate'].innerHTML = nowD;
2717				this.CB['playbackrateP'].innerHTML = html;
2718				this.css([this.CB['playbackrate'], this.CB['playbackrateLine']], 'display', 'block');
2719				var pArr = this.CB['playbackrateP'].childNodes;
2720				for(var i = 0; i < pArr.length; i++) {
2721					var fontColor = '#FFFFFF';
2722					if(pArr[i].innerHTML == nowD) {
2723						fontColor = '#0782F5';
2724					}
2725					this.css(pArr[i], {
2726						color: fontColor,
2727						margin: '0px',
2728						padding: '0px',
2729						fontSize: '14px'
2730					});
2731					if(i < pArr.length - 1) {
2732						this.css(pArr[i], 'borderBottom', '1px solid #282828')
2733					}
2734					var defClick = function(event) {
2735						if(nowD != this.innerHTML) {
2736							thisTemp.css(thisTemp.CB['playbackrateP'], 'display', 'none');
2737							thisTemp.newPlaybackrate(this.innerHTML);
2738							thisTemp.sendJS('clickEvent', 'actionScript->newPlaybackrate');
2739						}
2740					};
2741					this.addListenerInside('click', defClick, pArr[i]);
2742
2743				}
2744				var pW = (zlen * 10) + 20;
2745				this.css(this.CB['playbackrateP'], {
2746					width: pW + 'px'
2747				});
2748				this.css(this.CB['playbackrate'], {
2749					width: pW + 'px'
2750				});
2751				this.buttonWidth['playbackrate'] = this.CB['playbackrate'].offsetWidth;
2752			} else {
2753				this.CB['playbackrate'].innerHTML = '';
2754				this.CB['playbackrateP'].innerHTML = '';
2755				this.css([this.CB['playbackrate'], this.CB['playbackrateLine']], 'display', 'none');
2756			}
2757		},
2758		/*
2759			内部函数
2760			注册切换倍速播放相关事件
2761		*/
2762		addPlaybackrate: function() {
2763			var thisTemp = this;
2764			var setTimeOutP = null;
2765			var defClick = function(event) {
2766				thisTemp.css(thisTemp.CB['playbackrateP'], {
2767					left: thisTemp.getCoor(thisTemp.CB['playbackrate'])['x'] + 'px',
2768					display: 'block'
2769				});
2770			};
2771			this.addListenerInside('click', defClick, this.CB['playbackrate']);
2772			var defMouseOut = function(event) {
2773				if(setTimeOutP) {
2774					window.clearTimeout(setTimeOutP);
2775					setTimeOutP = null;
2776				}
2777				setTimeOutP = window.setTimeout(function(event) {
2778					thisTemp.css(thisTemp.CB['playbackrateP'], 'display', 'none');
2779				}, 500);
2780			};
2781			this.addListenerInside('mouseout', defMouseOut, thisTemp.CB['playbackrateP']);
2782			var defMouseOver = function(event) {
2783				if(setTimeOutP) {
2784					window.clearTimeout(setTimeOutP);
2785					setTimeOutP = null;
2786				}
2787			};
2788			this.addListenerInside('mouseover', defMouseOver, thisTemp.CB['playbackrateP']);
2789		},
2790		/*
2791			内部函数
2792			切换倍速后发生的动作
2793		*/
2794		newPlaybackrate: function(title) {
2795			var vArr = this.playbackRateArr;
2796			var nVArr = [];
2797			var i = 0;
2798			for(i = 0; i < vArr.length; i++) {
2799				var v = vArr[i];
2800				if(v[1] == title) {
2801					this.playbackRateDefault = i;
2802					this.V.playbackRate = v[0];
2803					if(this.showFace) {
2804						this.CB['playbackrate'].innerHTML = v[1];
2805						this.playbackRate();
2806					}
2807					this.sendJS('playbackRate', v);
2808				}
2809			}
2810		},
2811
2812		/*
2813			内部函数
2814			构建清晰度按钮及切换事件(Click事件)
2815		*/
2816		definition: function() {
2817			if(!this.showFace) {
2818				return;
2819			}
2820			var thisTemp = this;
2821			var vArr = this.VA;
2822			var dArr = [];
2823			var html = '';
2824			var nowD = ''; //当前的清晰度
2825			var i = 0;
2826			for(i = 0; i < vArr.length; i++) {
2827				var d = vArr[i][2];
2828				if(dArr.indexOf(d) == -1) {
2829					dArr.push(d);
2830				}
2831				if(this.V) {
2832					if(vArr[i][0] == this.V.currentSrc) {
2833						nowD = d;
2834					}
2835				}
2836			}
2837			if(!nowD) {
2838				nowD = dArr[0];
2839			}
2840			if(dArr.length > 1) {
2841				var zlen = 0;
2842				for(i = dArr.length - 1; i > -1; i--) {
2843					html = '<p>' + dArr[i] + '</p>' + html;
2844					var dlen = this.getStringLen(dArr[i]);
2845					if(dlen > zlen) {
2846						zlen = dlen;
2847					}
2848				}
2849				if(html) {
2850					html += '<p>' + nowD + '</p>';
2851				}
2852				this.CB['definition'].innerHTML = nowD;
2853				this.CB['definitionP'].innerHTML = html;
2854				this.css([this.CB['definition'], this.CB['definitionLine']], 'display', 'block');
2855				var pArr = this.CB['definitionP'].childNodes;
2856				for(var i = 0; i < pArr.length; i++) {
2857					var fontColor = '#FFFFFF';
2858					if(pArr[i].innerHTML == nowD) {
2859						fontColor = '#0782F5';
2860					}
2861					this.css(pArr[i], {
2862						color: fontColor,
2863						margin: '0px',
2864						padding: '0px',
2865						fontSize: '14px'
2866					});
2867					if(i < pArr.length - 1) {
2868						this.css(pArr[i], 'borderBottom', '1px solid #282828')
2869					}
2870					var defClick = function() {
2871						if(nowD != this.innerHTML) {
2872							thisTemp.css(thisTemp.CB['definitionP'], 'display', 'none');
2873							thisTemp.newDefinition(this.innerHTML);
2874						}
2875					};
2876					this.addListenerInside('click', defClick, pArr[i]);
2877
2878				}
2879				var pW = (zlen * 10) + 20;
2880				this.css(this.CB['definitionP'], {
2881					width: pW + 'px'
2882				});
2883				this.css(this.CB['definition'], {
2884					width: pW + 'px'
2885				});
2886				this.buttonWidth['definition'] = this.CB['definition'].offsetWidth;
2887			} else {
2888				this.CB['definition'].innerHTML = '';
2889				this.CB['definitionP'].innerHTML = '';
2890				this.css([this.CB['definition'], this.CB['definitionLine']], 'display', 'none');
2891			}
2892		},
2893		/*
2894			内部函数
2895			注册清晰度相关事件
2896		*/
2897		addDefListener: function() {
2898			var thisTemp = this;
2899			var setTimeOutP = null;
2900			var defClick = function(event) {
2901				thisTemp.css(thisTemp.CB['definitionP'], {
2902					left: thisTemp.getCoor(thisTemp.CB['definition'])['x'] + 'px',
2903					display: 'block'
2904				});
2905			};
2906			this.addListenerInside('click', defClick, this.CB['definition']);
2907			var defMouseOut = function(event) {
2908				if(setTimeOutP) {
2909					window.clearTimeout(setTimeOutP);
2910					setTimeOutP = null;
2911				}
2912				setTimeOutP = window.setTimeout(function(event) {
2913					thisTemp.css(thisTemp.CB['definitionP'], 'display', 'none');
2914				}, 500);
2915			};
2916			this.addListenerInside('mouseout', defMouseOut, thisTemp.CB['definitionP']);
2917			var defMouseOver = function(event) {
2918				if(setTimeOutP) {
2919					window.clearTimeout(setTimeOutP);
2920					setTimeOutP = null;
2921				}
2922			};
2923			this.addListenerInside('mouseover', defMouseOver, thisTemp.CB['definitionP']);
2924		},
2925		/*
2926			内部函数
2927			切换清晰度后发生的动作
2928		*/
2929		newDefinition: function(title) {
2930			var vArr = this.VA;
2931			var nVArr = [];
2932			var i = 0;
2933			for(i = 0; i < vArr.length; i++) {
2934				var v = vArr[i];
2935				if(v[2] == title) {
2936					nVArr.push(v);
2937					this.sendJS('definitionChange', i + '');
2938				}
2939			}
2940			if(nVArr.length < 1) {
2941				return;
2942			}
2943			if(this.V != null && this.needSeek == 0) {
2944				this.needSeek = this.V.currentTime;
2945			}
2946			if(this.getFileExt(nVArr[0][0]) != '.m3u8') {
2947				this.isM3u8 = false;
2948			}
2949			if(!this.isM3u8) {
2950				if(nVArr.length == 1) {
2951					this.V.innerHTML = '';
2952					this.V.src = nVArr[0][0];
2953				} else {
2954					var source = '';
2955					nVArr = this.arrSort(nVArr);
2956					for(i = 0; i < nVArr.length; i++) {
2957						var type = '';
2958						var va = nVArr[i];
2959						if(va[1]) {
2960							type = ' type="' + va[1] + '"';
2961						}
2962						source += '<source src="' + va[0] + '"' + type + '>';
2963					}
2964					this.V.removeAttribute('src');
2965					this.V.innerHTML = source;
2966				}
2967			} else {
2968				this.embedHls(vArr[0][0], this.vars['autoplay']);
2969			}
2970			this.V.autoplay = 'autoplay';
2971			this.V.load();
2972			this.timerErrorFun();
2973		},
2974		/*
2975			内置函数
2976			播放hls
2977		*/
2978		embedHls: function(url, autoplay) {
2979			var thisTemp = this;
2980			if(Hls.isSupported()) {
2981				var hls = new Hls();
2982				hls.loadSource(url);
2983				hls.attachMedia(this.V);
2984				hls.on(Hls.Events.MANIFEST_PARSED, function() {
2985					thisTemp.playerLoad();
2986					if(autoplay) {
2987						thisTemp.videoPlay();
2988					}
2989				});
2990			}
2991		},
2992		/*
2993			内部函数
2994			构建提示点
2995		*/
2996		prompt: function() {
2997			if(!this.showFace) {
2998				return;
2999			}
3000			var thisTemp = this;
3001			var prompt = this.vars['promptSpot'];
3002			if(prompt == null || this.promptArr.length > 0) {
3003				return;
3004			}
3005			var showPrompt = function(event) {
3006				if(thisTemp.promptElement == null) {
3007					var random2 = 'prompte' + thisTemp.randomString(5);
3008					var ele2 = document.createElement('div');
3009					ele2.className = random2;
3010					thisTemp.PD.appendChild(ele2);
3011					thisTemp.promptElement = thisTemp.getByElement(random2);
3012					thisTemp.css(thisTemp.promptElement, {
3013						overflowX: 'hidden',
3014						lineHeight: '22px',
3015						fontSize: '14px',
3016						color: '#FFFFFF',
3017						position: 'absolute',
3018						display: 'block',
3019						zIndex: '90'
3020					});
3021				}
3022				var pcon = thisTemp.getPromptTest();
3023				var pW = pcon['pW'],
3024					pT = pcon['pT'],
3025					pL = parseInt(thisTemp.css(this, 'left')) - parseInt(pW * 0.5);
3026				if(pcon['pL'] > 10) {
3027					pL = pcon['pL'];
3028				}
3029				if(pL < 0) {
3030					pL = 0;
3031				}
3032				thisTemp.css(thisTemp.promptElement, {
3033					width: pW + 'px',
3034					left: (-pW - 10) + 'px',
3035					display: 'block'
3036				});
3037				thisTemp.promptElement.innerHTML = thisTemp.getDataset(this, 'words');
3038				thisTemp.css(thisTemp.promptElement, {
3039					left: pL + 'px',
3040					top: (pT - thisTemp.promptElement.offsetHeight - 10) + 'px'
3041				});
3042			};
3043			var hidePrompt = function(event) {
3044				if(thisTemp.promptElement != null) {
3045					thisTemp.css(thisTemp.promptElement, {
3046						display: 'none'
3047					});
3048				}
3049			};
3050			var i = 0;
3051			for(i = 0; i < prompt.length; i++) {
3052				var pr = prompt[i];
3053				var words = pr['words'];
3054				var time = pr['time'];
3055				var random = 'prompt' + this.randomString(5);
3056				var ele = document.createElement('div');
3057				ele.className = random;
3058				this.CB['timeBoBg'].appendChild(ele);
3059				var div = this.getByElement(random);
3060				div.setAttribute('data-time', time);
3061				div.setAttribute('data-words', words);
3062				this.css(div, {
3063					width: '6px',
3064					height: '6px',
3065					backgroundColor: '#FFFFFF',
3066					position: 'absolute',
3067					top: '4px',
3068					left: '-100px',
3069					display: 'none',
3070					zIndex: '1',
3071					borderRadius: '6px'
3072				});
3073
3074				this.addListenerInside('mouseover', showPrompt, div);
3075				this.addListenerInside('mouseout', hidePrompt, div);
3076				this.promptArr.push(div);
3077			}
3078			this.changePrompt();
3079		},
3080		/*
3081			内部函数
3082			计算提示文本的位置
3083		*/
3084		getPromptTest: function() {
3085			var pW = this.previewWidth,
3086				pT = this.getCoor(this.CB['timeButton'])['y'],
3087				pL = 0;
3088			if(this.previewTop != null) {
3089				pT -= parseInt(this.css(this.previewTop, 'height'));
3090				pL = parseInt(this.css(this.previewTop, 'left'));
3091			} else {
3092				pT -= 35;
3093			}
3094			pL += 2;
3095			if(pL < 0) {
3096				pL = 0;
3097			}
3098			if(pL > this.PD.offsetWidth - pW) {
3099				pL = this.PD.offsetWidth - pW;
3100			}
3101			return {
3102				pW: pW,
3103				pT: pT,
3104				pL: pL
3105			};
3106		},
3107		/*
3108			内部函数
3109			删除提示点
3110		*/
3111		deletePrompt: function() {
3112			var arr = this.promptArr;
3113			if(arr.length > 0) {
3114				for(var i = 0; i < arr.length; i++) {
3115					if(arr[i]) {
3116						this.deleteChild(arr[i]);
3117					}
3118				}
3119			}
3120			this.promptArr = [];
3121		},
3122		/*
3123			内部函数
3124			计算提示点坐标
3125		*/
3126		changePrompt: function() {
3127			if(this.promptArr.length == 0) {
3128				return;
3129			}
3130			var arr = this.promptArr;
3131			var duration = this.getMetaDate()['duration'];
3132			var bw = this.CB['timeBoBg'].offsetWidth;
3133			for(var i = 0; i < arr.length; i++) {
3134				var time = parseInt(this.getDataset(arr[i], 'time'));
3135				var left = parseInt(time * bw / duration) - parseInt(arr[i].offsetWidth * 0.5);
3136				if(left < 0) {
3137					left = 0;
3138				}
3139				if(left > bw - parseInt(arr[i].offsetWidth * 0.5)) {
3140					left = bw - parseInt(arr[i].offsetWidth * 0.5);
3141				}
3142				this.css(arr[i], {
3143					left: left + 'px',
3144					display: 'block'
3145				});
3146			}
3147		},
3148		/*
3149			内部函数
3150			构建预览图片效果
3151		*/
3152		preview: function(obj) {
3153			var thisTemp = this;
3154			var preview = {
3155				file: null,
3156				scale: 0
3157			};
3158			preview = this.standardization(preview, this.vars['preview']);
3159			if(preview['file'] == null || preview['scale'] <= 0) {
3160				return;
3161			}
3162			var srcArr = preview['file'];
3163			if(this.previewStart == 0) { //如果还没有构建,则先进行构建
3164				this.previewStart = 1;
3165				if(srcArr.length > 0) {
3166					var i = 0;
3167					var imgW = 0,
3168						imgH = 0;
3169					var random = thisTemp.randomString(10);
3170					var loadNum = 0;
3171					var loadImg = function(i) {
3172						srcArr[i] = thisTemp.getNewUrl(srcArr[i]);
3173						var n = 0;
3174						var img = new Image();
3175						img.src = srcArr[i];
3176						img.className = random + i;
3177						img.onload = function(event) {
3178							loadNum++;
3179							if(thisTemp.previewDiv == null) { //如果没有建立DIV,则建
3180								imgW = img.width;
3181								imgH = img.height;
3182								thisTemp.previewWidth = parseInt(imgW * 0.1);
3183								var ele = document.createElement('div');
3184								ele.className = random;
3185								thisTemp.PD.appendChild(ele);
3186								thisTemp.previewDiv = thisTemp.getByElement(random);
3187								var eleTop = (obj['y'] - parseInt(imgH * 0.1) + 2);
3188								thisTemp.css(thisTemp.previewDiv, {
3189									width: srcArr.length * imgW * 10 + 'px',
3190									height: parseInt(imgH * 0.1) + 'px',
3191									backgroundColor: '#000000',
3192									position: 'absolute',
3193									left: '0px',
3194									top: eleTop + 'px',
3195									display: 'none',
3196									zIndex: '80'
3197								});
3198								ele.setAttribute('data-x', '0');
3199								ele.setAttribute('data-y', eleTop);
3200								var ele2 = document.createElement('div');
3201								ele2.className = random + 'd2';
3202								thisTemp.PD.appendChild(ele2);
3203								thisTemp.previewTop = thisTemp.getByElement(ele2.className);
3204								thisTemp.css(thisTemp.previewTop, {
3205									width: parseInt(imgW * 0.1) + 'px',
3206									height: parseInt(imgH * 0.1) + 'px',
3207									position: 'absolute',
3208									border: '5px solid ' + thisTemp.css(thisTemp.CB['timeProgress'], 'backgroundColor'),
3209									left: '0px',
3210									top: (obj['y'] - parseInt(imgH * 0.1) + 2) + 'px',
3211									display: 'none',
3212									zIndex: '81'
3213								});
3214								var html = '';
3215								for(n = 0; n < srcArr.length; n++) {
3216									html += thisTemp.newCanvas(random + n, imgW * 10, parseInt(imgH * 0.1))
3217								}
3218								thisTemp.previewDiv.innerHTML = html;
3219							}
3220							thisTemp.previewDiv.appendChild(img);
3221							var cimg = thisTemp.getByElement(img.className);
3222							var canvas = thisTemp.getByElement(img.className + '-canvas');
3223							var context = canvas.getContext('2d');
3224							var sx = 0,
3225								sy = 0,
3226								x = 0,
3227								h = parseInt(imgH * 0.1);
3228							for(n = 0; n < 100; n++) {
3229								x = parseInt(n * imgW * 0.1);
3230								context.drawImage(cimg, sx, sy, parseInt(imgW * 0.1), h, x, 0, parseInt(imgW * 0.1), h);
3231								sx += parseInt(imgW * 0.1);
3232								if(sx >= imgW) {
3233									sx = 0;
3234									sy += h;
3235								}
3236								thisTemp.css(cimg, 'display', 'none');
3237							}
3238							if(loadNum == srcArr.length) {
3239								thisTemp.previewStart = 2;
3240							} else {
3241								i++;
3242								loadImg(i);
3243							}
3244						};
3245					};
3246				}
3247				loadImg(i);
3248				return;
3249			}
3250			if(this.previewStart == 2) {
3251				var isTween = true;
3252				var nowNum = parseInt(obj['time'] / this.vars['preview']['scale']);
3253				var numTotal = parseInt(thisTemp.getMetaDate()['duration'] / this.vars['preview']['scale']);
3254				if(thisTemp.css(thisTemp.previewDiv, 'display') == 'none') {
3255					isTween = false;
3256				}
3257				thisTemp.css(thisTemp.previewDiv, 'display', 'block');
3258				var imgWidth = thisTemp.previewDiv.offsetWidth * 0.01 / srcArr.length;
3259				var left = (imgWidth * nowNum) - obj['x'] + parseInt(imgWidth * 0.5),
3260					top = obj['y'] - thisTemp.previewDiv.offsetHeight;
3261				thisTemp.css(thisTemp.previewDiv, 'top', top + 2 + 'px');
3262				var topLeft = obj['x'] - parseInt(imgWidth * 0.5);
3263				var timepieces = 0;
3264				if(topLeft < 0) {
3265					topLeft = 0;
3266					timepieces = obj['x'] - topLeft - imgWidth * 0.5;
3267				}
3268				if(topLeft > thisTemp.PD.offsetWidth - imgWidth) {
3269					topLeft = thisTemp.PD.offsetWidth - imgWidth;
3270					timepieces = obj['x'] - topLeft - imgWidth * 0.5;
3271				}
3272				if(left < 0) {
3273					left = 0;
3274				}
3275				if(left > numTotal * imgWidth - thisTemp.PD.offsetWidth) {
3276					left = numTotal * imgWidth - thisTemp.PD.offsetWidth;
3277				}
3278				thisTemp.css(thisTemp.previewTop, {
3279					left: topLeft + 'px',
3280					top: top + 2 + 'px',
3281					display: 'block'
3282				});
3283				if(thisTemp.previewTop.offsetHeight > thisTemp.previewDiv.offsetHeight) {
3284					thisTemp.css(thisTemp.previewTop, {
3285						height: thisTemp.previewDiv.offsetHeight - (thisTemp.previewTop.offsetHeight - thisTemp.previewDiv.offsetHeight) + 'px'
3286					});
3287				}
3288				if(this.previewTween != null) {
3289					this.animatePause(this.previewTween);
3290					this.previewTween = null
3291				}
3292				var nowLeft = parseInt(thisTemp.css(thisTemp.previewDiv, 'left'));
3293				var leftC = nowLeft + left;
3294				if(nowLeft == -(left + timepieces)) {
3295					return;
3296				}
3297				if(isTween) {
3298					var obj = {
3299						element: thisTemp.previewDiv,
3300						start: null,
3301						end: -(left + timepieces),
3302						speed: 0.3
3303					};
3304					this.previewTween = this.animate(obj);
3305				} else {
3306					thisTemp.css(thisTemp.previewDiv, 'left', -(left + timepieces) + 'px')
3307				}
3308			}
3309		},
3310		/*
3311			内部函数
3312			删除预览图节点
3313		*/
3314		deletePreview: function() {
3315			if(this.previewDiv != null) {
3316				this.deleteChild(this.previewDiv);
3317				this.previewDiv = null;
3318				this.previewStart = 0;
3319			}
3320		},
3321		/*
3322			内部函数
3323			修改视频地址,属性
3324		*/
3325		changeVideo: function() {
3326			if(!this.html5Video) {
3327				this.getVarsObject();
3328				this.V.newVideo(this.vars);
3329				return;
3330			}
3331			var vArr = this.VA;
3332			var v = this.vars;
3333			var i = 0;
3334			if(vArr.length < 1) {
3335				return;
3336			}
3337			if(this.V != null && this.needSeek == 0) {
3338				this.needSeek = this.V.currentTime;
3339			}
3340			if(v['poster']) {
3341				this.V.poster = v['poster'];
3342			} else {
3343				this.V.removeAttribute('poster');
3344			}
3345			if(v['loop']) {
3346				this.V.loop = 'loop';
3347			} else {
3348				this.V.removeAttribute('loop');
3349			}
3350			if(v['seek'] > 0) {
3351				this.needSeek = v['seek'];
3352			} else {
3353				this.needSeek = 0;
3354			}
3355			if(this.getFileExt(vArr[0][0]) != '.m3u8') {
3356				this.isM3u8 = false;
3357			}
3358			if(!this.isM3u8) {
3359				if(vArr.length == 1) {
3360					this.V.innerHTML = '';
3361					this.V.src = vArr[0][0];
3362				} else {
3363					var source = '';
3364					vArr = this.arrSort(vArr);
3365					for(i = 0; i < vArr.length; i++) {
3366						var type = '';
3367						var va = vArr[i];
3368						if(va[1]) {
3369							type = ' type="' + va[1] + '"';
3370						}
3371						source += '<source src="' + va[0] + '"' + type + '>';
3372					}
3373					this.V.removeAttribute('src');
3374					this.V.innerHTML = source;
3375				}
3376				//分析视频地址结束
3377				if(v['autoplay']) {
3378					this.V.autoplay = 'autoplay';
3379				} else {
3380					this.V.removeAttribute('autoplay');
3381				}
3382				this.V.load();
3383			} else {
3384				this.embedHls(vArr[0][0], v['autoplay']);
3385			}
3386			if(!this.isUndefined(v['volume'])) {
3387				this.changeVolume(v['volume']);
3388			}
3389			this.resetPlayer(); //重置界面元素
3390			this.timerErrorFun();
3391			//如果存在字幕则加载
3392			if(this.vars['cktrack']) {
3393				this.loadTrack();
3394			}
3395		},
3396		/*
3397			内部函数
3398			调整中间暂停按钮,缓冲loading,错误提示文本框的位置
3399		*/
3400		elementCoordinate: function() {
3401			this.pdCoor = this.getXY(this.PD);
3402			this.css(this.CB['pauseCenter'], {
3403				left: parseInt((this.PD.offsetWidth - 80) * 0.5) + 'px',
3404				top: parseInt((this.PD.offsetHeight - 80) * 0.5) + 'px'
3405			});
3406			this.css(this.CB['loading'], {
3407				left: parseInt((this.PD.offsetWidth - 60) * 0.5) + 'px',
3408				top: parseInt((this.PD.offsetHeight - 60) * 0.5) + 'px'
3409			});
3410			this.css(this.CB['errorText'], {
3411				left: parseInt((this.PD.offsetWidth - 120) * 0.5) + 'px',
3412				top: parseInt((this.PD.offsetHeight - 30) * 0.5) + 'px'
3413			});
3414			this.css(this.CB['logo'], {
3415				left: parseInt(this.PD.offsetWidth - this.CB['logo'].offsetWidth - 20) + 'px',
3416				top: '20px'
3417			});
3418			this.checkBarWidth();
3419		},
3420		/*
3421			内部函数
3422			当播放器尺寸变化时,显示和隐藏相关节点
3423		*/
3424		checkBarWidth: function() {
3425			if(!this.showFace) {
3426				return;
3427			}
3428			var controlBarW = this.CB['controlBar'].offsetWidth;
3429			var ele = [];
3430			ele.push([
3431				[this.CB['full'], this.CB['escFull'], this.CB['fullLine']], this.buttonWidth['full'] + 2, 'full'
3432			]);
3433			if(this.vars['front'] != '') {
3434				ele.push([
3435					[this.CB['front'], this.CB['frontLine']], this.buttonWidth['front'] + 2
3436				]);
3437			}
3438			if(this.vars['next'] != '') {
3439				ele.push([
3440					[this.CB['next'], this.CB['nextLine']], this.buttonWidth['next'] + 2
3441				]);
3442			}
3443			if(this.CB['definition'].innerHTML != '') {
3444				ele.push([
3445					[this.CB['definition'], this.CB['definitionLine']], this.buttonWidth['definition'] + 2
3446				]);
3447			}
3448			ele.push([
3449				[this.CB['volume']], this.buttonWidth['volume']
3450			]);
3451			ele.push([
3452				[this.CB['mute'], this.CB['escMute'], this.CB['muteLine']], this.buttonWidth['mute'] + 2, 'mute'
3453			]);
3454			ele.push([
3455				[this.CB['timeText']], this.buttonWidth['timeText']
3456			]);
3457			ele.push([
3458				[this.CB['play'], this.CB['pause'], this.CB['playLine']], this.buttonWidth['play'] + 2, 'play'
3459			]);
3460
3461			var i = 0;
3462			var len = 0;
3463			var isc = true;
3464			//计算所有要显示的节点的总宽度
3465			for(var i = 0; i < ele.length; i++) {
3466				var nlen = ele[i][1];
3467				if(nlen > 2) {
3468					len += nlen;
3469				} else {
3470					isc = false;
3471				}
3472			}
3473			if(isc) {
3474				this.buttonLen = len;
3475				this.buttonArr = ele;
3476			}
3477			len = this.buttonLen;
3478			ele = this.buttonArr;
3479			for(var i = 0; i < ele.length; i++) {
3480				if(len > controlBarW) {
3481					len -= ele[i][1];
3482					this.css(ele[i][0], 'display', 'none');
3483				} else {
3484					this.css(ele[i][0], 'display', 'block');
3485					if(ele[i].length == 3) {
3486						var name = ele[i][2];
3487						switch(name) {
3488							case 'mute':
3489								if(this.volume == 0) {
3490									this.css(this.CB['mute'], 'display', 'none');
3491								} else {
3492									this.css(this.CB['escMute'], 'display', 'none');
3493								}
3494								break;
3495							case 'play':
3496								this.playShow(this.V.paused ? false : true);
3497								break;
3498							case 'full':
3499								if(this.full) {
3500									this.css(this.CB['full'], 'display', 'none');
3501								} else {
3502									this.css(this.CB['escFull'], 'display', 'none');
3503								}
3504								break;
3505						}
3506					}
3507				}
3508			}
3509		},
3510		/*
3511			内部函数
3512			初始化暂停或播放按钮
3513		*/
3514		initPlayPause: function() {
3515			if(!this.showFace) {
3516				return;
3517			}
3518			if(this.vars['autoplay']) {
3519				this.css([this.CB['play'], this.CB['pauseCenter']], 'display', 'none');
3520				this.css(this.CB['pause'], 'display', 'block');
3521			} else {
3522				this.css(this.CB['play'], 'display', 'block');
3523				if(this.css(this.CB['errorText'], 'display') == 'none') {
3524					this.css(this.CB['pauseCenter'], 'display', 'block');
3525				}
3526				this.css(this.CB['pause'], 'display', 'none');
3527			}
3528		},
3529
3530		/*
3531			下面为监听事件
3532			内部函数
3533			监听元数据已加载
3534		*/
3535		loadedHandler: function() {
3536			this.loaded = true;
3537			if(this.vars['loaded'] != '') {
3538				try {
3539					eval(this.vars['loaded'] + '()');
3540				} catch(event) {
3541					this.log(event);
3542				}
3543			}
3544		},
3545		/*
3546			内部函数
3547			监听播放
3548		*/
3549		playingHandler: function() {
3550			this.playShow(true);
3551			if(this.needSeek > 0) {
3552				this.videoSeek(this.needSeek);
3553				this.needSeek = 0;
3554			}
3555			if(this.animatePauseArray.length > 0) {
3556				this.animateResume('pause');
3557			}
3558			if(this.playerType == 'html5video' && this.V != null && this.config['videoDrawImage']) {
3559				this.sendVCanvas();
3560			}
3561		},
3562		/*
3563			内部函数
3564			使用画布附加视频
3565		*/
3566		sendVCanvas: function() {
3567			if(this.timerVCanvas == null) {
3568				this.css(this.V, 'display', 'none');
3569				this.css(this.MD, 'display', 'block');
3570				var thisTemp = this;
3571				var videoCanvas = function() {
3572					if(thisTemp.MDCX.width != thisTemp.PD.offsetWidth) {
3573						thisTemp.MDC.width = thisTemp.PD.offsetWidth;
3574					}
3575					if(thisTemp.MDCX.height != thisTemp.PD.offsetHeight) {
3576						thisTemp.MDC.height = thisTemp.PD.offsetHeight;
3577					}
3578					thisTemp.MDCX.clearRect(0, 0, thisTemp.MDCX.width, thisTemp.MDCX.height);
3579					var coor = thisTemp.getProportionCoor(thisTemp.PD.offsetWidth, thisTemp.PD.offsetHeight, thisTemp.V.videoWidth, thisTemp.V.videoHeight);
3580					thisTemp.MDCX.drawImage(thisTemp.V, 0, 0, thisTemp.V.videoWidth, thisTemp.V.videoHeight, coor['x'], coor['y'], coor['width'], coor['height']);
3581				};
3582				this.timerVCanvas = new this.timer(0, videoCanvas);
3583			}
3584		},
3585		/*
3586			内部函数
3587			监听暂停
3588		*/
3589		pauseHandler: function() {
3590			this.playShow(false);
3591			if(this.animatePauseArray.length > 0) {
3592				this.animatePause('pause');
3593			}
3594			if(this.playerType == 'html5video' && this.V != null && this.config['videoDrawImage']) {
3595				this.stopVCanvas();
3596			}
3597		},
3598		/*
3599			内部函数
3600			停止画布
3601		*/
3602		stopVCanvas: function() {
3603			if(this.timerVCanvas != null) {
3604				this.css(this.V, 'display', 'block');
3605				this.css(this.MD, 'display', 'none');
3606				if(this.timerVCanvas.runing) {
3607					this.timerVCanvas.stop();
3608				}
3609				this.timerVCanvas = null;
3610			}
3611		},
3612		/*
3613			内部函数
3614			根据当前播放还是暂停确认图标显示
3615		*/
3616		playShow: function(b) {
3617			if(!this.showFace) {
3618				return;
3619			}
3620			if(b) {
3621				this.css(this.CB['play'], 'display', 'none');
3622				this.css(this.CB['pauseCenter'], 'display', 'none');
3623				this.css(this.CB['pause'], 'display', 'block');
3624			} else {
3625				this.css(this.CB['play'], 'display', 'block');
3626				if(this.css(this.CB['errorText'], 'display') == 'none') {
3627					this.css(this.CB['pauseCenter'], 'display', 'block');
3628				} else {
3629					this.css(this.CB['pauseCenter'], 'display', 'none');
3630				}
3631				this.css(this.CB['pause'], 'display', 'none');
3632			}
3633		},
3634		/*
3635			内部函数
3636			监听seek结束
3637		*/
3638		seekedHandler: function() {
3639			this.resetTrack();
3640			this.isTimeButtonMove = true;
3641			if(this.V.paused) {
3642				this.videoPlay();
3643			}
3644		},
3645		/*
3646			内部函数
3647			监听播放结束
3648		*/
3649		endedHandler: function() {
3650			if(!this.vars['loop']) {
3651				this.videoPause();
3652			}
3653		},
3654		/*
3655			内部函数
3656			监听音量改变
3657		*/
3658		volumechangeHandler: function() {
3659			if(!this.showFace) {
3660				return;
3661			}
3662			try {
3663				if(this.V.volume > 0) {
3664					this.css(this.CB['mute'], 'display', 'block');
3665					this.css(this.CB['escMute'], 'display', 'none');
3666				} else {
3667					this.css(this.CB['mute'], 'display', 'none');
3668					this.css(this.CB['escMute'], 'display', 'block');
3669				}
3670			} catch(event) {}
3671		},
3672
3673		/*
3674			内部函数
3675			监听播放时间调节进度条
3676		*/
3677		timeUpdateHandler: function() {
3678			var duration = 0;
3679			if(this.playerType == 'html5video') {
3680				try {
3681					duration = this.V.duration;
3682				} catch(event) {}
3683			}
3684			if(duration > 0) {
3685				this.time = this.V.currentTime;
3686				this.timeTextHandler();
3687				this.trackShowHandler();
3688				if(this.isTimeButtonMove) {
3689					this.timeProgress(this.time, duration);
3690				}
3691			}
3692		},
3693		/*
3694			内部函数
3695			按时间改变进度条
3696		*/
3697		timeProgress: function(time, duration) {
3698			if(!this.showFace) {
3699				return;
3700			}
3701			var timeProgressBgW = this.CB['timeProgressBg'].offsetWidth;
3702			var timeBOW = parseInt((time * timeProgressBgW / duration) - (this.CB['timeButton'].offsetWidth * 0.5));
3703			if(timeBOW > timeProgressBgW - this.CB['timeButton'].offsetWidth) {
3704				timeBOW = timeProgressBgW - this.CB['timeButton'].offsetWidth;
3705			}
3706			if(timeBOW < 0) {
3707				timeBOW = 0;
3708			}
3709			this.css(this.CB['timeProgress'], 'width', timeBOW + 'px');
3710			this.css(this.CB['timeButton'], 'left', parseInt(timeBOW) + 'px');
3711		},
3712		/*
3713			内部函数
3714			监听播放时间改变时间显示文本框
3715		*/
3716		timeTextHandler: function() { //显示时间/总时间
3717			if(!this.showFace) {
3718				return;
3719			}
3720			var duration = this.V.duration;
3721			var time = this.V.currentTime;
3722			if(isNaN(duration) || parseInt(duration) < 0.2) {
3723				duration = this.vars['duration'];
3724			}
3725			this.CB['timeText'].innerHTML = this.formatTime(time) + ' / ' + this.formatTime(duration);
3726			if(this.CB['timeText'].offsetWidth > 0) {
3727				this.buttonWidth['timeText'] = this.CB['timeText'].offsetWidth;
3728			}
3729		},
3730		/*
3731			内部函数
3732			监听是否是缓冲状态
3733		*/
3734		bufferEdHandler: function() {
3735			if(!this.showFace || this.playerType == 'flashplayer') {
3736				return;
3737			}
3738			var thisTemp = this;
3739			var clearTimerBuffer = function() {
3740				if(thisTemp.timerBuffer != null) {
3741					if(thisTemp.timerBuffer.runing) {
3742						thisTemp.sendJS('buffer', 100);
3743						thisTemp.timerBuffer.stop();
3744					}
3745					thisTemp.timerBuffer = null;
3746				}
3747			};
3748			clearTimerBuffer();
3749			var bufferFun = function() {
3750				if(thisTemp.V.buffered.length > 0) {
3751					var duration = thisTemp.V.duration;
3752					var len = thisTemp.V.buffered.length;
3753					var bufferStart = thisTemp.V.buffered.start(len - 1);
3754					var bufferEnd = thisTemp.V.buffered.end(len - 1);
3755					var loadTime = bufferStart + bufferEnd;
3756					var loadProgressBgW = thisTemp.CB['timeProgressBg'].offsetWidth;
3757					var timeButtonW = thisTemp.CB['timeButton'].offsetWidth;
3758					var loadW = parseInt((loadTime * loadProgressBgW / duration) + timeButtonW);
3759					if(loadW >= loadProgressBgW) {
3760						loadW = loadProgressBgW;
3761						clearTimerBuffer();
3762					}
3763					thisTemp.changeLoad(loadTime);
3764				}
3765			};
3766			this.timerBuffer = new this.timer(200, bufferFun);
3767		},
3768		/*
3769			内部函数
3770			单独计算加载进度
3771		*/
3772		changeLoad: function(loadTime) {
3773			if(this.V == null) {
3774				return;
3775			}
3776			if(!this.showFace) {
3777				return;
3778			}
3779			var loadProgressBgW = this.CB['timeProgressBg'].offsetWidth;
3780			var timeButtonW = this.CB['timeButton'].offsetWidth;
3781			var duration = this.V.duration;
3782			if(this.isUndefined(loadTime)) {
3783				loadTime = this.loadTime;
3784			} else {
3785				this.loadTime = loadTime;
3786			}
3787			var loadW = parseInt((loadTime * loadProgressBgW / duration) + timeButtonW);
3788			this.css(this.CB['loadProgress'], 'width', loadW + 'px');
3789		},
3790		/*
3791			内部函数
3792			判断是否是直播
3793		*/
3794		judgeIsLive: function() {
3795			var thisTemp = this;
3796			if(this.timerError != null) {
3797				if(this.timerError.runing) {
3798					this.timerError.stop();
3799				}
3800				this.timerError = null;
3801			}
3802			this.error = false;
3803			if(this.showFace) {
3804				this.css(this.CB['errorText'], 'display', 'none');
3805			}
3806			var timeupdate = function(event) {
3807				thisTemp.timeUpdateHandler();
3808			};
3809			if(!this.vars['live']) {
3810				if(this.V != null && this.playerType == 'html5video') {
3811					this.addListenerInside('timeupdate', timeupdate);
3812					thisTemp.timeTextHandler();
3813					thisTemp.prompt(); //添加提示点
3814					window.setTimeout(function() {
3815						thisTemp.bufferEdHandler();
3816					}, 200);
3817				}
3818			} else {
3819				this.removeListenerInside('timeupdate', timeupdate);
3820				if(this.timerTime != null) {
3821					window.clearInterval(this.timerTime);
3822					timerTime = null;
3823				}
3824				if(this.timerTime != null) {
3825					if(this.timerTime.runing) {
3826						this.timerTime.stop();
3827					}
3828					this.timerTime = null;
3829				}
3830				var timeFun = function() {
3831					if(thisTemp.V != null && !thisTemp.V.paused && thisTemp.show
3831Face) {
3832						thisTemp.CB['timeText'].innerHTML = thisTemp.getNowDate();
3833					}
3834				};
3835				this.timerTime = new this.timer(1000, timeFun);
3836				//timerTime.start();
3837			}
3838			this.definition();
3839		},
3840		/*
3841			内部函数
3842			加载字幕
3843		*/
3844		loadTrack: function() {
3845			if(this.playerType == 'flashplayer' || this.vars['flashplayer'] == true) {
3846				return;
3847			}
3848			var thisTemp = this;
3849			var track = this.vars['cktrack'];
3850			var obj = {
3851				method: 'get',
3852				dataType: 'text',
3853				url: track,
3854				charset: 'utf-8',
3855				success: function(data) {
3856					thisTemp.track = thisTemp.parseSrtSubtitles(data);
3857					thisTemp.trackIndex = 0;
3858					thisTemp.nowTrackShow = {
3859						sn: ''
3860					};
3861				}
3862			};
3863			this.ajax(obj);
3864		},
3865		/*
3866			内部函数
3867			重置字幕
3868		*/
3869		resetTrack: function() {
3870			this.trackIndex = 0;
3871			this.nowTrackShow = {
3872				sn: ''
3873			};
3874		},
3875		/*
3876			内部函数
3877			根据时间改变读取显示字幕
3878		*/
3879		trackShowHandler: function() {
3880			if(!this.showFace) {
3881				return;
3882			}
3883			if(this.track.length < 1) {
3884				return;
3885			}
3886			if(this.trackIndex >= this.track.length) {
3887				this.trackIndex = 0;
3888			}
3889			var nowTrack = this.track[this.trackIndex]; //当前编号对应的字幕内容
3890			/*
3891				this.nowTrackShow=当前显示在界面上的内容
3892				如果当前时间正好在nowTrack时间内,则需要判断
3893			*/
3894			if(this.time >= nowTrack['startTime'] && this.time <= nowTrack['endTime']) {
3895				/*
3896				 	如果当前显示的内容不等于当前需要显示的内容时,则需要显示正确的内容
3897				*/
3898				var nowShow = this.nowTrackShow;
3899				if(nowShow['sn'] != nowTrack['sn']) {
3900					this.trackHide();
3901					this.trackShow(nowTrack);
3902				}
3903			} else {
3904				/*
3905				 * 如果当前播放时间不在当前编号字幕内,则需要先清空当前的字幕内容,再显示新的字幕内容
3906				 */
3907				this.trackHide();
3908				this.checkTrack();
3909			}
3910		},
3911		/*
3912			内部函数
3913			显示字幕内容
3914		*/
3915		trackShow: function(track) {
3916			this.nowTrackShow = track;
3917			var arr = track['content'];
3918			for(var i = 0; i < arr.length; i++) {
3919				var obj = {
3920					list: [{
3921						type: 'text',
3922						text: arr[i],
3923						color: '#FFFFFF',
3924						size: 16,
3925						font: this.fontFamily,
3926						lineHeight: 30
3927					}],
3928					position: [1, 2, null, -(arr.length - i) * 30 - 50]
3929				};
3930				var ele = this.addElement(obj);
3931				this.trackElement.push(ele);
3932			}
3933		},
3934		/*
3935			内部函数
3936			隐藏字字幕内容
3937		*/
3938		trackHide: function() {
3939			for(var i = 0; i < this.trackElement.length; i++) {
3940				this.deleteElement(this.trackElement[i]);
3941			}
3942			this.trackElement = [];
3943		},
3944		/*
3945			内部函数
3946			重新计算字幕的编号
3947		*/
3948		checkTrack: function() {
3949			var num = this.trackIndex;
3950			var arr = this.track;
3951			var i = 0;
3952			for(i = num; i < arr.length; i++) {
3953				if(this.time >= arr[i]['startTime'] && this.time <= arr[i]['endTime']) {
3954					this.trackIndex = i;
3955					break;
3956				}
3957			}
3958		},
3959		/*
3960		-----------------------------------------------------------------------------接口函数开始
3961			接口函数
3962			在播放和暂停之间切换
3963		*/
3964		playOrPause: function() {
3965			if(!this.loaded) {
3966				return;
3967			}
3968			if(this.config['videoClick']) {
3969				if(this.V == null) {
3970					return;
3971				}
3972				if(this.playerType == 'flashplayer') {
3973					this.V.playOrPause();
3974					return;
3975				}
3976				if(this.V.paused) {
3977					this.videoPlay();
3978				} else {
3979					this.videoPause();
3980				}
3981			}
3982		},
3983		/*
3984			接口函数
3985			播放动作
3986		*/
3987		videoPlay: function() {
3988			if(!this.loaded) {
3989				return;
3990			}
3991			if(this.playerType == 'flashplayer') {
3992				this.V.videoPlay();
3993				return;
3994			}
3995			this.V.play();
3996		},
3997		/*
3998			接口函数
3999			暂停动作
4000		*/
4001		videoPause: function() {
4002			if(!this.loaded) {
4003				return;
4004			}
4005			if(this.playerType == 'flashplayer') {
4006				this.V.videoPause();
4007				return;
4008			}
4009			this.V.pause();
4010		},
4011		/*
4012			接口函数
4013			跳转时间动作
4014		*/
4015		videoSeek: function(time) {
4016			if(!this.loaded) {
4017				return;
4018			}
4019			if(this.playerType == 'flashplayer') {
4020				this.V.videoSeek(time);
4021				return;
4022			}
4023			var meta = this.getMetaDate();
4024			var duration = meta['duration'];
4025			if(duration > 0 && time > duration) {
4026				time = duration;
4027			}
4028			if(time >= 0) {
4029				this.V.currentTime = time;
4030				this.sendJS('seekTime', time);
4031			}
4032		},
4033		/*
4034			接口函数
4035			调节音量/获取音量
4036		*/
4037		changeVolume: function(vol, bg, button) {
4038			if(this.loaded) {
4039				if(this.playerType == 'flashplayer') {
4040					this.V.changeVolume(time);
4041					return;
4042				}
4043			}
4044			if(isNaN(vol) || this.isUndefined(vol)) {
4045				vol = 0;
4046			}
4047			if(!this.loaded) {
4048				this.vars['volume'] = vol;
4049			}
4050			if(!this.html5Video) {
4051				this.V.changeVolume(vol);
4052				return;
4053			}
4054			try {
4055				if(this.isUndefined(bg)) {
4056					bg = true;
4057				}
4058			} catch(e) {}
4059			try {
4060				if(this.isUndefined(button)) {
4061					button = true;
4062				}
4063			} catch(e) {}
4064			if(!vol) {
4065				vol = 0;
4066			}
4067			if(vol < 0) {
4068				vol = 0;
4069			}
4070			if(vol > 1) {
4071				vol = 1;
4072			}
4073			try {
4074				this.V.volume = vol;
4075			} catch(error) {}
4076			this.volume = vol;
4077			if(bg && this.showFace) {
4078				var bgW = vol * this.CB['volumeBg'].offsetWidth;
4079				if(bgW < 0) {
4080					bgW = 0;
4081				}
4082				if(bgW > this.CB['volumeBg'].offsetWidth) {
4083					bgW = this.CB['volumeBg'].offsetWidth;
4084				}
4085				this.css(this.CB['volumeUp'], 'width', bgW + 'px');
4086			}
4087
4088			if(button && this.showFace) {
4089				var buLeft = parseInt(this.CB['volumeUp'].offsetWidth - (this.CB['volumeBO'].offsetWidth * 0.5));
4090				if(buLeft > this.CB['volumeBg'].offsetWidth - this.CB['volumeBO'].offsetWidth) {
4091					buLeft = this.CB['volumeBg'].offsetWidth - this.CB['volumeBO'].offsetWidth
4092				}
4093				if(buLeft < 0) {
4094					buLeft = 0;
4095				}
4096				this.css(this.CB['volumeBO'], 'left', buLeft + 'px');
4097			}
4098		},
4099		/*
4100			接口函数
4101			静音
4102		*/
4103		videoMute: function() {
4104			if(!this.loaded) {
4105				return;
4106			}
4107			if(this.playerType == 'flashplayer') {
4108				this.V.videoMute();
4109				return;
4110			}
4111			this.volumeTemp = this.V ? (this.V.volume > 0 ? this.V.volume : this.vars['volume']) : this.vars['volume'];
4112			this.changeVolume(0);
4113		},
4114		/*
4115			接口函数
4116			取消静音
4117		*/
4118		videoEscMute: function() {
4119			if(!this.loaded) {
4120				return;
4121			}
4122			if(this.playerType == 'flashplayer') {
4123				this.V.videoEscMute();
4124				return;
4125			}
4126			this.changeVolume(this.volumeTemp > 0 ? this.volumeTemp : this.vars['volume']);
4127		},
4128		/*
4129			接口函数
4130			快退
4131		*/
4132		fastBack: function() {
4133			if(!this.loaded) {
4134				return;
4135			}
4136			if(this.playerType == 'flashplayer') {
4137				this.V.fastBack();
4138				return;
4139			}
4140			var time = this.time - this.ckplayerConfig['config']['timeJump'];
4141			if(time < 0) {
4142				time = 0;
4143			}
4144			this.videoSeek(time);
4145		},
4146		/*
4147			接口函数
4148			快进
4149		*/
4150		fastNext: function() {
4151			if(!this.loaded) {
4152				return;
4153			}
4154			if(this.playerType == 'flashplayer') {
4155				this.V.fastNext();
4156				return;
4157			}
4158			var time = this.time + this.ckplayerConfig['config']['timeJump'];
4159			if(time > this.V.duration) {
4160				time = this.V.duration;
4161			}
4162			this.videoSeek(time);
4163		},
4164		/*
4165			接口函数
4166			获取当前播放的地址
4167		*/
4168		getCurrentSrc:function(){
4169			if(!this.loaded) {
4170				return;
4171			}
4172			if(this.playerType == 'flashplayer') {
4173				return this.V.getCurrentSrc();
4174			}
4175			return this.V.currentSrc;
4176		},
4177		/*
4178			内置函数
4179			全屏/退出全屏动作,该动作只能是用户操作才可以触发ï¼
4179Œæ¯”如用户点击按钮触发该事件
4180		*/
4181		switchFull: function() {
4182			if(this.full) {
4183				this.quitFullScreen();
4184			} else {
4185				this.fullScreen();
4186			}
4187		},
4188		/*
4189			内置函数
4190			全屏动作,该动作只能是用户操作才可以触发,比如用户点击按钮触发该事件
4191		*/
4192		fullScreen: function() {
4193			if(this.html5Video && this.playerType == 'html5video') {
4194				var element = this.PD;
4195				if(element.requestFullscreen) {
4196					element.requestFullscreen();
4197				} else if(element.mozRequestFullScreen) {
4198					element.mozRequestFullScreen();
4199				} else if(element.webkitRequestFullscreen) {
4200					element.webkitRequestFullscreen();
4201				} else if(element.msRequestFullscreen) {
4202					element.msRequestFullscreen();
4203				} else if(element.oRequestFullscreen) {
4204					element.oRequestFullscreen();
4205				}
4206				this.judgeFullScreen();
4207			} else {
4208				//this.V.fullScreen();
4209			}
4210		},
4211		/*
4212			接口函数
4213			退出全屏动作
4214		*/
4215		quitFullScreen: function() {
4216			if(this.html5Video && this.playerType == 'html5video') {
4217				if(document.exitFullscreen) {
4218					document.exitFullscreen();
4219				} else if(document.msExitFullscreen) {
4220					document.msExitFullscreen();
4221				} else if(document.mozCancelFullScreen) {
4222					document.mozCancelFullScreen();
4223				} else if(document.oRequestFullscreen) {
4224					document.oCancelFullScreen();
4225				} else if(document.requestFullscreen) {
4226					document.requestFullscreen();
4227				} else if(document.webkitExitFullscreen) {
4228					document.webkitExitFullscreen();
4229				} else {
4230					this.css(document.documentElement, 'cssText', '');
4231					this.css(document.document.body, 'cssText', '');
4232					this.css(this.PD, 'cssText', '');
4233				}
4234				this.judgeFullScreen();
4235			}
4236		},
4237		/*
4238		 下面列出只有flashplayer里支持的 
4239		 */
4240		videoRotation: function(n) {
4241			if(!this.loaded) {
4242				return;
4243			}
4244			if(this.playerType == 'flashplayer') {
4245				this.V.videoRotation(n);
4246				return;
4247			}
4248			if(this.isUndefined(n)) {
4249				n = 0;
4250			}
4251			var tf = this.css(this.V, 'transform');
4252			if(this.isUndefined(tf) && !tf) {
4253				tf = 'rotate(0deg)';
4254			}
4255			var reg = tf.match(/rotate\([^)]+\)/);
4256			reg = reg ? reg[0].replace('rotate(', '').replace('deg)', '') : '';
4257			if(reg == '') {
4258				reg = 0;
4259			} else {
4260				reg = parseInt(reg);
4261			}
4262			if(n == -1) {
4263				reg -= 90;
4264			} else if(n == 1) {
4265				reg += 90;
4266			} else {
4267				if(n != 90 && n != 180 && n != 270 && n != -90 && n != -180 && n != -270) {
4268					reg = 0;
4269				} else {
4270					reg = n;
4271				}
4272			}
4273			n = reg;
4274			tf = tf.replace(/rotate\([^)]+\)/, '') + ' rotate(' + n + 'deg)';
4275			this.css(this.V, 'transform', tf);
4276			return;
4277		},
4278		videoBrightness: function(n) {
4279			if(!this.loaded) {
4280				return;
4281			}
4282			if(this.playerType == 'flashplayer') {
4283				this.V.videoBrightness(n);
4284				return;
4285			}
4286		},
4287		videoContrast: function(n) {
4288			if(!this.loaded) {
4289				return;
4290			}
4291			if(this.playerType == 'flashplayer') {
4292				this.V.videoContrast(n);
4293				return;
4294			}
4295		},
4296		videoSaturation: function(n) {
4297			if(!this.loaded) {
4298				return;
4299			}
4300			if(this.playerType == 'flashplayer') {
4301				this.V.videoSaturation(n);
4302				return;
4303			}
4304		},
4305		videoHue: function(n) {
4306			if(!this.loaded) {
4307				return;
4308			}
4309			if(this.playerType == 'flashplayer') {
4310				this.V.videoHue(n);
4311				return;
4312			}
4313		},
4314		videoZoom: function(n) {
4315			if(!this.loaded) {
4316				return;
4317			}
4318			if(this.playerType == 'flashplayer') {
4319				this.V.videoZoom(n);
4320				return;
4321			}
4322			if(this.isUndefined(n)) {
4323				n = 1;
4324			}
4325			if(n < 0) {
4326				n = 0;
4327			}
4328			if(n > 2) {
4329				n = 2;
4330			}
4331			var tf = this.css(this.V, 'transform');
4332			tf = tf.replace(/scale\([^)]+\)/, '') + ' scale(' + n + ')';
4333			this.css(this.V, 'transform', tf);
4334			return;
4335		},
4336		videoProportion: function(w, h) {
4337			if(!this.loaded) {
4338				return;
4339			}
4340			if(this.playerType == 'flashplayer') {
4341				this.V.videoProportion(w, h);
4342				return;
4343			}
4344		},
4345		adPlay: function() {
4346			if(!this.loaded) {
4347				return;
4348			}
4349			if(this.playerType == 'flashplayer') {
4350				this.V.adPlay();
4351				return;
4352			}
4353		},
4354		adPause: function() {
4355			if(!this.loaded) {
4356				return;
4357			}
4358			if(this.playerType == 'flashplayer') {
4359				this.V.adPause();
4360				return;
4361			}
4362		},
4363		videoError: function(n) {
4364			if(!this.loaded) {
4365				return;
4366			}
4367			if(this.playerType == 'flashplayer') {
4368				this.V.videoError(n);
4369				return;
4370			}
4371		},
4372		changeConfig: function() {
4373			if(!this.loaded) {
4374				return;
4375			}
4376			if(this.playerType == 'flashplayer') {
4377				this.V.changeConfig(arguments);
4378				return;
4379			}
4380			var obj = this.ckplayerConfig;
4381			var arg = arguments;
4382			for(var i = 0; i < arg.length - 1; i++) {
4383				if(obj.hasOwnProperty(arg[i])) {
4384					obj = obj[arg[i]];
4385				} else {
4386					return;
4387				}
4388			}
4389			var val = arg[arg.length - 1];
4390			switch(arg.length) {
4391				case 2:
4392					this.ckplayerConfig[arg[0]] = val;
4393					break;
4394				case 3:
4395					this.ckplayerConfig[arg[0]][arg[1]] = val;
4396					break;
4397				case 4:
4398					this.ckplayerConfig[arg[0]][arg[1]][arg[2]] = val;
4399					break;
4400				case 5:
4401					this.ckplayerConfig[arg[0]][arg[1]][arg[2]][arg[3]] = val;
4402					break;
4403				case 6:
4404					this.ckplayerConfig[arg[0]][arg[1]][arg[2]][arg[3]][arg[4]] = val;
4405					break;
4406				case 7:
4407					this.ckplayerConfig[arg[0]][arg[1]][arg[2]][arg[3]][arg[4]][arg[5]] = val;
4408					break;
4409				case 8:
4410					this.ckplayerConfig[arg[0]][arg[1]][arg[2]][arg[3]][arg[4]][arg[5]][arg[6]] = val;
4411					break;
4412				case 9:
4413					this.ckplayerConfig[arg[0]][arg[1]][arg[2]][arg[3]][arg[4]][arg[5]][arg[6]][arg[7]] = val;
4414					break;
4415				case 10:
4416					this.ckplayerConfig[arg[0]][arg[1]][arg[2]][arg[3]][arg[4]][arg[5]][arg[6]][arg[7]][arg[8]] = val;
4417					break;
4418				default:
4419					return;
4420					break;
4421			}
4422			this.sendJS('configChange', this.ckplayerConfig);
4423		},
4424		custom: function() {
4425			if(!this.loaded) {
4426				return;
4427			}
4428			if(this.playerType == 'flashplayer') {
4429				this.V.custom(arguments);
4430				return;
4431			}
4432		},
4433		getConfig: function() {
4434			if(!this.loaded) {
4435				return null;
4436			}
4437			if(this.playerType == 'flashplayer') {
4438				return this.V.getConfig(arguments);
4439			}
4440		},
4441		openUrl: function(n) {
4442			if(!this.loaded) {
4443				return;
4444			}
4445			if(this.playerType == 'flashplayer') {
4446				this.V.openUrl(n);
4447				return;
4448			}
4449		},
4450		/*
4451			接口函数
4452			清除视频
4453		*/
4454		videoClear: function() {
4455			if(!this.loaded) {
4456				return;
4457			}
4458			if(this.playerType == 'flashplayer') {
4459				this.V.videoClear();
4460				return;
4461			}
4462		},
4463		/*
4464			接口函数
4465			向播放器传递新的视频地址
4466		*/
4467		newVideo: function(c) {
4468			if(this.playerType == 'flashplayer') {
4469				this.V.newVideo(c);
4470				return;
4471			} else {
4472				this.embed(c);
4473			}
4474		},
4475		/*
4476			接口函数
4477			截图
4478		*/
4479		screenshot: function(obj, save, name) {
4480			if(!this.loaded) {
4481				return;
4482			}
4483			if(this.playerType == 'flashplayer') {
4484				try {
4485					this.V.screenshot(obj, save, name);
4486				} catch(error) {
4487					this.log(error);
4488				}
4489				return;
4490			}
4491			if(obj == 'video') {
4492				var newCanvas = document.createElement('canvas');
4493				newCanvas.width = this.V.videoWidth;
4494				newCanvas.height = this.V.videoHeight;
4495				newCanvas.getContext('2d').drawImage(this.V, 0, 0, this.V.videoWidth, this.V.videoHeight);
4496				try {
4497					var base64 = newCanvas.toDataURL('image/jpeg');
4498					this.sendJS('screenshot', {
4499						object: obj,
4500						save: save,
4501						name: name,
4502						base64: base64
4503					});
4504				} catch(error) {
4505					this.log(error);
4506				}
4507			}
4508		},
4509		/*
4510			接口函数
4511			改变播放器尺寸
4512		*/
4513		changeSize: function(w, h) {
4514			if(this.isUndefined(w)) {
4515				w = 0;
4516			}
4517			if(this.isUndefined(h)) {
4518				h = 0;
4519			}
4520			if(w > 0) {
4521				this.css(this.CD, 'width', w + 'px');
4522			}
4523			if(h > 0) {
4524				this.css(this.CD, 'height', h + 'px');
4525			}
4526			if(this.html5Video) {
4527				this.elementCoordinate();
4528			}
4529		},
4530		/*
4531			接口函数
4532			改变视频播放速度
4533		*/
4534		changePlaybackRate: function(n) {
4535			if(this.html5Video) {
4536				var arr = this.playbackRateArr;
4537				n = parseInt(n);
4538				if(n < arr.length) {
4539					this.newPlaybackrate(arr[n][1]);
4540				}
4541			}
4542		},
4543		/*
4544			内部函数
4545			注册控制控制栏显示与隐藏函数
4546		*/
4547		changeControlBarShow: function(show) {
4548			if(!this.loaded) {
4549				return;
4550			}
4551			if(this.playerType == 'flashplayer') {
4552				this.V.changeControlBarShow(show);
4553				return;
4554			}
4555			if(show) {
4556				this.controlBarIsShow = true;
4557				this.controlBarHide(false);
4558			} else {
4559				this.controlBarIsShow = false;
4560				this.controlBarHide(true);
4561			}
4562		},
4563		/*
4564			-----------------------------------------------------------------------
4565			调用flashplayer
4566		*/
4567		embedSWF: function() {
4568			var vid = this.randomString();
4569			var flashvars = this.getFlashVars();
4570			var param = this.getFlashplayerParam();
4571			var flashplayerUrl = 'http://www.macromedia.com/go/getflashplayer';
4572			var html = '',
4573				src = javascriptPath + 'ckplayer.swf';
4574			id = 'id="' + vid + '" name="' + vid + '" ';
4575			html += '<object pluginspage="' + flashplayerUrl + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=11,3,0,0" width="100%" height="100%" ' + id + ' align="middle">';
4576			html += param['v'];
4577			html += '<param name="movie" value="' + src + '">';
4578			html += '<param name="flashvars" value="' + flashvars + '">';
4579			html += '<embed ' + param['w'] + ' src="' + src + '" flashvars="' + flashvars + '" width="100%" height="100%" ' + id + ' align="middle" type="application/x-shockwave-flash" pluginspage="' + flashplayerUrl + '" />';
4580			html += '</object>';
4581			this.PD.innerHTML = html;
4582			this.V = this.getObjectById(vid); //V:定义播放器对象全局变量
4583			this.playerType = 'flashplayer';
4584			//this.loaded=true;
4585		},
4586		/*
4587			内置函数
4588			将vars对象转换成字符
4589		*/
4590		getFlashVars: function() {
4591			this.getVarsObject();
4592			var v = this.vars;
4593			var z = '';
4594			for(k in v) {
4595				if(k != 'flashplayer' && k != 'container' && v[k] != '') {
4596					if(z != '') {
4597						z += '&';
4598					}
4599					var vk = v[k];
4600					if(vk == true) {
4601						vk = 1;
4602					}
4603					if(vk == false) {
4604						vk = 0;
4605					}
4606					z += k + '=' + vk;
4607				}
4608
4609			}
4610			if(!v.hasOwnProperty('volume') || !v['volume']) {
4611				if(z != '') {
4612					z += '&';
4613				}
4614				z += 'volume=0';
4615			}
4616			return z;
4617		},
4618		/*
4619			内置函数
4620			将vars格式化成flash能接受的对象。再由getFlashVars函数转化成字符串或由newVideo直接使用
4621		*/
4622		getVarsObject: function() {
4623			var v = this.vars;
4624			var f = '',
4625				d = '',
4626				w = ''; //f=视频地址,d=清晰度地址,w=权重,z=最终地址
4627			var arr = this.VA;
4628			var prompt = v['promptSpot'];
4629			var i = 0;
4630			var video = this.vars['video'];
4631			if(typeof(video) == 'object') { //对象或数组
4632				if(!this.isUndefined(typeof(video.length))) { //说明是数组
4633					var arr = video;
4634					for(i = 0; i < arr.length; i++) {
4635						var arr2 = arr[i];
4636						if(arr2) {
4637							if(f != '') {
4638								f += this.ckplayerConfig['config']['split'];
4639								d += ',';
4640								w += ',';
4641								v['type']+=this.ckplayerConfig['config']['split'];
4642							}
4643							f += encodeURIComponent(decodeURIComponent(arr2[0]));
4644							d += arr2[2];
4645							w += arr2[3];
4646							v['type']+=arr2[1].replace('video/','');
4647						}
4648					}
4649				} else {
4650					f = encodeURIComponent(decodeURIComponent(video['file']));
4651					if(!this.isUndefined(video['type'])) {
4652						v['type'] = video['type'];
4653					}
4654					d = '';
4655					w = '';
4656				}
4657			} else {
4658				f = encodeURIComponent(decodeURIComponent(video));
4659			}
4660			if(v['preview'] != null) {
4661				v['previewscale'] = v['preview']['scale'];
4662				v['preview'] = v['preview']['file'].join(',');
4663
4664			}
4665			if(prompt != null) {
4666				v['promptspot'] = '';
4667				v['promptspottime'] = '';
4668				for(i = 0; i < prompt.length; i++) {
4669					if(v['promptspot'] != '') {
4670						v['promptspot'] += ',';
4671						v['promptspottime'] += ',';
4672					}
4673					v['promptspot'] += prompt[i]['words'];
4674					v['promptspottime'] += prompt[i]['time'];
4675				}
4676
4677			}
4678			if(f != '') {
4679				v['video'] = f;
4680				v['definition'] = d;
4681				v['weight'] = w;
4682			}
4683			if(!v['volume']) {
4684				v['volume'] = 0;
4685			}
4686			var newV = {};
4687			
4688			for(var k in v) {
4689				if(v[k] != null) {
4690					newV[k] = v[k];
4691				}
4692				if(k == 'type') {
4693					newV[k] = v[k].replace('video/m3u8', 'm3u8');
4694				}
4695			}
4696
4697			this.vars = newV;
4698		},
4699		/*
4700			内置函数
4701			将embedSWF里的param的对象进行转换
4702		*/
4703		getFlashplayerParam: function() {
4704			var w = '',
4705				v = '',
4706				o = {
4707					allowScriptAccess: 'always',
4708					allowFullScreen: true,
4709					quality: 'high',
4710					bgcolor: '#000'
4711				};
4712			for(var e in o) {
4713				w += e + '="' + o[e] + '" ';
4714				v += '<param name="' + e + '" value="' + o[e] + '" />';
4715			}
4716			w = w.replace('movie=', 'src=');
4717			return {
4718				w: w,
4719				v: v
4720			};
4721		},
4722
4723		/*
4724			操作动作结束
4725			-----------------------------------------------------------------------
4726			
4727			接口函数
4728			获取元数据部分
4729		*/
4730		getMetaDate: function() {
4731			if(!this.loaded || this.V == null) {
4732				return false;
4733			}
4734			if(this.playerType == 'html5video') {
4735				var duration = 0;
4736				try {
4737					duration = !isNaN(this.V.duration) ? this.V.duration : 0;
4738				} catch(event) {this.log(event);}
4739				var data = {
4740					duration: duration,
4741					volume: this.V.volume,
4742					playbackRate: this.V.playbackRate,
4743					width: this.PD.offsetWidth || this.V.offsetWidth || this.V.width,
4744					height: this.PD.offsetHeight || this.V.offsetHeight || this.V.height,
4745					streamWidth: this.V.videoWidth,
4746					streamHeight: this.V.videoHeight,
4747					videoWidth: this.V.offsetWidth,
4748					videoHeight: this.V.offsetHeight,
4749					paused: this.V.paused
4750				};
4751				return data;
4752			} else {
4753				try{
4754					return this.V.getMetaDate();
4755				}
4756				catch(event){
4757					this.log(event);
4758				}
4759			}
4760			return false;
4761		},
4762		/*
4763			接口函数
4764			取当前提供给播放器播放的视频列表
4765		*/
4766		getVideoUrl: function() {
4767			if(this.playerType == 'flashplayer') {
4768				return this.V.getVideoUrl();
4769			}
4770			var arr = [];
4771			if(this.V.src) {
4772				arr.push(this.V.src);
4773			} else {
4774				var uArr = this.V.childNodes;
4775				for(var i = 0; i < uArr.length; i++) {
4776					arr.push(uArr[i].src);
4777				}
4778			}
4779			return arr;
4780		},
4781		/*
4782			内置函数
4783			格式化函数
4784		*/
4785		clickEvent: function(call) {
4786			if(call == 'none' || call == '' || call == null) {
4787				return {
4788					type: 'none'
4789				};
4790			}
4791			var callArr = call.split('->');
4792			var type = '',
4793				fun = '',
4794				link = '',
4795				target = '';
4796			if(callArr.length == 2) {
4797				var callM = callArr[0];
4798				var callE = callArr[1];
4799				if(!callE) {
4800					return {
4801						type: 'none'
4802					};
4803				}
4804				var val = '';
4805				var eArr = [];
4806				type = callM;
4807				switch(callM) {
4808					case 'actionScript':
4809						//trace(THIS.hasOwnProperty(callE));
4810
4811						if(callE.indexOf('(') > -1) {
4812							eArr = callE.split('(');
4813							callE = eArr[0];
4814							val = eArr[1].replace(')', '');
4815						}
4816						if(val == '') {
4817							fun = 'thisTemp.' + callE + '()';
4818						} else {
4819							fun = 'thisTemp.' + callE + '(' + val + ')';
4820						}
4821						break;
4822					case 'javaScript':
4823						if(callE.substr(0, 11) == '[flashvars]') {
4824							callE = callE.substr(11);
4825							if(this.vars.hasOwnProperty(callE)) {
4826								callE = this.vars[callE];
4827							} else {
4828								break;
4829							}
4830
4831						}
4832						if(callE.indexOf('(') > -1) {
4833							eArr = callE.split('(');
4834							callE = eArr[0];
4835							val = eArr[1].replace(')', '');
4836						}
4837						if(val == '') {
4838							fun = callE + '()';
4839						} else {
4840							fun = callE + '(' + val + ')';
4841						}
4842						break;
4843					case "link":
4844						var callLink = (callE + ',').split(',');
4845						if(callLink[0].substr(0, 11) == '[flashvars]') {
4846							var fl = callLink[0].replace('[flashvars]', '');
4847							if(this.vars.hasOwnProperty(fl)) {
4848								callLink[0] = this.vars[fl];
4849							} else {
4850								break;
4851							}
4852						}
4853						if(!callLink[1]) {
4854							callLink[1] = '_blank';
4855						}
4856						link = callLink[0];
4857						target = callLink[1];
4858						break;
4859				}
4860			}
4861			return {
4862				type: type,
4863				fun: fun,
4864				link: link,
4865				target: target
4866			}
4867		},
4868		/*
4869			内置函数
4870			向播放器界面添加一个文本
4871		*/
4872		addElement: function(attribute) {
4873			var thisTemp = this;
4874			if(this.playerType == 'flashplayer') {
4875				return this.V.addElement(attribute);
4876			}
4877			var i = 0;
4878			var obj = {
4879				list: null,
4880				x: '100%',
4881				y: "50%",
4882				position: null,
4883				alpha: 1,
4884				backgroundColor: '',
4885				backAlpha: 1,
4886				backRadius: 0,
4887				clickEvent: ''
4888			};
4889			obj = this.standardization(obj, attribute);
4890			var list = obj['list'];
4891			if(list == null) {
4892				return '';
4893			}
4894			var id = 'element' + this.randomString(10);
4895			var ele = document.createElement('div');
4896			ele.className = id;
4897			if(obj['x']) {
4898				ele.setAttribute('data-x', obj['x']);
4899			}
4900			if(obj['y']) {
4901				ele.setAttribute('data-y', obj['y']);
4902			}
4903			if(obj['position'] != null) {
4904				ele.setAttribute('data-position', obj['position'].join(','));
4905			}
4906
4907			this.PD.appendChild(ele);
4908			var eid = this.getByElement(id);
4909			this.css(eid, {
4910				position: 'absolute',
4911				filter: 'alpha(opacity:' + obj['alpha'] + ')',
4912				opacity: obj['alpha'].toString(),
4913				width: '800px',
4914				zIndex: '20'
4915			});
4916			var bgid = 'elementbg' + this.randomString(10);
4917			var bgAlpha = obj['alpha'].toString();
4918			var bgColor = obj['backgroundColor'].replace('0x', '#');
4919			var html = '';
4920			var idArr = [];
4921			var clickArr = [];
4922			if(!this.isUndefined(list) && list.length > 0) {
4923				var textObj, returnObj, clickEvent;
4924				for(i = 0; i < list.length; i++) {
4925					var newEleid = 'elementnew' + this.randomString(10);
4926					switch(list[i]['type']) {
4927						case 'image':
4928						case 'png':
4929						case 'jpg':
4930						case 'jpeg':
4931						case 'gif':
4932							textObj = {
4933								type: 'image',
4934								file: '',
4935								radius: 0, //圆角弧度
4936								width: 30, //定义宽,必需要定义
4937								height: 30, //定义高,必需要定义
4938								alpha: 1, //透明度
4939								paddingLeft: 0, //左边距离
4940								paddingRight: 0, //右边距离
4941								paddingTop: 0,
4942								paddingBottom: 0,
4943								marginLeft: 0,
4944								marginRight: 0,
4945								marginTop: 0,
4946								marginBottom: 0,
4947								backgroundColor: '',
4948								clickEvent: ''
4949							};
4950
4951							list[i] = this.standardization(textObj, list[i]);
4952							clickEvent = this.clickEvent(list[i]['clickEvent']);
4953							clickArr.push(clickEvent);
4954							if(clickEvent['type'] == 'link') {
4955								html += '<div class="' + newEleid + '" data-i="' + i + '"><a href="' + clickEvent['link'] + '" target="' + clickEvent['target'] + '"><img class="' + newEleid + '_image" src="' + list[i]['file'] + '" style="border:0;"></a></div>';
4956							} else {
4957								html += '<div class="' + newEleid + '" data-i="' + i + '"><img class="' + newEleid + '_image" src="' + list[i]['file'] + '" style="border:0;"></div>';
4958							}
4959							break;
4960						case 'text':
4961							textObj = {
4962								type: 'text', //说明是文本
4963								text: '', //文本内容
4964								color: '0xFFFFFF',
4965								size: 14,
4966								font: this.fontFamily,
4967								leading: 0,
4968								alpha: 1, //透明度
4969								paddingLeft: 0, //左边距离
4970								paddingRight: 0, //右边距离
4971								paddingTop: 0,
4972								paddingBottom: 0,
4973								marginLeft: 0,
4974								marginRight: 0,
4975								marginTop: 0,
4976								marginBottom: 0,
4977								backgroundColor: '',
4978								backAlpha: 1,
4979								backRadius: 0, //背景圆角弧度,支持数字统一设置,也支持分开设置[30,20,20,50],对应上左,上右,下右,下左
4980								clickEvent: ''
4981							};
4982							list[i] = this.standardization(textObj, list[i]);
4983							clickEvent = this.clickEvent(list[i]['clickEvent']);
4984							clickArr.push(clickEvent);
4985							if(clickEvent['type'] == 'link') {
4986								html += '<div class="' + newEleid + '" data-i="' + i + '"><div class="' + newEleid + '_bg"></div><div class="' + newEleid + '_text"><a href="' + clickEvent['link'] + '" target="' + clickEvent['target'] + '">' + list[i]['text'] + '</a></div></div>';
4987							} else {
4988								html += '<div  class="' + newEleid + '" data-i="' + i + '"><div class="' + newEleid + '_bg"></div><div class="' + newEleid + '_text">' + list[i]['text'] + '</div></div>';
4989							}
4990							break;
4991						default:
4992							break;
4993					}
4994					idArr.push(newEleid);
4995				}
4996			}
4997			var objClickEvent = this.clickEvent(obj['clickEvent']);
4998			/*if(objClickEvent['type']=='link'){
4999				html = '<a href="'+objClickEvent['link']+'" target="'+objClickEvent['target']+'">' + html + '</a>';
5000			}*/
5001			eid.innerHTML = '<div class="' + bgid + '"></div><div class="' + bgid + '_c">' + html + '</div>';
5002			if(objClickEvent['type'] == 'javaScript' || objClickEvent['type'] == 'actionScript') {
5003				var objClickHandler = function() {
5004					eval(objClickEvent['fun']);
5005					thisTemp.sendJS('clickEvent', clk['type'] + '->' + clk['fun'].replace('thisTemp.', '').replace('()', ''));
5006				};
5007				this.addListenerInside('click', objClickHandler, this.getByElement(bgid + '_c'))
5008			}
5009			this.css(bgid + '_c', {
5010				position: 'absolute',
5011				zIndex: '2'
5012			});
5013			for(i = 0; i < idArr.length; i++) {
5014				var clk = clickArr[i];
5015
5016				if(clk['type'] == 'javaScript' || clk['type'] == 'actionScript') {
5017					var clickHandler = function() {
5018						clk = clickArr[this.getAttribute('data-i')];
5019						eval(clk['fun']);
5020						thisTemp.sendJS('clickEvent', clk['type'] + '->' + clk['fun'].replace('thisTemp.', '').replace('()', ''));
5021					};
5022					this.addListenerInside('click', clickHandler, this.getByElement(idArr[i]))
5023				}
5024				switch(list[i]['type']) {
5025					case 'image':
5026					case 'png':
5027					case 'jpg':
5028					case 'jpeg':
5029					case 'gif':
5030						this.css(idArr[i], {
5031							float: 'left',
5032							width: list[i]['width'] + 'px',
5033							height: list[i]['height'] + 'px',
5034							filter: 'alpha(opacity:' + list[i]['alpha'] + ')',
5035							opacity: list[i]['alpha'].toString(),
5036							marginLeft: list[i]['marginLeft'] + 'px',
5037							marginRight: list[i]['marginRight'] + 'px',
5038							marginTop: list[i]['marginTop'] + 'px',
5039							marginBottom: list[i]['marginBottom'] + 'px',
5040							borderRadius: list[i]['radius'] + 'px',
5041							cursor: 'pointer'
5042						});
5043						this.css(idArr[i] + '_image', {
5044							width: list[i]['width'] + 'px',
5045							height: list[i]['height'] + 'px',
5046							borderRadius: list[i]['radius'] + 'px'
5047						});
5048						break;
5049					case 'text':
5050						this.css(idArr[i] + '_text', {
5051							filter: 'alpha(opacity:' + list[i]['alpha'] + ')',
5052							opacity: list[i]['alpha'].toString(),
5053							borderRadius: list[i]['radius'] + 'px',
5054							fontFamily: list[i]['font'],
5055							fontSize: list[i]['size'] + 'px',
5056							color: list[i]['color'].replace('0x', '#'),
5057							lineHeight: list[i]['leading'] > 0 ? list[i]['leading'] + 'px' : '',
5058							paddingLeft: list[i]['paddingLeft'] + 'px',
5059							paddingRight: list[i]['paddingRight'] + 'px',
5060							paddingTop: list[i]['paddingTop'] + 'px',
5061							paddingBottom: list[i]['paddingBottom'] + 'px',
5062							whiteSpace: 'nowrap',
5063							position: 'absolute',
5064							zIndex: '3',
5065							cursor: 'pointer'
5066						});
5067						this.css(idArr[i], {
5068							float: 'left',
5069							width: this.getByElement(idArr[i] + '_text').offsetWidth + 'px',
5070							height: this.getByElement(idArr[i] + '_text').offsetHeight + 'px',
5071							marginLeft: list[i]['marginLeft'] + 'px',
5072							marginRight: list[i]['marginRight'] + 'px',
5073							marginTop: list[i]['marginTop'] + 'px',
5074							marginBottom: list[i]['marginBottom'] + 'px'
5075						});
5076						this.css(idArr[i] + '_bg', {
5077							width: this.getByElement(idArr[i] + '_text').offsetWidth + 'px',
5078							height: this.getByElement(idArr[i] + '_text').offsetHeight + 'px',
5079							filter: 'alpha(opacity:' + list[i]['backAlpha'] + ')',
5080							opacity: list[i]['backAlpha'].toString(),
5081							borderRadius: list[i]['backRadius'] + 'px',
5082							backgroundColor: list[i]['backgroundColor'].replace('0x', '#'),
5083							position: 'absolute',
5084							zIndex: '2'
5085						});
5086						break;
5087					default:
5088						break;
5089				}
5090			}
5091			this.css(bgid, {
5092				width: this.getByElement(bgid + '_c').offsetWidth + 'px',
5093				height: this.getByElement(bgid + '_c').offsetHeight + 'px',
5094				position: 'absolute',
5095				filter: 'alpha(opacity:' + bgAlpha + ')',
5096				opacity: bgAlpha,
5097				backgroundColor: bgColor.replace('0x', '#'),
5098				borderRadius: obj['backRadius'] + 'px',
5099				zIndex: '1'
5100			});
5101			this.css(eid, {
5102				width: this.getByElement(bgid).offsetWidth + 'px',
5103				height: this.getByElement(bgid).offsetHeight + 'px'
5104			});
5105			var eidCoor = this.calculationCoor(eid);
5106			this.css(eid, {
5107				left: eidCoor['x'] + 'px',
5108				top: eidCoor['y'] + 'px'
5109			});
5110
5111			this.elementArr.push(eid.className);
5112			return eid;
5113		},
5114		/*
5115			内置函数
5116			获取元件的属性,包括x,y,width,height,alpha
5117		*/
5118		getElement: function(element) {
5119			if(this.playerType == 'flashplayer') {
5120				return this.V.getElement(element);
5121			}
5122			var ele = element;
5123			if(typeof(element) == 'string') {
5124				ele = this.getByElement(element);
5125			}
5126			var coor = this.getCoor(ele);
5127			return {
5128				x: coor['x'],
5129				y: coor['y'],
5130				width: ele.offsetWidth,
5131				height: ele.offsetHeight,
5132				alpha: !this.isUndefined(this.css(ele, 'opacity')) ? parseFloat(this.css(ele, 'opacity')) : 1
5133			};
5134		},
5135		/*
5136			内置函数
5137			根据节点的x,y计算在播放器里的坐标
5138		*/
5139		calculationCoor: function(ele) {
5140			if(this.playerType == 'flashplayer') {
5141				return this.V.calculationCoor(ele);
5142			}
5143			if(ele == []) {
5144				return;
5145			}
5146			var x, y, position = [];
5147			var w = this.PD.offsetWidth,
5148				h = this.PD.offsetHeight;
5149			var ew = ele.offsetWidth,
5150				eh = ele.offsetHeight;
5151			if(!this.isUndefined(this.getDataset(ele, 'x'))) {
5152				x = this.getDataset(ele, 'x');
5153			}
5154			if(!this.isUndefined(this.getDataset(ele, 'y'))) {
5155				y = this.getDataset(ele, 'y');
5156			}
5157			if(!this.isUndefined(this.getDataset(ele, 'position'))) {
5158				try{
5159					position = this.getDataset(ele, 'position').toString().split(',');
5160				}
5161				catch(event){}
5162			}
5163			if(position.length > 0) {
5164				position.push(null, null, null, null);
5165				var i = 0;
5166				for(i = 0; i < position.length; i++) {
5167					if(this.isUndefined(position[i]) || position[i] == null || position[i] == 'null' || position[i] == '') {
5168						position[i] = null;
5169					} else {
5170						position[i] = parseFloat(position[i]);
5171					}
5172				}
5173
5174				if(position[2] == null) {
5175					switch(position[0]) {
5176						case 0:
5177							x = 0;
5178							break;
5179						case 1:
5180							x = parseInt((w - ew) * 0.5);
5181							break;
5182						default:
5183							x = w - ew;
5184							break;
5185					}
5186				} else {
5187					switch(position[0]) {
5188						case 0:
5189							x = position[2];
5190							break;
5191						case 1:
5192							x = parseInt(w * 0.5) + position[2];
5193							break;
5194						default:
5195							x = w + position[2];
5196							break;
5197					}
5198				}
5199				if(position[3] == null) {
5200					switch(position[1]) {
5201						case 0:
5202							y = 0;
5203							break;
5204						case 1:
5205							y = parseInt((h - eh) * 0.5);
5206							break;
5207						default:
5208							y = h - eh;
5209							break;
5210					}
5211				} else {
5212					switch(position[1]) {
5213						case 0:
5214							y = position[3];
5215							break;
5216						case 1:
5217							y = parseInt(h * 0.5) + position[3];
5218							break;
5219						default:
5220							y = h + position[3];
5221							break;
5222					}
5223				}
5224			} else {
5225				if(x.substring(x.length - 1, x.length) == '%') {
5226					x = Math.floor(parseInt(x.substring(0, x.length - 1)) * w * 0.01);
5227				}
5228				if(y.substring(y.length - 1, y.length) == '%') {
5229					y = Math.floor(parseInt(y.substring(0, y.length - 1)) * h * 0.01);
5230				}
5231			}
5232			return {
5233				x: x,
5234				y: y
5235			}
5236
5237		},
5238		/*
5239			内置函数
5240			修改新增元件的坐标
5241		*/
5242		changeElementCoor: function() {
5243			for(var i = 0; i < this.elementArr.length; i++) {
5244				if(this.getByElement(this.elementArr[i]) != []) {
5245					var c = this.calculationCoor(this.getByElement(this.elementArr[i]));
5246					if(c['x'] && c['y']){
5247						this.css(this.elementArr[i], {
5248							top: c['y'] + 'px',
5249							left: c['x'] + 'px'
5250						});
5251					}
5252				}
5253			}
5254		},
5255		/*
5256			内置函数
5257			缓动效果集
5258		*/
5259		tween: function() {
5260			var Tween = {
5261				None: { //均速运动
5262					easeIn: function(t, b, c, d) {
5263						return c * t / d + b;
5264					},
5265					easeOut: function(t, b, c, d) {
5266						return c * t / d + b;
5267					},
5268					easeInOut: function(t, b, c, d) {
5269						return c * t / d + b;
5270					}
5271				},
5272				Quadratic: {
5273					easeIn: function(t, b, c, d) {
5274						return c * (t /= d) * t + b;
5275					},
5276					easeOut: function(t, b, c, d) {
5277						return -c * (t /= d) * (t - 2) + b;
5278					},
5279					easeInOut: function(t, b, c, d) {
5280						if((t /= d / 2) < 1) return c / 2 * t * t + b;
5281						return -c / 2 * ((--t) * (t - 2) - 1) + b;
5282					}
5283				},
5284				Cubic: {
5285					easeIn: function(t, b, c, d) {
5286						return c * (t /= d) * t * t + b;
5287					},
5288					easeOut: function(t, b, c, d) {
5289						return c * ((t = t / d - 1) * t * t + 1) + b;
5290					},
5291					easeInOut: function(t, b, c, d) {
5292						if((t /= d / 2) < 1) return c / 2 * t * t * t + b;
5293						return c / 2 * ((t -= 2) * t * t + 2) + b;
5294					}
5295				},
5296				Quartic: {
5297					easeIn: function(t, b, c, d) {
5298						return c * (t /= d) * t * t * t + b;
5299					},
5300					easeOut: function(t, b, c, d) {
5301						return -c * ((t = t / d - 1) * t * t * t - 1) + b;
5302					},
5303					easeInOut: function(t, b, c, d) {
5304						if((t /= d / 2) < 1) return c / 2 * t * t * t * t + b;
5305						return -c / 2 * ((t -= 2) * t * t * t - 2) + b;
5306					}
5307				},
5308				Quintic: {
5309					easeIn: function(t, b, c, d) {
5310						return c * (t /= d) * t * t * t * t + b;
5311					},
5312					easeOut: function(t, b, c, d) {
5313						return c * ((t = t / d - 1) * t * t * t * t + 1) + b;
5314					},
5315					easeInOut: function(t, b, c, d) {
5316						if((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b;
5317						return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;
5318					}
5319				},
5320				Sine: {
5321					easeIn: function(t, b, c, d) {
5322						return -c * Math.cos(t / d * (Math.PI / 2)) + c + b;
5323					},
5324					easeOut: function(t, b, c, d) {
5325						return c * Math.sin(t / d * (Math.PI / 2)) + b;
5326					},
5327					easeInOut: function(t, b, c, d) {
5328						return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;
5329					}
5330				},
5331				Exponential: {
5332					easeIn: function(t, b, c, d) {
5333						return(t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b;
5334					},
5335					easeOut: function(t, b, c, d) {
5336						return(t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b;
5337					},
5338					easeInOut: function(t, b, c, d) {
5339						if(t == 0) return b;
5340						if(t == d) return b + c;
5341						if((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
5342						return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
5343					}
5344				},
5345				Circular: {
5346					easeIn: function(t, b, c, d) {
5347						return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b;
5348					},
5349					easeOut: function(t, b, c, d) {
5350						return c * Math.sqrt(1 - (t = t / d - 1) * t) + b;
5351					},
5352					easeInOut: function(t, b, c, d) {
5353						if((t /= d / 2) < 1) return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;
5354						return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;
5355					}
5356				},
5357				Elastic: {
5358					easeIn: function(t, b, c, d, a, p) {
5359						if(t == 0) return b;
5360						if((t /= d) == 1) return b + c;
5361						if(!p) p = d * .3;
5362						if(!a || a < Math.abs(c)) {
5363							a = c;
5364							var s = p / 4;
5365						} else var s = p / (2 * Math.PI) * Math.asin(c / a);
5366						return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
5367					},
5368					easeOut: function(t, b, c, d, a, p) {
5369						if(t == 0) return b;
5370						if((t /= d) == 1) return b + c;
5371						if(!p) p = d * .3;
5372						if(!a || a < Math.abs(c)) {
5373							a = c;
5374							var s = p / 4;
5375						} else var s = p / (2 * Math.PI) * Math.asin(c / a);
5376						return(a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b);
5377					},
5378					easeInOut: function(t, b, c, d, a, p) {
5379						if(t == 0) return b;
5380						if((t /= d / 2) == 2) return b + c;
5381						if(!p) p = d * (.3 * 1.5);
5382						if(!a || a < Math.abs(c)) {
5383							a = c;
5384							var s = p / 4;
5385						} else var s = p / (2 * Math.PI) * Math.asin(c / a);
5386						if(t < 1) return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
5387						return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;
5388					}
5389				},
5390				Back: {
5391					easeIn: function(t, b, c, d, s) {
5392						if(s == undefined) s = 1.70158;
5393						return c * (t /= d) * t * ((s + 1) * t - s) + b;
5394					},
5395					easeOut: function(t, b, c, d, s) {
5396						if(s == undefined) s = 1.70158;
5397						return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
5398					},
5399					easeInOut: function(t, b, c, d, s) {
5400						if(s == undefined) s = 1.70158;
5401						if((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
5402						return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
5403					}
5404				},
5405				Bounce: {
5406					easeIn: function(t, b, c, d) {
5407						return c - Tween.Bounce.easeOut(d - t, 0, c, d) + b;
5408					},
5409					easeOut: function(t, b, c, d) {
5410						if((t /= d) < (1 / 2.75)) {
5411							return c * (7.5625 * t * t) + b;
5412						} else if(t < (2 / 2.75)) {
5413							return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
5414						} else if(t < (2.5 / 2.75)) {
5415							return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
5416						} else {
5417							return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
5418						}
5419					},
5420					easeInOut: function(t, b, c, d) {
5421						if(t < d / 2) return Tween.Bounce.easeIn(t * 2, 0, c, d) * .5 + b;
5422						else return Tween.Bounce.easeOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b;
5423					}
5424				}
5425			};
5426			return Tween;
5427		},
5428		/*
5429			接口函数
5430			缓动效果
5431			ele:Object=需要缓动的对象,
5432			parameter:String=需要改变的属性:x,y,width,height,alpha,
5433			effect:String=效果名称,
5434			start:Int=起始值,
5435			end:Int=结束值,
5436			speed:Number=运动的总秒数,支持小数
5437		*/
5438		animate: function(attribute) {
5439			if(this.playerType == 'flashplayer') {
5440				return this.V.animate(attribute);
5441			}
5442			var thisTemp = this;
5443			var animateId = 'animate_' + this.randomString();
5444			var obj = {
5445				element: null,
5446				parameter: 'x',
5447				static: false,
5448				effect: 'None.easeIn',
5449				start: null,
5450				end: null,
5451				speed: 0,
5452				overStop: false,
5453				pauseStop: false, //暂停播放时缓动是否暂停
5454				callBack: null
5455			};
5456			obj = this.standardization(obj, attribute);
5457			if(obj['element'] == null || obj['speed'] == 0) {
5458				return false;
5459			}
5460			var w = this.PD.offsetWidth,
5461				h = this.PD.offsetHeight;
5462			var effArr = (obj['effect'] + '.').split('.');
5463			var tweenFun = this.tween()[effArr[0]][effArr[1]];
5464			var eleCoor = {
5465				x: 0,
5466				y: 0
5467			};
5468			if(this.isUndefined(tweenFun)) {
5469				return false;
5470			}
5471			//先将该元件从元件数组里删除,让其不再跟随播放器的尺寸改变而改变位置
5472			var def = this.arrIndexOf(this.elementArr, obj['element'].className);
5473			if(def > -1) {
5474				this.elementArr.splice(def, 1);
5475			}
5476			//var run = true;
5477			var css = {};
5478			//对传递的参数进行转化,x和y转化成left,top
5479			var pm = this.getElement(obj['element']); //包含x,y,width,height,alpha属性
5480			var t = 0; //当前时间
5481			var b = 0; //初始值
5482			var c = 0; //变化量
5483			var d = obj['speed'] * 1000; //持续时间
5484			var timerTween = null;
5485			var tweenObj = null;
5486			var start = obj['start'] == null ? '' : obj['start'].toString();
5487			var end = obj['end'] == null ? '' : obj['end'].toString();
5488			switch(obj['parameter']) {
5489				case 'x':
5490					if(obj['start'] == null) {
5491						b = pm['x'];
5492					} else {
5493						if(start.substring(start.length - 1, start.length) == '%') {
5494							b = parseInt(start) * w * 0.01;
5495						} else {
5496							b = parseInt(start);
5497						}
5498
5499					}
5500					if(obj['end'] == null) {
5501						c = pm['x'] - b;
5502					} else {
5503						if(end.substring(end.length - 1, end.length) == '%') {
5504							c = parseInt(end) * w * 0.01 - b;
5505						} else if(end.substring(0, 1) == '-' || end.substring(0, 1) == '+') {
5506							if(typeof(obj['end']) == 'number') {
5507								c = parseInt(obj['end']) - b;
5508							} else {
5509								c = parseInt(end);
5510							}
5511
5512						} else {
5513							c = parseInt(end) - b;
5514						}
5515					}
5516					break;
5517				case 'y':
5518					if(obj['start'] == null) {
5519						b = pm['y'];
5520					} else {
5521						if(start.substring(start.length - 1, start.length) == '%') {
5522							b = parseInt(start) * h * 0.01;
5523						} else {
5524							b = parseInt(start);
5525						}
5526
5527					}
5528					if(obj['end'] == null) {
5529						c = pm['y'] - b;
5530					} else {
5531						if(end.substring(end.length - 1, end.length) == '%') {
5532							c = parseInt(end) * h * 0.01 - b;
5533						} else if(end.substring(0, 1) == '-' || end.substring(0, 1) == '+') {
5534							if(typeof(obj['end']) == 'number') {
5535								c = parseInt(obj['end']) - b;
5536							} else {
5537								c = parseInt(end);
5538							}
5539						} else {
5540							c = parseInt(end) - b;
5541						}
5542					}
5543					break;
5544				case 'alpha':
5545					if(obj['start'] == null) {
5546						b = pm['alpha'] * 100;
5547					} else {
5548						if(start.substring(start.length - 1, start.length) == '%') {
5549							b = parseInt(obj['start']);
5550						} else {
5551							b = parseInt(obj['start'] * 100);
5552						}
5553
5554					}
5555					if(obj['end'] == null) {
5556						c = pm['alpha'] * 100 - b;
5557					} else {
5558						if(end.substring(end.length - 1, end.length) == '%') {
5559							c = parseInt(end) - b;
5560						} else if(end.substring(0, 1) == '-' || end.substring(0, 1) == '+') {
5561							if(typeof(obj['end']) == 'number') {
5562								c = parseInt(obj['end']) * 100 - b;
5563							} else {
5564								c = parseInt(obj['end']) * 100;
5565							}
5566						} else {
5567							c = parseInt(obj['end']) * 100 - b;
5568						}
5569					}
5570					break;
5571			}
5572			var callBack = function() {
5573				var index = thisTemp.arrIndexOf(thisTemp.animateElementArray, animateId);
5574				if(index > -1) {
5575					thisTemp.animateArray.splice(index, 1);
5576					thisTemp.animateElementArray.splice(index, 1);
5577				}
5578				index = thisTemp.arrIndexOf(thisTemp.animatePauseArray, animateId);
5579				if(index > -1) {
5580					thisTemp.animatePauseArray.splice(index, 1);
5581				}
5582				if(obj['callBack'] != null && obj['element'] && obj['callBack'] != 'callBack' && obj['callBack'] != 'tweenX' && obj['tweenY'] != 'callBack' && obj['callBack'] != 'tweenAlpha') {
5583					var cb = eval(obj['callBack']);
5584					cb(obj['element']);
5585					obj['callBack'] = null;
5586				}
5587			};
5588			var stopTween = function() {
5589				if(timerTween != null) {
5590					if(timerTween.runing) {
5591						timerTween.stop();
5592					}
5593					timerTween = null;
5594				}
5595			};
5596			var tweenX = function() {
5597				if(t < d) {
5598					t += 10;
5599					css = {
5600						left: Math.ceil(tweenFun(t, b, c, d)) + 'px'
5601					};
5602					if(obj['static']) {
5603						eleCoor = thisTemp.calculationCoor(obj['element']);
5604						css['top'] = eleCoor['y'] + 'px';
5605					}
5606					thisTemp.css(obj['element'], css);
5607
5608				} else {
5609					stopTween();
5610					thisTemp.elementArr.push(obj['element'].className);
5611					callBack();
5612				}
5613			};
5614			var tweenY = function() {
5615				if(t < d) {
5616					t += 10;
5617					css = {
5618						top: Math.ceil(tweenFun(t, b, c, d)) + 'px'
5619					};
5620					if(obj['static']) {
5621						eleCoor = thisTemp.calculationCoor(obj['element']);
5622						css['left'] = eleCoor['x'] + 'px';
5623					}
5624					thisTemp.css(obj['element'], css);
5625				} else {
5626					stopTween();
5627					thisTemp.elementArr.push(obj['element'].className);
5628					callBack();
5629				}
5630			};
5631			var tweenAlpha = function() {
5632				if(t < d) {
5633					t += 10;
5634					eleCoor = thisTemp.calculationCoor(obj['element']);
5635					var ap = Math.ceil(tweenFun(t, b, c, d)) * 0.01;
5636					css = {
5637						filter: 'alpha(opacity:' + ap + ')',
5638						opacity: ap.toString()
5639					};
5640					if(obj['static']) {
5641						eleCoor = thisTemp.calculationCoor(obj['element']);
5642						css['top'] = eleCoor['y'] + 'px';
5643						css['left'] = eleCoor['x'] + 'px';
5644					}
5645					thisTemp.css(obj['element'], css);
5646				} else {
5647					stopTween();
5648					thisTemp.elementArr.push(obj['element'].className);
5649					callBack();
5650				}
5651			};
5652			switch(obj['parameter']) {
5653				case 'x':
5654					tweenObj = tweenX;
5655					break;
5656				case 'y':
5657					tweenObj = tweenY;
5658					break;
5659				case 'alpha':
5660					tweenObj = tweenAlpha;
5661					break;
5662				default:
5663					break;
5664			}
5665			timerTween = new thisTemp.timer(10, tweenObj);
5666			timerTween.callBackFunction=callBack;
5667			if(obj['overStop']) {
5668				var mouseOver = function() {
5669					if(timerTween != null && timerTween.runing) {
5670						timerTween.stop();
5671					}
5672				};
5673				this.addListenerInside('mouseover', mouseOver, obj['element']);
5674				var mouseOut = function() {
5675					var start = true;
5676					if(obj['pauseStop'] && thisTemp.getMetaDate()['paused']) {
5677						start = false;
5678					}
5679					if(timerTween != null && !timerTween.runing && start) {
5680						timerTween.start();
5681					}
5682				};
5683				this.addListenerInside('mouseout', mouseOut, obj['element']);
5684			}
5685
5686			this.animateArray.push(timerTween);
5687			this.animateElementArray.push(animateId);
5688			if(obj['pauseStop']) {
5689				this.animatePauseArray.push(animateId);
5690			}
5691			return animateId;
5692		},
5693		/*
5694			接口函数函数
5695			继续运行animate
5696		*/
5697		animateResume: function(id) {
5698			if(this.playerType == 'flashplayer') {
5699				this.V.animateResume(this.isUndefined(id) ? '' : id);
5700				return;
5701			}
5702			var arr = [];
5703			if(id != '' && !this.isUndefined(id) && id != 'pause') {
5704				arr.push(id);
5705			} else {
5706				if(id === 'pause') {
5707					arr = this.animatePauseArray;
5708				} else {
5709					arr = this.animateElementArray;
5710				}
5711			}
5712			for(var i = 0; i < arr.length; i++) {
5713				var index = this.arrIndexOf(this.animateElementArray, arr[i]);
5714				if(index > -1) {
5715					this.animateArray[index].start();
5716				}
5717			}
5718
5719		},
5720		/*
5721			接口函数
5722			暂停运行animate
5723		*/
5724		animatePause: function(id) {
5725			if(this.playerType == 'flashplayer') {
5726				this.V.animatePause(this.isUndefined(id) ? '' : id);
5727				return;
5728			}
5729			var arr = [];
5730			if(id != '' && !this.isUndefined(id) && id != 'pause') {
5731				arr.push(id);
5732			} else {
5733				if(id === 'pause') {
5734					arr = this.animatePauseArray;
5735				} else {
5736					arr = this.animateElementArray;
5737				}
5738			}
5739			for(var i = 0; i < arr.length; i++) {
5740				var index = this.arrIndexOf(this.animateElementArray, arr[i]);
5741				if(index > -1) {
5742					this.animateArray[index].stop();
5743				}
5744			}
5745		},
5746		/*
5747			内置函数
5748			根据ID删除数组里对应的内容
5749		*/
5750		deleteAnimate: function(id) {
5751			if(this.playerType == 'flashplayer' && this.V) {
5752				try {
5753					this.V.deleteAnimate(id);
5754				} catch(event) {this.log(event);}
5755				return;
5756			}
5757			//console.log(this.animateElementArray)
5758			var index = this.arrIndexOf(this.animateElementArray, id);
5759			if(index > -1) {
5760				this.animateArray[index].callBackFunction();
5761				this.animateArray.splice(index, 1);
5762				this.animateElementArray.splice(index, 1);
5763			}
5764		},
5765		/*
5766			内置函数
5767			删除外部新建的元件
5768		*/
5769		deleteElement: function(ele) {
5770			if(this.playerType == 'flashplayer' && this.V) {
5771				try {
5772					this.V.deleteElement(ele);
5773				} catch(event) {}
5774				return;
5775			}
5776			//先将该元件从元件数组里删除,让其不再跟随播放器的尺寸改变而改变位置
5777			var def = this.arrIndexOf(this.elementArr, ele.className);
5778			if(def > -1) {
5779				this.elementArr.splice(def, 1);
5780			}
5781			this.deleteAnimate(ele);
5782			this.deleteChild(ele);
5783
5784		},
5785		/*
5786			--------------------------------------------------------------
5787			共用函数部分
5788			以下函数并非只能在本程序中使用,也可以在页面其它项目中使用
5789			根据ID获取元素对象
5790		*/
5791		getByElement: function(obj, parent) {
5792			if(this.isUndefined(parent)) {
5793				parent = document;
5794			}
5795			var num = obj.substr(0, 1);
5796			var res = [];
5797			if(num != '#') {
5798				if(num == '.') {
5799					obj = obj.substr(1, obj.length);
5800				}
5801				if(parent.getElementsByClassName) {
5802					res = parent.getElementsByClassName(obj);
5803				} else {
5804					var reg = new RegExp(' ' + obj + ' ', 'i');
5805					var ele = parent.getElementsByTagName('*');
5806
5807					for(var i = 0; i < ele.length; i++) {
5808						if(reg.test(' ' + ele[i].className + ' ')) {
5809							res.push(ele[i]);
5810						}
5811					}
5812				}
5813
5814				if(res.length > 0) {
5815					return res[0];
5816				} else {
5817					return res;
5818				}
5819			} else {
5820				if(num == '#') {
5821					obj = obj.substr(1, obj.length);
5822				}
5823				return document.getElementById(obj);
5824			}
5825		},
5826		/*
5827		 	共用函数
5828			功能:修改样式或获取指定样式的值,
5829				elem:ID对象或ID对应的字符,如果多个对象一起设置,则可以使用数组
5830				attribute:样式名称或对象,如果是对象,则省略掉value值
5831				value:attribute为样式名称时,定义的样式值
5832				示例一:
5833				this.css(ID,'width','100px');
5834				示例二:
5835				this.css('id','width','100px');
5836				示例三:
5837				this.css([ID1,ID2,ID3],'width','100px');
5838				示例四:
5839				this.css(ID,{
5840					width:'100px',
5841					height:'100px'
5842				});
5843				示例五(获取宽度):
5844				var width=this.css(ID,'width');
5845		*/
5846		css: function(elem, attribute, value) {
5847			var i = 0;
5848			var k = '';
5849			if(typeof(elem) == 'object') { //对象或数组
5850				if(!this.isUndefined(typeof(elem.length))) { //说明是数组
5851					for(i = 0; i < elem.length; i++) {
5852						var el;
5853						if(typeof(elem[i]) == 'string') {
5854							el = this.getByElement(elem[i])
5855						} else {
5856							el = elem[i];
5857						}
5858						if(typeof(attribute) != 'object') {
5859							if(!this.isUndefined(value)) {
5860								el.style[attribute] = value;
5861							}
5862						} else {
5863							for(k in attribute) {
5864								if(!this.isUndefined(attribute[k])) {
5865									el.style[k] = attribute[k];
5866								}
5867							}
5868						}
5869					}
5870					return;
5871				}
5872
5873			}
5874			if(typeof(elem) == 'string') {
5875				elem = this.getByElement(elem);
5876			}
5877
5878			if(typeof(attribute) != 'object') {
5879				if(!this.isUndefined(value)) {
5880					elem.style[attribute] = value;
5881				} else {
5882					if(!this.isUndefined(this.getStyle(elem, attribute))) {
5883						return this.getStyle(elem, attribute);
5884					} else {
5885						return false;
5886					}
5887				}
5888			} else {
5889				for(k in attribute) {
5890					if(!this.isUndefined(attribute[k])) {
5891						elem.style[k] = attribute[k];
5892					}
5893				}
5894			}
5895
5896		},
5897		/*
5898			内置函数
5899			兼容型获取style
5900		*/
5901		getStyle: function(obj, attr) {
5902			if(!this.isUndefined(obj.style[attr])) {
5903				return obj.style[attr];
5904			} else {
5905				if(obj.currentStyle) {
5906					return obj.currentStyle[attr];
5907				} else {
5908					return getComputedStyle(obj, false)[attr];
5909				}
5910			}
5911		},
5912		/*
5913			共用函数
5914			判断变量是否存在或值是否为undefined
5915		*/
5916		isUndefined: function(value) {
5917			try {
5918				if(value == 'undefined' || value == undefined) {
5919					return true;
5920				}
5921			} catch(event) {this.log(event);}
5922			return false;
5923		},
5924		/*
5925		 	共用函数
5926			外部监听函数
5927		*/
5928		addListener: function(name, funName) {
5929			if(name && funName) {
5930				if(this.playerType == 'flashplayer') {
5931					var ff = ''; //定义用来向flashplayer传递的函数字符
5932					if(typeof(funName) == 'function') {
5933						ff = this.getParameterNames(funName);
5934					}
5935					this.V.addListener(name, ff);
5936					return;
5937				}
5938				var have = false;
5939				for(var i = 0; i < this.listenerJsArr.length; i++) {
5940					var arr = this.listenerJsArr[i];
5941					if(arr[0] == name && arr[1] == funName) {
5942						have = true;
5943						break;
5944					}
5945				}
5946				if(!have) {
5947					this.listenerJsArr.push([name, funName]);
5948				}
5949			}
5950		},
5951		/*
5952			共用函数
5953			外部删除监听函数
5954		*/
5955		removeListener: function(name, funName) {
5956			if(name && funName) {
5957				if(this.playerType == 'flashplayer') {
5958					var ff = ''; //定义用来向flashplayer传递的函数字符
5959					if(typeof(funName) == 'function') {
5960						ff = this.getParameterNames(funName);
5961					}
5962					this.V.removeListener(name, ff);
5963					return;
5964				}
5965				for(var i = 0; i < this.listenerJsArr.length; i++) {
5966					var arr = this.listenerJsArr[i];
5967					if(arr[0] == name && arr[1] == funName) {
5968						this.listenerJsArr.splice(i, 1);
5969						break;
5970					}
5971				}
5972			}
5973		},
5974		/*
5975			内部监听函数,调用方式:
5976			this.addListenerInside('click',function(event){},[ID]);
5977			d值为空时,则表示监听当前的视频播放器
5978		*/
5979		addListenerInside: function(e, f, d, t) {
5980			if(this.isUndefined(t)) {
5981				t = false;
5982			}
5983			var o = this.V;
5984			if(!this.isUndefined(d)) {
5985				o = d;
5986			}
5987			if(o.addEventListener) {
5988				try {
5989					o.addEventListener(e, f, t);
5990				} catch(event) {}
5991			} else if(o.attachEvent) {
5992				try {
5993					o.attachEvent('on' + e, f);
5994				} catch(event) {}
5995			} else {
5996				o['on' + e] = f;
5997			}
5998		},
5999		/*
6000			删除内部监听函数,调用方式:
6001			this.removeListenerInside('click',function(event){}[,ID]);
6002			d值为空时,则表示监听当前的视频播放器
6003		*/
6004		removeListenerInside: function(e, f, d, t) {
6005			/*if(this.playerType=='flashplayer' && this.getParameterNames(f) && this.isUndefined(d)) {
6006				return;
6007			}*/
6008			if(this.isUndefined(t)) {
6009				t = false;
6010			}
6011			var o = this.V;
6012			if(!this.isUndefined(d)) {
6013				o = d;
6014			}
6015			if(o.removeEventListener) {
6016				try {
6017					this.addNum--;
6018					o.removeEventListener(e, f, t);
6019				} catch(e) {}
6020			} else if(o.detachEvent) {
6021				try {
6022					o.detachEvent('on' + e, f);
6023				} catch(e) {}
6024			} else {
6025				o['on' + e] = null;
6026			}
6027		},
6028		/*
6029			共用函数
6030			统一分配监听,以达到跟as3同样效果
6031		*/
6032		sendJS: function(name, val) {
6033			var list = this.listenerJsArr;
6034			var obj = {
6035				variable: this.vars['variable']
6036			};
6037			if(this.vars['playerID']) {
6038				obj['playerID'] = this.vars['playerID'];
6039			}
6040			for(var i = 0; i < list.length; i++) {
6041				var arr = list[i];
6042				if(arr[0] == name) {
6043					if(val) {
6044						switch(arr[1].length) {
6045							case 1:
6046								arr[1](val);
6047								break;
6048							case 2:
6049								arr[1](val, obj);
6050								break;
6051							default:
6052								arr[1]();
6053								break;
6054						}
6055
6056					} else {
6057						switch(arr[1].length) {
6058							case 1:
6059								arr[1](obj);
6060								break;
6061							default:
6062								arr[1]();
6063								break;
6064						}
6065
6066					}
6067				}
6068			}
6069		},
6070		/*
6071			共用函数
6072			获取函数名称,如 function ckplayer(){} var fun=ckplayer,则getParameterNames(fun)=ckplayer
6073		*/
6074		getParameterNames: function(fn) {
6075			if(typeof(fn) !== 'function') {
6076				return false;
6077			}
6078			var COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
6079			var code = fn.toString().replace(COMMENTS, '');
6080			var result = code.slice(code.indexOf(' ') + 1, code.indexOf('('));
6081			return result === null ? false : result;
6082		},
6083		/*
6084			共用函数
6085			获取当前本地时间
6086		*/
6087		getNowDate: function() {
6088			var nowDate = new Date();
6089			var month = nowDate.getMonth() + 1;
6090			var date = nowDate.getDate();
6091			var hours = nowDate.getHours();
6092			var minutes = nowDate.getMinutes();
6093			var seconds = nowDate.getSeconds();
6094			var tMonth = '',
6095				tDate = '',
6096				tHours = '',
6097				tMinutes = '',
6098				tSeconds = '',
6099				tSeconds = (seconds < 10) ? '0' + seconds : seconds + '',
6100				tMinutes = (minutes < 10) ? '0' + minutes : minutes + '',
6101				tHours = (hours < 10) ? '0' + hours : hours + '',
6102				tDate = (date < 10) ? '0' + date : date + '',
6103				tMonth = (month < 10) ? '0' + month : month + '';
6104			return tMonth + '/' + tDate + ' ' + tHours + ':' + tMinutes + ':' + tSeconds;
6105		},
6106		/*
6107			共用函数
6108			格式化时分秒
6109			seconds:Int:秒数
6110			ishours:Boolean:是否显示小时,如果设置成false,则会显示如80:20,表示1小时20分钟20秒
6111		*/
6112		formatTime: function(seconds, ishours) {
6113			var tSeconds = '',
6114				tMinutes = '',
6115				tHours = '';
6116			if(isNaN(seconds)) {
6117				seconds = 0;
6118			}
6119			var s = Math.floor(seconds % 60),
6120				m = 0,
6121				h = 0;
6122			if(ishours) {
6123				m = Math.floor(seconds / 60) % 60;
6124				h = Math.floor(seconds / 3600);
6125			} else {
6126				m = Math.floor(seconds / 60);
6127			}
6128			tSeconds = (s < 10) ? '0' + s : s + '';
6129			tMinutes = (m > 0) ? ((m < 10) ? '0' + m + ':' : m + ':') : '00:';
6130			tHours = (h > 0) ? ((h < 10) ? '0' + h + ':' : h + ':') : '';
6131			if(ishours) {
6132				return tHours + tMinutes + tSeconds;
6133			} else {
6134				return tMinutes + tSeconds;
6135			}
6136		},
6137		/*
6138			共用函数
6139			获取一个随机字符
6140			len:随机字符长度
6141		*/
6142		randomString: function(len) {
6143			len = len || 16;
6144			var chars = 'abcdefghijklmnopqrstuvwxyz';
6145			var maxPos = chars.length;
6146			var val = '';
6147			for(i = 0; i < len; i++) {
6148				val += chars.charAt(Math.floor(Math.random() * maxPos));
6149			}
6150			return 'ch' + val;
6151		},
6152		/*
6153			共用函数
6154			获取字符串长度,中文算两,英文数字算1
6155		*/
6156		getStringLen: function(str) {
6157			var len = 0;
6158			for(var i = 0; i < str.length; i++) {
6159				if(str.charCodeAt(i) > 127 || str.charCodeAt(i) == 94) {
6160					len += 2;
6161				} else {
6162					len++;
6163				}
6164			}
6165			return len;
6166		},
6167		/*
6168			内部函数
6169			用来为ajax提供支持
6170		*/
6171		createXHR: function() {
6172			if(window.XMLHttpRequest) {
6173				//IE7+、Firefox、Opera、Chrome 和Safari
6174				return new XMLHttpRequest();
6175			} else if(window.ActiveXObject) {
6176				//IE6 及以下
6177				try {
6178					return new ActiveXObject('Microsoft.XMLHTTP');
6179				} catch(event) {
6180					try {
6181						return new ActiveXObject('Msxml2.XMLHTTP');
6182					} catch(event) {
6183						this.eject(this.errorList[7]);
6184					}
6185				}
6186			} else {
6187				this.eject(this.errorList[8]);
6188			}
6189		},
6190		/*
6191			共用函数
6192			ajax调用
6193		*/
6194		ajax: function(cObj) {
6195			var thisTemp = this;
6196			var callback = null;
6197			var obj = {
6198				method: 'get', //请求类型
6199				dataType: 'json', //请求的数据类型
6200				charset: 'utf-8',
6201				async: false, //true表示异步,false表示同步
6202				url: '',
6203				data: null,
6204				success: null
6205			};
6206			if(typeof(cObj) != 'object') {
6207				this.eject(this.errorList[9]);
6208				return;
6209			}
6210			obj = this.standardization(obj, cObj);
6211			if(obj.dataType === 'json' || obj.dataType === 'text' || obj.dataType === 'html') {
6212				var xhr = this.createXHR();
6213				callback = function() {
6214					//判断http的交互是否成功
6215					if(xhr.status == 200) {
6216						if(obj.success == null) {
6217							return;
6218						}
6219						if(obj.dataType === 'json') {
6220							try {
6221								obj.success(eval('(' + xhr.responseText + ')')); //回调传递参数
6222							} catch(event) {
6223								obj.success(null);
6224							}
6225						} else {
6226							obj.success(xhr.responseText); //回调传递参数
6227						}
6228					} else {
6229						thisTemp.eject(thisTemp.errorList[10], 'Ajax.status:' + xhr.status);
6230					}
6231				};
6232				obj.url = obj.url + '?rand=' + this.randomString(6);
6233				obj.data = this.formatParams(obj.data);
6233 //通过params()将名值对转换成字符串
6234				if(obj.method === 'get' && !this.isUndefined(obj.data)) {
6235					obj.url += obj.url.indexOf('?') == -1 ? '?' + obj.data : '&' + obj.data;
6236				}
6237				if(obj.async === true) { //true表示异步,false表示同步
6238					xhr.onreadystatechange = function() {
6239						if(xhr.readyState == 4) { //判断对象的状态是否交互完成
6240							callback(); //回调
6241						}
6242					};
6243				}
6244				xhr.open(obj.method, obj.url, obj.async);
6245				if(obj.method === 'post') {
6246					xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
6247					xhr.setRequestHeader('charset', obj['charset']);
6248					xhr.send(obj.data);
6249				} else {
6250					xhr.send(null); //get方式则填null
6251				}
6252				if(obj.async === false) { //同步
6253					callback();
6254				}
6255
6256			} else if(obj.dataType === 'jsonp') {
6257				var oHead = document.getElementsByTagName('head')[0];
6258				var oScript = document.createElement('script');
6259				var callbackName = 'callback' + new Date().getTime();
6260				var params = this.formatParams(obj.data) + '&callback=' + callbackName; //按时间戳拼接字符串
6261				callback = obj.success;
6262				//拼接好src
6263				oScript.src = obj.url.split('?') + '?' + params;
6264				//插入script标签
6265				oHead.insertBefore(oScript, oHead.firstChild);
6266				//jsonp的回调函数
6267				window[callbackName] = function(json) {
6268					callback(json);
6269					oHead.removeChild(oScript);
6270				};
6271			}
6272		},
6273		/*
6274			内置函数
6275			动态加载js
6276		*/
6277		loadJs: function(path, success) {
6278			var oHead = document.getElementsByTagName('HEAD').item(0);
6279			var oScript = document.createElement('script');
6280			oScript.type = 'text/javascript';
6281			oScript.src = this.getNewUrl(path);
6282			oHead.appendChild(oScript);
6283			oScript.onload = function() {
6284				success();
6285			}
6286		},
6287		/*
6288			共用函数
6289			排除IE6-9
6290		*/
6291		isMsie: function() {
6292			var browser = navigator.appName;
6293			var b_version = navigator.appVersion;
6294			var version = b_version.split(';');
6295			var trim_Version = '';
6296			if(version.length > 1) {
6297				trim_Version = version[1].replace(/[ ]/g, '');
6298			}
6299			if(browser == 'Microsoft Internet Explorer' && (trim_Version == 'MSIE6.0' || trim_Version == 'MSIE7.0' || trim_Version == 'MSIE8.0' || trim_Version == 'MSIE9.0' || trim_Version == 'MSIE10.0')) {
6300				return false;
6301			}
6302			return true;
6303		},
6304		/*
6305			共用函数
6306			判断是否安装了flashplayer
6307		*/
6308		uploadFlash: function() {
6309			var swf;
6310			if(navigator.userAgent.indexOf('MSIE') > 0) {
6311				try {
6312					var swf = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
6313					return true;
6314				} catch(e) {
6315					return false;
6316				}
6317			}
6318			if(navigator.userAgent.indexOf('Firefox') > 0) {
6319				swf = navigator.plugins['Shockwave Flash'];
6320				if(swf) {
6321					return true
6322				} else {
6323					return false;
6324				}
6325			}
6326			return true;
6327		},
6328		/*
6329			共用函数
6330			检测浏览器是否支持HTML5-Video
6331		*/
6332		supportVideo: function() {
6333			if(!this.isMsie()) {
6334				return false;
6335			}
6336			if(!!document.createElement('video').canPlayType) {
6337				var vidTest = document.createElement('video');
6338				var oggTest;
6339				try {
6340					oggTest = vidTest.canPlayType('video/ogg; codecs="theora, vorbis"');
6341				} catch(error) {
6342					oggTest = false;
6343				}
6344				if(!oggTest) {
6345					var h264Test;
6346					try {
6347						h264Test = vidTest.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');
6348					} catch(error) {
6349						h264Test = false;
6350					}
6351					if(!h264Test) {
6352						return false;
6353					} else {
6354						if(h264Test == "probably") {
6355							return true;
6356						} else {
6357							return false;
6358						}
6359					}
6360				} else {
6361					if(oggTest == "probably") {
6362						return true;
6363					} else {
6364						return false;
6365					}
6366				}
6367			} else {
6368				return false;
6369			}
6370		},
6371		/*
6372			共用函数
6373			获取属性值
6374		*/
6375		getDataset: function(ele, z) {
6376			try {
6377				return ele.dataset[z];
6378			} catch(error) {
6379				try {
6380					return ele.getAttribute('data-' + z)
6381				} catch(error) {
6382					return false;
6383				}
6384			}
6385		},
6386		/*
6387			共用函数
6388			返回flashplayer的对象
6389		*/
6390		getObjectById: function(id) {
6391			var x = null;
6392			var y = this.getByElement('#' + id);
6393			var r = 'embed';
6394			if(y && y.nodeName == 'OBJECT') {
6395				if(typeof(y.SetVariable) != 'undefined') {
6396					x = y;
6397				} else {
6398					var z = y.getElementsByTagName(r)[0];
6399					if(z) {
6400						x = z;
6401					}
6402				}
6403			}
6404			return x;
6405		},
6406		/*
6407			共用函数
6408			对象转地址字符串
6409		*/
6410		formatParams: function(data) {
6411			var arr = [];
6412			for(var i in data) {
6413				arr.push(encodeURIComponent(i) + '=' + encodeURIComponent(data[i]));
6414			}
6415			return arr.join('&');
6416		},
6417		/*
6418			内置函数
6419			对地址进行冒泡排序
6420		*/
6421		arrSort: function(arr) {
6422			var temp = [];
6423			for(var i = 0; i < arr.length; i++) {
6424				for(var j = 0; j < arr.length - i; j++) {
6425					if(!this.isUndefined(arr[j + 1]) && arr[j][3] < arr[j + 1][3]) {
6426						temp = arr[j + 1];
6427						arr[j + 1] = arr[j];
6428						arr[j] = temp;
6429					}
6430				}
6431			}
6432			return arr;
6433		},
6434		/*
6435			内置函数
6436			判断文件后缀
6437		*/
6438		getFileExt: function(filepath) {
6439			if(filepath != '' && !this.isUndefined(filepath)) {
6440				if(filepath.indexOf('?') > -1) {
6441					filepath = filepath.split('?')[0];
6442				}
6443				var pos = '.' + filepath.replace(/.+\./, '');
6444				return pos;
6445			}
6446			return '';
6447		},
6448		/*
6449			内置函数
6450			判断是否是移动端
6451		*/
6452		isMobile: function() {
6453			if(navigator.userAgent.match(/(iPhone|iPad|iPod|Android|ios)/i)) {
6454				return true;
6455			}
6456			return false;
6457		},
6458		/*
6459			内置函数
6460			搜索字符串str是否包含key
6461		*/
6462		isContains: function(str, key) {
6463			return str.indexOf(key) > -1;
6464		},
6465		/*
6466			内置函数
6467			给地址添加随机数
6468		*/
6469		getNewUrl: function(url) {
6470			if(this.isContains(url, '?')) {
6471				return url += '&' + this.randomString(8) + '=' + this.randomString(8);
6472			} else {
6473				return url += '?' + this.randomString(8) + '=' + this.randomString(8);
6474			}
6475		},
6476		/*
6477			共用函数
6478			获取clientX和clientY
6479		*/
6480		client: function(event) {
6481			var eve = event || window.event;
6482			if(this.isUndefined(eve)) {
6483				eve = {
6484					clientX: 0,
6485					clientY: 0
6486				};
6487			}
6488			return {
6489				x: eve.clientX + (document.documentElement.scrollLeft || this.body.scrollLeft) - this.pdCoor['x'],
6490				y: eve.clientY + (document.documentElement.scrollTop || this.body.scrollTop) - this.pdCoor['y']
6491			}
6492		},
6493		/*
6494			内置函数
6495			获取节点的绝对坐标
6496		*/
6497		getCoor: function(obj) {
6498			var coor = this.getXY(obj);
6499			return {
6500				x: coor['x'] - this.pdCoor['x'],
6501				y: coor['y'] - this.pdCoor['y']
6502			};
6503		},
6504		getXY: function(obj) {
6505			var parObj = obj;
6506			var left = obj.offsetLeft;
6507			var top = obj.offsetTop;
6508			while(parObj = parObj.offsetParent) {
6509				left += parObj.offsetLeft;
6510				top += parObj.offsetTop;
6511			}
6512			return {
6513				x: left,
6514				y: top
6515			};
6516		},
6517		/*
6518			内置函数
6519			删除本对象的所有属性
6520		*/
6521		removeChild: function() {
6522			if(this.playerType == 'html5video') {
6523				//删除计时器
6524				var i = 0;
6525				var timerArr = [this.timerError, this.timerFull, this.timerTime, this.timerBuffer, this.timerClick, this.timerLoading, this.timerCBar, this.timerVCanvas];
6526				for(i = 0; i < timerArr.length; i++) {
6527					if(timerArr[i] != null) {
6528						if(timerArr[i].runing) {
6529							timerArr[i].stop();
6530						}
6531						timerArr[i] = null;
6532					}
6533				}
6534				//删除事件监听
6535				var ltArr = this.listenerJsArr;
6536				for(i = 0; i < ltArr.length; i++) {
6537					this.removeListener(ltArr[i][0], ltArr[i][1]);
6538				}
6539			}
6540			this.playerType == '';
6541			this.V = null;
6542			if(this.showFace) {
6543				this.deleteChild(this.CB['menu']);
6544			}
6545			this.deleteChild(this.PD);
6546			this.CD.innerHTML = '';
6547		},
6548		/*
6549			内置函数
6550			画封闭的图形
6551		*/
6552		canvasFill: function(name, path) {
6553			name.beginPath();
6554			for(var i = 0; i < path.length; i++) {
6555				var d = path[i];
6556				if(i > 0) {
6557					name.lineTo(d[0], d[1]);
6558				} else {
6559					name.moveTo(d[0], d[1]);
6560				}
6561			}
6562			name.closePath();
6563			name.fill();
6564		},
6565		/*
6566			内置函数
6567			画矩形
6568		*/
6569		canvasFillRect: function(name, path) {
6570			for(var i = 0; i < path.length; i++) {
6571				var d = path[i];
6572				name.fillRect(d[0], d[1], d[2], d[3]);
6573			}
6574		},
6575		/*
6576			共用函数
6577			删除容器节点
6578		*/
6579		deleteChild: function(f) {
6580			var def = this.arrIndexOf(this.elementArr, f.className);
6581			if(def > -1) {
6582				this.elementArr.splice(def, 1);
6583			}
6584			var childs = f.childNodes;
6585			for(var i = childs.length - 1; i >= 0; i--) {
6586				f.removeChild(childs[i]);
6587			}
6588
6589			if(f && f != null && f.parentNode) {
6590				try {
6591					if(f.parentNode) {
6592						f.parentNode.removeChild(f);
6593
6594					}
6595
6596				} catch(event) {}
6597			}
6598		},
6599		/*
6600			内置函数
6601		 	根据容器的宽高,内部节点的宽高计算出内部节点的宽高及坐标
6602		*/
6603		getProportionCoor: function(stageW, stageH, vw, vh) {
6604			var w = 0,
6605				h = 0,
6606				x = 0,
6607				y = 0;
6608			if(stageW / stageH < vw / vh) {
6609				w = stageW;
6610				h = w * vh / vw;
6611			} else {
6612				h = stageH;
6613				w = h * vw / vh;
6614			}
6615			x = (stageW - w) * 0.5;
6616			y = (stageH - h) * 0.5;
6617			return {
6618				width: parseInt(w),
6619				height: parseInt(h),
6620				x: parseInt(x),
6621				y: parseInt(y)
6622			};
6623		},
6624		/*
6625			共用函数
6626			将字幕文件内容转换成数组
6627		*/
6628		parseSrtSubtitles: function(srt) {
6629			var subtitles = [];
6630			var textSubtitles = [];
6631			var i = 0;
6632			var arrs = srt.split('\n');
6633			var arr = [];
6634			var delHtmlTag = function(str) {
6635				return str.replace(/<[^>]+>/g, ''); //去掉所有的html标记
6636			};
6637			for(i = 0; i < arrs.length; i++) {
6638				if(arrs[i].replace(/\s/g, '').length > 0) {
6639					arr.push(arrs[i]);
6640				} else {
6641					if(arr.length > 0) {
6642						textSubtitles.push(arr);
6643					}
6644					arr = [];
6645				}
6646			}
6647			for(i = 0; i < textSubtitles.length; ++i) {
6648				var textSubtitle = textSubtitles[i];
6649				if(textSubtitle.length >= 2) {
6650					var sn = textSubtitle[0]; // 字幕的序号
6651					var startTime = this.toSeconds(this.trim(textSubtitle[1].split(' --> ')[0])); // 字幕的开始时间
6652					var endTime = this.toSeconds(this.trim(textSubtitle[1].split(' --> ')[1])); // 字幕的结束时间
6653					var content = [delHtmlTag(textSubtitle[2])]; // 字幕的内容
6654					// 字幕可能有多行
6655					if(textSubtitle.length > 2) {
6656						for(var j = 3; j < textSubtitle.length; j++) {
6657							content.push(delHtmlTag(textSubtitle[j]));
6658						}
6659					}
6660					// 字幕对象
6661					var subtitle = {
6662						sn: sn,
6663						startTime: startTime,
6664						endTime: endTime,
6665						content: content
6666					};
6667					subtitles.push(subtitle);
6668				}
6669			}
6670			return subtitles;
6671		},
6672		/*
6673			共用函数
6674			计时器,该函数模拟as3中的timer原理
6675			time:计时时间,单位:毫秒
6676			fun:接受函数
6677			number:运行次数,不设置则无限运行
6678		*/
6679		timer: function(time, fun, number) {
6680			var thisTemp = this;
6681			this.time = 10; //运行间隔
6682			this.fun = null; //监听函数
6683			this.timeObj = null;
6683 //setInterval对象
6684			this.number = 0; //已运行次数
6685			this.numberTotal = null; //总至需要次数
6686			this.runing = false; //当前状态
6687			this.startFun = function() {
6688				thisTemp.number++;
6689				thisTemp.fun();
6690				if(thisTemp.numberTotal != null && thisTemp.number >= thisTemp.numberTotal) {
6691					thisTemp.stop();
6692				}
6693			};
6694			this.start = function() {
6695				if(!thisTemp.runing) {
6696					thisTemp.runing = true;
6697					thisTemp.timeObj = window.setInterval(thisTemp.startFun, time);
6698				}
6699			};
6700			this.stop = function() {
6701				if(thisTemp.runing) {
6702					thisTemp.runing = false;
6703					window.clearInterval(thisTemp.timeObj);
6704					thisTemp.timeObj = null;
6705				}
6706			};
6707			if(time) {
6708				this.time = time;
6709			}
6710			if(fun) {
6711				this.fun = fun;
6712			}
6713			if(number) {
6714				this.numberTotal = number;
6715			}
6716			this.start();
6717		},
6718		/*
6719			共用函数
6720			将时分秒转换成秒
6721		*/
6722		toSeconds: function(t) {
6723			var s = 0.0;
6724			if(t) {
6725				var p = t.split(':');
6726				for(i = 0; i < p.length; i++) {
6727					s = s * 60 + parseFloat(p[i].replace(',', '.'));
6728				}
6729			}
6730			return s;
6731		},
6732		/*
6733			共用函数
6734			将对象Object标准化
6735		*/
6736		standardization: function(o, n) { //n替换进o
6737			var h = {};
6738			var k;
6739			for(k in o) {
6740				h[k] = o[k];
6741			}
6742			for(k in n) {
6743				var type = typeof(h[k]);
6744				switch(type) {
6745					case 'number':
6746						h[k] = parseFloat(n[k]);
6747						break;
6748					default:
6749						h[k] = n[k];
6750						break;
6751				}
6752
6753			}
6754			return h;
6755		},
6756		/*
6757			共用函数
6758			搜索数组
6759		 */
6760		arrIndexOf: function(arr, key) {
6761			var re = new RegExp(key, ['']);
6762			return(arr.toString().replace(re, '┢').replace(/[^,┢]/g, '')).indexOf('┢');
6763		},
6764		/*
6765			共用函数
6766			去掉空格
6767		 */
6768		trim: function(str) {
6769			if(str!=''){
6770				return str.replace(/(^\s*)|(\s*$)/g, '');
6771			}
6772			return '';
6773		},
6774		/*
6775			共用函数
6776			输出内容到控制台
6777		*/
6778		log: function(val) {
6779			try {
6780				console.log(val);
6781			} catch(e) {}
6782		},
6783		/*
6784			共用函数
6785			弹出提示
6786		*/
6787		eject: function(er, val) {
6788			if(!this.vars['debug']) {
6789				return;
6790			}
6791			var errorVal = er[1];
6792			if(!this.isUndefined(val)) {
6793				errorVal = errorVal.replace('[error]', val);
6794			}
6795			var value = 'error ' + er[0] + ':' + errorVal;
6796			try {
6797				this.log(value);
6798			} catch(e) {}
6799		}
6800	};
6801	window.ckplayer = ckplayer;
6802})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.