no commit message
This commit is contained in:
+142
-140
@@ -9,6 +9,7 @@
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = global || self, global.ckplayer = factory());
|
||||
}(this, function () { 'use strict';
|
||||
function ckplayerEmbed(videoObj){
|
||||
/*
|
||||
* language
|
||||
* 功能:全局变量,包含播放器用到的默认语言包
|
||||
@@ -401,7 +402,6 @@
|
||||
video.attr('width','100%').attr('height','100%');
|
||||
CV.append(video);
|
||||
}
|
||||
|
||||
if(vars['autoplay']){
|
||||
video.attr('autoplay','autoplay');
|
||||
paused=false;
|
||||
@@ -2863,7 +2863,7 @@
|
||||
newEvent.addEventListener('webfull',fn);
|
||||
}
|
||||
else{
|
||||
CK.removeClass('ckplayer-ckplayer-smallwindow');
|
||||
exitSmallWindows();
|
||||
if(!isUndefined(vars['theatre'])){
|
||||
C['bar']['theatreAndExit'].hide();
|
||||
}
|
||||
@@ -2923,7 +2923,7 @@
|
||||
}
|
||||
}
|
||||
else{
|
||||
CK.removeClass('ckplayer-ckplayer-smallwindow');
|
||||
exitSmallWindows();
|
||||
CK.css({
|
||||
'position':'absolute',
|
||||
'top':CT.offset()['top'],
|
||||
@@ -3135,6 +3135,7 @@
|
||||
else{
|
||||
C['bar'].append(ele);
|
||||
}
|
||||
ele.CK=CK;
|
||||
ele.show();
|
||||
}
|
||||
return ele;
|
||||
@@ -4247,23 +4248,6 @@
|
||||
return;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* getElement
|
||||
* 功能:获取一个外部节点
|
||||
*/
|
||||
function getElement(content){
|
||||
var ele=$(content);
|
||||
if(isUndefined(ele)) return;
|
||||
if(valType(ele)=='htmlarray'){
|
||||
ele=ele[0];
|
||||
}
|
||||
if(isUndefined(ele.captureParentNode)){
|
||||
ele.captureParentNode = ele.parentNode;
|
||||
ele.prevElement=ele.prev();
|
||||
ele.nextElement=ele.next();
|
||||
}
|
||||
return ele;
|
||||
}
|
||||
/*
|
||||
* windowScroll
|
||||
* 功能:监听页面滚动
|
||||
@@ -4271,16 +4255,7 @@
|
||||
function windowScroll() {
|
||||
if(!CT.smallWindows) return;
|
||||
if(CT.webFull || CT.theatre || CT.full){
|
||||
if(CK.hasClass('ckplayer-ckplayer-smallwindow')){
|
||||
CK.removeClass('ckplayer-ckplayer-smallwindow');
|
||||
eventTarget('smallWindows',false);
|
||||
smallWindowsState=false;
|
||||
if(vars['smallWindowsDrag']){
|
||||
CK.drag();
|
||||
}
|
||||
allBarShow();
|
||||
checkVideoRotate();
|
||||
}
|
||||
exitSmallWindows();
|
||||
return;
|
||||
}
|
||||
var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
|
||||
@@ -4290,17 +4265,25 @@
|
||||
eventTarget('smallWindows',true);
|
||||
smallWindowsState=true;
|
||||
if(vars['smallWindowsDrag']){
|
||||
CK.drag(true);
|
||||
drag(true);
|
||||
}
|
||||
allBarHide();
|
||||
checkVideoRotate();
|
||||
}
|
||||
}
|
||||
else{
|
||||
exitSmallWindows();
|
||||
}
|
||||
}
|
||||
/*
|
||||
* exitSmallWindows
|
||||
* 退出小窗口模式
|
||||
*/
|
||||
function exitSmallWindows(){
|
||||
if(CK.hasClass('ckplayer-ckplayer-smallwindow')){
|
||||
CK.removeClass('ckplayer-ckplayer-smallwindow');
|
||||
if(vars['smallWindowsDrag']){
|
||||
CK.drag();
|
||||
drag();
|
||||
}
|
||||
eventTarget('smallWindows',false);
|
||||
smallWindowsState=false;
|
||||
@@ -4308,7 +4291,66 @@
|
||||
checkVideoRotate();
|
||||
}
|
||||
}
|
||||
/*
|
||||
* drag
|
||||
* 功能,使节点可拖动
|
||||
* state:是否开启可拖动,默认=false,关闭状态
|
||||
*/
|
||||
function drag(state) {
|
||||
var doc=$(document);
|
||||
var posX = 0,posY = 0,
|
||||
posXRecord = 0,posYRecord = 0;
|
||||
var open=false;
|
||||
if(!isUndefined(state)){
|
||||
open=state;
|
||||
}
|
||||
var mouseDown = function(e) {
|
||||
e.preventDefault && e.preventDefault();
|
||||
e = e || window.event;
|
||||
var client = getClient(e);
|
||||
posXRecord = client['x'];
|
||||
posYRecord = client['y'];
|
||||
doc.mousemove(docMouseMove);
|
||||
doc.mouseup(docMouseUp);
|
||||
CK.css({
|
||||
'cursor':'move'
|
||||
});
|
||||
};
|
||||
var docMouseMove = function(e) {
|
||||
e = e || window.event;
|
||||
var client = getClient(e);
|
||||
var eleOffset = CK.offset();
|
||||
posY = client['y']-posYRecord;
|
||||
posX = client['x']-posXRecord;
|
||||
posXRecord = client['x'];
|
||||
posYRecord = client['y'];
|
||||
var left=eleOffset['left']+posX;
|
||||
var top=eleOffset['top']+posY;
|
||||
CK.css({
|
||||
'left':left+'px',
|
||||
'top':top+'px'
|
||||
});
|
||||
if(CK.css('position')!='fixed'){
|
||||
CK.css({
|
||||
'position':'fixed'
|
||||
});
|
||||
}
|
||||
isDrag=true;
|
||||
};
|
||||
var docMouseUp = function() {
|
||||
doc.removeListener('mousemove', docMouseMove);
|
||||
doc.removeListener('mouseup', docMouseUp);
|
||||
CK.css({
|
||||
'cursor':'default'
|
||||
});
|
||||
};
|
||||
if(open){
|
||||
CK.mousedown(mouseDown);
|
||||
}
|
||||
else{
|
||||
CK.unbind('mousedown');
|
||||
}
|
||||
};
|
||||
/*
|
||||
* checkVideoRotate
|
||||
* 检查播放器尺寸
|
||||
@@ -5027,7 +5069,63 @@
|
||||
C['about']['objData'][o]=n;
|
||||
return C['about'].find('ul').eq(0).htm(htm);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* calculationFps
|
||||
* 功能:获取fps
|
||||
*/
|
||||
function calculationFps() {
|
||||
var requestAnimationFrame =
|
||||
window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
window.oRequestAnimationFrame ||
|
||||
window.msRequestAnimationFrame ||
|
||||
function(callback) {
|
||||
window.setTimeout(callback, 1000 / 60);
|
||||
};
|
||||
var e, pe, pid, fps, last, offset;
|
||||
fps = 0;
|
||||
last = Date.now();
|
||||
var step = function() {
|
||||
offset = Date.now() - last;
|
||||
fps += 1;
|
||||
if(offset >= 1000) {
|
||||
last += offset;
|
||||
appendFps(fps);
|
||||
fps = 0;
|
||||
}
|
||||
requestAnimationFrame(step);
|
||||
};
|
||||
var appendFps = function(fps) {
|
||||
if(fps!=CT.fps){
|
||||
CT.fps=fps;
|
||||
replaceInformation('fps',fps);
|
||||
eventTarget('fps',fps);
|
||||
}
|
||||
|
||||
};
|
||||
if(isUndefined(CT.fps)){
|
||||
CT.fps=0;
|
||||
}
|
||||
step();
|
||||
}
|
||||
/*
|
||||
* getElement
|
||||
* 功能:获取一个外部节点
|
||||
*/
|
||||
function getElement(content){
|
||||
var ele=$(content);
|
||||
if(isUndefined(ele)) return;
|
||||
if(valType(ele)=='htmlarray'){
|
||||
ele=ele[0];
|
||||
}
|
||||
if(isUndefined(ele.captureParentNode)){
|
||||
ele.captureParentNode = ele.parentNode;
|
||||
ele.prevElement=ele.prev();
|
||||
ele.nextElement=ele.next();
|
||||
}
|
||||
return ele;
|
||||
}
|
||||
/*
|
||||
* $
|
||||
@@ -5564,8 +5662,12 @@
|
||||
callBack:完成后的回调函数
|
||||
*/
|
||||
res.animate=function(parameter,totalTime,easing,callBack) {
|
||||
if(isUndefined(this.CK)){
|
||||
return res;
|
||||
}
|
||||
var thisTemp = this;
|
||||
var w =CK.getWidth(),h = CK.getHeight();
|
||||
var parNode=this.CK;
|
||||
var w =parNode.getWidth(),h = parNode.getHeight();
|
||||
var speed=10;//跳针时间
|
||||
this.timerTween=null;
|
||||
this.tweenPlay=true;
|
||||
@@ -5786,7 +5888,7 @@
|
||||
current=parseInt(thisTemp.css('left'));
|
||||
}
|
||||
else{
|
||||
current = thisTemp.offset()['left']-CK.offset()['left'];
|
||||
current = thisTemp.offset()['left']-parNode.offset()['left'];
|
||||
}
|
||||
if (vars.substring(vars.length - 1, vars.length) == '%') {
|
||||
result = parseInt(vars) * w * 0.01;
|
||||
@@ -5801,7 +5903,7 @@
|
||||
current=parseInt(thisTemp.css('right'));
|
||||
}
|
||||
else{
|
||||
current = CK.getWidth()-(thisTemp.offset()['left']-CK.offset()['left']+thisTemp.getWidth());
|
||||
current = parNode.getWidth()-(thisTemp.offset()['left']-parNode.offset()['left']+thisTemp.getWidth());
|
||||
}
|
||||
if (vars.substring(vars.length - 1, vars.length) == '%') {
|
||||
result = parseInt(vars) * w * 0.01;
|
||||
@@ -5816,7 +5918,7 @@
|
||||
current=parseInt(thisTemp.css('top'));
|
||||
}
|
||||
else{
|
||||
current = thisTemp.offset()['top']-CK.offset()['top'];
|
||||
current = thisTemp.offset()['top']-parNode.offset()['top'];
|
||||
}
|
||||
if (vars.substring(vars.length - 1, vars.length) == '%') {
|
||||
result = parseInt(vars) * h * 0.01;
|
||||
@@ -5831,7 +5933,7 @@
|
||||
current=parseInt(thisTemp.css('bottom'));
|
||||
}
|
||||
else{
|
||||
current = CK.getHeight()-(thisTemp.offset()['top']-CK.offset()['top']+thisTemp.getHeight());
|
||||
current = parNode.getHeight()-(thisTemp.offset()['top']-parNode.offset()['top']+thisTemp.getHeight());
|
||||
}
|
||||
if (vars.substring(vars.length - 1, vars.length) == '%') {
|
||||
result = parseInt(vars) * h * 0.01;
|
||||
@@ -5957,69 +6059,6 @@
|
||||
}
|
||||
return this;
|
||||
};
|
||||
/*
|
||||
* drag
|
||||
* 功能,使节点可拖动
|
||||
* state:是否开启可拖动,默认=false,关闭状态
|
||||
*/
|
||||
res.drag = function(state) {
|
||||
var doc=$(document);
|
||||
var thisTemp=this;
|
||||
var posX = 0,posY = 0,
|
||||
posXRecord = 0,posYRecord = 0;
|
||||
var open=false;
|
||||
if(!isUndefined(state)){
|
||||
open=state;
|
||||
}
|
||||
var mouseDown = function(e) {
|
||||
e.preventDefault && e.preventDefault();
|
||||
e = e || window.event;
|
||||
var client = getClient(e);
|
||||
posXRecord = client['x'];
|
||||
posYRecord = client['y'];
|
||||
doc.mousemove(docMouseMove);
|
||||
doc.mouseup(docMouseUp);
|
||||
thisTemp.css({
|
||||
'cursor':'move'
|
||||
});
|
||||
};
|
||||
var docMouseMove = function(e) {
|
||||
e = e || window.event;
|
||||
var client = getClient(e);
|
||||
var eleOffset = thisTemp.offset();
|
||||
posY = client['y']-posYRecord;
|
||||
posX = client['x']-posXRecord;
|
||||
posXRecord = client['x'];
|
||||
posYRecord = client['y'];
|
||||
var left=eleOffset['left']+posX;
|
||||
var top=eleOffset['top']+posY;
|
||||
thisTemp.css({
|
||||
'left':left+'px',
|
||||
'top':top+'px'
|
||||
});
|
||||
if(thisTemp.css('position')!='fixed'){
|
||||
thisTemp.css({
|
||||
'position':'fixed'
|
||||
});
|
||||
}
|
||||
if(thisTemp==CK){
|
||||
isDrag=true;
|
||||
}
|
||||
};
|
||||
var docMouseUp = function() {
|
||||
doc.removeListener('mousemove', docMouseMove);
|
||||
doc.removeListener('mouseup', docMouseUp);
|
||||
thisTemp.css({
|
||||
'cursor':'default'
|
||||
});
|
||||
};
|
||||
if(open){
|
||||
thisTemp.mousedown(mouseDown);
|
||||
}
|
||||
else{
|
||||
thisTemp.unbind('mousedown');
|
||||
}
|
||||
};
|
||||
} else {
|
||||
/*
|
||||
* each
|
||||
@@ -6652,46 +6691,7 @@
|
||||
}
|
||||
return path;
|
||||
}
|
||||
/*
|
||||
* calculationFps
|
||||
* 功能:获取fps
|
||||
*/
|
||||
function calculationFps() {
|
||||
var requestAnimationFrame =
|
||||
window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
window.oRequestAnimationFrame ||
|
||||
window.msRequestAnimationFrame ||
|
||||
function(callback) {
|
||||
window.setTimeout(callback, 1000 / 60);
|
||||
};
|
||||
var e, pe, pid, fps, last, offset;
|
||||
fps = 0;
|
||||
last = Date.now();
|
||||
var step = function() {
|
||||
offset = Date.now() - last;
|
||||
fps += 1;
|
||||
if(offset >= 1000) {
|
||||
last += offset;
|
||||
appendFps(fps);
|
||||
fps = 0;
|
||||
}
|
||||
requestAnimationFrame(step);
|
||||
};
|
||||
var appendFps = function(fps) {
|
||||
if(fps!=CT.fps){
|
||||
CT.fps=fps;
|
||||
replaceInformation('fps',fps);
|
||||
eventTarget('fps',fps);
|
||||
}
|
||||
|
||||
};
|
||||
if(isUndefined(CT.fps)){
|
||||
CT.fps=0;
|
||||
}
|
||||
step();
|
||||
}
|
||||
/*
|
||||
* checkJs
|
||||
* 功能:判断js是否已加载
|
||||
@@ -7023,5 +7023,7 @@
|
||||
return 'iphone';
|
||||
}
|
||||
}
|
||||
return into;
|
||||
return into(videoObj);
|
||||
}
|
||||
return ckplayerEmbed;
|
||||
}));
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user