You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
126 KiB
JavaScript
27 lines
126 KiB
JavaScript
6 years ago
|
window.Player=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=c(n(8)),o=c(n(3)),a=c(n(25)),s=c(n(26)),l=c(n(4)),u=n(5);function c(e){return e&&e.__esModule?e:{default:e}}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var d=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=p(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));if(n.config=o.default.deepCopy({width:600,height:337.5,ignores:[],whitelist:[],lang:(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase(),inactive:3e3,volume:.6,controls:!0,controlsList:["nodownload"]},e),n.version=u.version,n.userTimer=null,n.waitTimer=null,n.database=new a.default,n.history=[],n.isProgressMoving=!1,n.root=o.default.findDom(document,"#"+n.config.id),n.controls=o.default.createDom("xg-controls","",{unselectable:"on",onselectstart:"return false"},"xgplayer-controls"),!n.root){var r=n.config.el;if(!r||1!==r.nodeType)return n.emit("error",new l.default("use",n.config.vid,{line:32,handle:"Constructor",msg:"container id can't be empty"})),!1,p(n,!1);n.root=r}if(n.rootBackup=o.default.copyDom(n.root),o.default.addClass(n.root,"xgplayer xgplayer-"+s.default.device+" xgplayer-nostart "+(n.config.controls?"":"no-controls")),n.root.appendChild(n.controls),n.config.fluid?(n.root.style["max-width"]="100%",n.root.style.width="100%",n.root.style.height="0",n.root.style["padding-top"]=100*n.config.height/n.config.width+"%",n.video.style.position="absolute",n.video.style.top="0",n.video.style.left="0"):(n.root.style.width=n.config.width+"px",n.root.style.height=n.config.height+"px"),n.config.controlStyle&&"String"===o.default.typeOf(n.config.controlStyle)){var i=n;fetch(i.config.controlStyle,{method:"GET",headers:{Accept:"application/json"}}).then(function(e){e.ok&&e.json().then(function(e){for(var t in e)e.hasOwnProperty(t)&&(i.config[t]=e[t]);i.pluginsCall()})}).catch(function(e){console.log("Fetch错误:"+e)})}else n.pluginsCall();n.ev.forEach(function(e){var t=Object.keys(e)[0],r=n[e[t]];r&&n.on(t,r)}),["focus","blur"].forEach(function(e){n.on(e,n["on"+e.charAt(0).toUpperCase()+e.slice(1)])});var c=n;return n.root.addEventListener("mousemove",function(){c.onFocus()}),setTimeout(function(){n.emit("ready")},0),e.autoplay&&n.start(),n.config.keyShortcut&&"on"!==n.config.keyShortcut||(document.onkeydown=function(e){var t=e||window.event;t&&37===t.keyCode?(c.onFocus(),c.currentTime-10>=0?c.currentTime-=10:c.currentTime=0):t&&38===t.keyCode?c.volume+.1<=1?c.volume+=.1:c.volume=1:t&&39===t.keyCode?(c.onFocus(),c.currentTime+10<=c.duration?c.currentTime+=10:c.currentTime=c.duration-1):t&&40===t.keyCode?c.volume-.1>=0?c.volume-=.1:c.volume=0:t&&32===t.keyCode&&(c.paused?c.play():c.p
|
||
|
/*!
|
||
|
* Draggabilly v2.2.0
|
||
|
* Make that shiz draggable
|
||
|
* https://draggabilly.desandro.com
|
||
|
* MIT license
|
||
|
*/
|
||
|
!function(o,a){r=[n(39),n(40)],void 0===(i=function(e,t){return function(e,t,n){function r(e,t){for(var n in t)e[n]=t[n];return e}var i=e.jQuery;function o(e,t){this.element="string"==typeof e?document.querySelector(e):e,i&&(this.$element=i(this.element)),this.options=r({},this.constructor.defaults),this.option(t),this._create()}var a=o.prototype=Object.create(n.prototype);o.defaults={},a.option=function(e){r(this.options,e)};var s={relative:!0,absolute:!0,fixed:!0};function l(e,t,n){return n=n||"round",t?Math[n](e/t)*t:e}a._create=function(){this.position={},this._getPosition(),this.startPoint={x:0,y:0},this.dragPoint={x:0,y:0},this.startPosition=r({},this.position);var e=getComputedStyle(this.element);s[e.position]||(this.element.style.position="relative"),this.on("pointerDown",this.onPointerDown),this.on("pointerMove",this.onPointerMove),this.on("pointerUp",this.onPointerUp),this.enable(),this.setHandles()},a.setHandles=function(){this.handles=this.options.handle?this.element.querySelectorAll(this.options.handle):[this.element],this.bindHandles()},a.dispatchEvent=function(e,t,n){var r=[t].concat(n);this.emitEvent(e,r),this.dispatchJQueryEvent(e,t,n)},a.dispatchJQueryEvent=function(t,n,r){var i=e.jQuery;if(i&&this.$element){var o=i.Event(n);o.type=t,this.$element.trigger(o,r)}},a._getPosition=function(){var e=getComputedStyle(this.element),t=this._getPositionCoord(e.left,"width"),n=this._getPositionCoord(e.top,"height");this.position.x=isNaN(t)?0:t,this.position.y=isNaN(n)?0:n,this._addTransformPosition(e)},a._getPositionCoord=function(e,n){if(-1!=e.indexOf("%")){var r=t(this.element.parentNode);return r?parseFloat(e)/100*r[n]:0}return parseInt(e,10)},a._addTransformPosition=function(e){var t=e.transform;if(0===t.indexOf("matrix")){var n=t.split(","),r=0===t.indexOf("matrix3d")?12:4,i=parseInt(n[r],10),o=parseInt(n[r+1],10);this.position.x+=i,this.position.y+=o}},a.onPointerDown=function(e,t){this.element.classList.add("is-pointer-down"),this.dispatchJQueryEvent("pointerDown",e,[t])},a.dragStart=function(e,t){this.isEnabled&&(this._getPosition(),this.measureContainment(),this.startPosition.x=this.position.x,this.startPosition.y=this.position.y,this.setLeftTop(),this.dragPoint.x=0,this.dragPoint.y=0,this.element.classList.add("is-dragging"),this.dispatchEvent("dragStart",e,[t]),this.animate())},a.measureContainment=function(){var e=this.getContainer();if(e){var n=t(this.element),r=t(e),i=this.element.getBoundingClientRect(),o=e.getBoundingClientRect(),a=r.borderLeftWidth+r.borderRightWidth,s=r.borderTopWidth+r.borderBottomWidth,l=this.relativeStartPosition={x:i.left-(o.left+r.borderLeftWidth),y:i.top-(o.top+r.borderTopWidth)};this.containSize={width:r.width-a-l.x-n.width,height:r.height-s-l.y-n.height}}},a.getContainer=function(){var e=this.options.containment;if(e)return e instanceof HTMLElement?e:"string"==typeof e?document.querySelector(e):this.element.parentNode},a.onPointerMove=function(e,t,n){this.dispatchJQueryEvent("pointerMove",e,[t,n])},a.dragMove=function(e,t,n){if(this.isEnabled){var r=n.x,i=n.y,o=this.options.grid,a=o&&o[0],s=o&&o[1];r=l(r,a),i=l(i,s),r=this.containDrag("x",r,a),i=this.containDrag("y",i,s),r="y"==this.options.axis?0:r,i="x"==this.options.axis?0:i,this.position.x=this.startPosition.x+r,this.position.y=this.startPosition.y+i,this.dragPoint.x=r,this.dragPoint.y=i,this.dispatchEvent("dragMove",e,[t,n])}},a.containDrag=function(e,t,n){if(!this.options.containment)return t;var r="x"==e?"width":"height",i=l(-this.relativeStartPosition[e],n,"ceil"),o=this.containSize[r];return o=l(o,n,"floor"),Math.max(i,Math.min(o,t))},a.onPointerUp=function(e,t){this.element.classList.remove("is-pointer-down"),this.dispatchJQueryEvent("pointerUp",e,[t])},a.dragEnd=function(e,t){this.isEnabled&&(this.element.style.transform="",this.setLeftTop(),this.element.classList.remove("is-dragging"),this.dispatchEvent("dragEnd",e,[t]))},a.animate=function(){if(this.isDragging){this.positionDrag();var e=this;requestAnimationFrame(function(){e.animate()})}},a.setLeftTop=function(){this.element.style.left=this.position.x+"px",
|
||
|
/*!
|
||
|
* Unidragger v2.3.0
|
||
|
* Draggable base class
|
||
|
* MIT license
|
||
|
*/
|
||
|
!function(o,a){r=[n(41)],void 0===(i=function(e){return function(e,t){function n(){}var r=n.prototype=Object.create(t.prototype);r.bindHandles=function(){this._bindHandles(!0)},r.unbindHandles=function(){this._bindHandles(!1)},r._bindHandles=function(t){for(var n=(t=void 0===t||t)?"addEventListener":"removeEventListener",r=t?this._touchActionValue:"",i=0;i<this.handles.length;i++){var o=this.handles[i];this._bindStartEvent(o,t),o[n]("click",this),e.PointerEvent&&(o.style.touchAction=r)}},r._touchActionValue="none",r.pointerDown=function(e,t){var n=this.okayPointerDown(e);n&&(this.pointerDownPointer=t,e.preventDefault(),this.pointerDownBlur(),this._bindPostStartEvents(e),this.emitEvent("pointerDown",[e,t]))};var i={TEXTAREA:!0,INPUT:!0,SELECT:!0,OPTION:!0},o={radio:!0,checkbox:!0,button:!0,submit:!0,image:!0,file:!0};return r.okayPointerDown=function(e){var t=i[e.target.nodeName],n=o[e.target.type],r=!t||n;return r||this._pointerReset(),r},r.pointerDownBlur=function(){var e=document.activeElement;e&&e.blur&&e!=document.body&&e.blur()},r.pointerMove=function(e,t){var n=this._dragPointerMove(e,t);this.emitEvent("pointerMove",[e,t,n]),this._dragMove(e,t,n)},r._dragPointerMove=function(e,t){var n={x:t.pageX-this.pointerDownPointer.pageX,y:t.pageY-this.pointerDownPointer.pageY};return!this.isDragging&&this.hasDragStarted(n)&&this._dragStart(e,t),n},r.hasDragStarted=function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3},r.pointerUp=function(e,t){this.emitEvent("pointerUp",[e,t]),this._dragPointerUp(e,t)},r._dragPointerUp=function(e,t){this.isDragging?this._dragEnd(e,t):this._staticClick(e,t)},r._dragStart=function(e,t){this.isDragging=!0,this.isPreventingClicks=!0,this.dragStart(e,t)},r.dragStart=function(e,t){this.emitEvent("dragStart",[e,t])},r._dragMove=function(e,t,n){this.isDragging&&this.dragMove(e,t,n)},r.dragMove=function(e,t,n){e.preventDefault(),this.emitEvent("dragMove",[e,t,n])},r._dragEnd=function(e,t){this.isDragging=!1,setTimeout(function(){delete this.isPreventingClicks}.bind(this)),this.dragEnd(e,t)},r.dragEnd=function(e,t){this.emitEvent("dragEnd",[e,t])},r.onclick=function(e){this.isPreventingClicks&&e.preventDefault()},r._staticClick=function(e,t){this.isIgnoringMouseUp&&"mouseup"==e.type||(this.staticClick(e,t),"mouseup"!=e.type&&(this.isIgnoringMouseUp=!0,setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)))},r.staticClick=function(e,t){this.emitEvent("staticClick",[e,t])},n.getPointerPoint=t.getPointerPoint,n}(o,e)}.apply(t,r))||(e.exports=i)}(window)},function(e,t,n){"use strict";var r,i;"function"==typeof Symbol&&Symbol.iterator;
|
||
|
/*!
|
||
|
* Unipointer v2.3.0
|
||
|
* base class for doing one thing with pointer event
|
||
|
* MIT license
|
||
|
*/
|
||
|
!function(o,a){r=[n(42)],void 0===(i=function(e){return function(e,t){function n(){}var r=n.prototype=Object.create(t.prototype);r.bindStartEvent=function(e){this._bindStartEvent(e,!0)},r.unbindStartEvent=function(e){this._bindStartEvent(e,!1)},r._bindStartEvent=function(t,n){var r=(n=void 0===n||n)?"addEventListener":"removeEventListener",i="mousedown";e.PointerEvent?i="pointerdown":"ontouchstart"in e&&(i="touchstart"),t[r](i,this)},r.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},r.getTouch=function(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.identifier==this.pointerIdentifier)return n}},r.onmousedown=function(e){var t=e.button;t&&0!==t&&1!==t||this._pointerDown(e,e)},r.ontouchstart=function(e){this._pointerDown(e,e.changedTouches[0])},r.onpointerdown=function(e){this._pointerDown(e,e)},r._pointerDown=function(e,t){e.button||this.isPointerDown||(this.isPointerDown=!0,this.pointerIdentifier=void 0!==t.pointerId?t.pointerId:t.identifier,this.pointerDown(e,t))},r.pointerDown=function(e,t){this._bindPostStartEvents(e),this.emitEvent("pointerDown",[e,t])};var i={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]};return r._bindPostStartEvents=function(t){if(t){var n=i[t.type];n.forEach(function(t){e.addEventListener(t,this)},this),this._boundPointerEvents=n}},r._unbindPostStartEvents=function(){this._boundPointerEvents&&(this._boundPointerEvents.forEach(function(t){e.removeEventListener(t,this)},this),delete this._boundPointerEvents)},r.onmousemove=function(e){this._pointerMove(e,e)},r.onpointermove=function(e){e.pointerId==this.pointerIdentifier&&this._pointerMove(e,e)},r.ontouchmove=function(e){var t=this.getTouch(e.changedTouches);t&&this._pointerMove(e,t)},r._pointerMove=function(e,t){this.pointerMove(e,t)},r.pointerMove=function(e,t){this.emitEvent("pointerMove",[e,t])},r.onmouseup=function(e){this._pointerUp(e,e)},r.onpointerup=function(e){e.pointerId==this.pointerIdentifier&&this._pointerUp(e,e)},r.ontouchend=function(e){var t=this.getTouch(e.changedTouches);t&&this._pointerUp(e,t)},r._pointerUp=function(e,t){this._pointerDone(),this.pointerUp(e,t)},r.pointerUp=function(e,t){this.emitEvent("pointerUp",[e,t])},r._pointerDone=function(){this._pointerReset(),this._unbindPostStartEvents(),this.pointerDone()},r._pointerReset=function(){this.isPointerDown=!1,delete this.pointerIdentifier},r.pointerDone=function(){},r.onpointercancel=function(e){e.pointerId==this.pointerIdentifier&&this._pointerCancel(e,e)},r.ontouchcancel=function(e){var t=this.getTouch(e.changedTouches);t&&this._pointerCancel(e,t)},r._pointerCancel=function(e,t){this._pointerDone(),this.pointerCancel(e,t)},r.pointerCancel=function(e,t){this.emitEvent("pointerCancel",[e,t])},n.getPointerPoint=function(e){return{x:e.pageX,y:e.pageY}},n}(o,e)}.apply(t,r))||(e.exports=i)}(window)},function(e,t,n){"use strict";var r,i;"function"==typeof Symbol&&Symbol.iterator;"undefined"!=typeof window&&window,void 0===(i="function"==typeof(r=function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var n=this._events=this._events||{},r=n[e]=n[e]||[];return-1==r.indexOf(t)&&r.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var n=this._onceEvents=this._onceEvents||{};return(n[e]=n[e]||{})[t]=!0,this}},t.off=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){var r=n.indexOf(t);return-1!=r&&n.splice(r,1),this}},t.emitEvent=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){n=n.slice(0),t=t||[];for(var r=this._onceEvents&&this._onceEvents[e],i=0;i<n.length;i++){var o=n[i];r&&r[o]&&(this.off(e,o),delete r[o]),o.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e})?r.call(t,n,t,e):r)||(e.exports=i)},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(n(0));r.default.install("pc",function(){var e=this,t=r.default.util,n=e.controls,i=e.root,o=0,a=void 0,s=e.config.centerBtn?e.config.centerBtn:{},l=void 0,u=void 0,c=void 0;if("img"===s.type){if
|
||
|
/**
|
||
|
* request-frame - requestAnimationFrame & cancelAnimationFrame polyfill for optimal cross-browser development.
|
||
|
* @version v1.5.3
|
||
|
* @license MIT
|
||
|
* Copyright Julien Etienne 2015 All Rights Reserved.
|
||
|
*/
|
||
|
!function(a,s){"object"===o(t)&&void 0!==e?e.exports=s():void 0===(i="function"==typeof(r=s)?r.call(t,n,t,e):r)||(e.exports=i)}(0,function(){return function(e){var t,n,r,i=["moz","webkit"],o="AnimationFrame",a="Request"+o,s=window.mozRequestAnimationFrame,l=window.mozCancelAnimationFrame,u=s&&!l,c=0;function p(){var e=window.webkitRequestAnimationFrame,t=window.requestAnimationFrame,n=screen.width<=768,r=!(e&&t),i=!window.performance;return function(e,t,n,r){return!!e&&function(e,t,n){return!(!e&&!t||(console.warn(n),0))}(n,r,t)}(r&&n&&i,"setTimeout is being used as a substitiue for \n requestAnimationFrame due to a bug within iOS 6 builds",e,t)}function d(e){clearTimeout(e)}function f(e){var t=Date.now(),n=Math.max(c+16,t);return setTimeout(function(){e(c=n)},n-t)}function h(){return Array.prototype.filter?(t=window["request"+o]||window[i.filter(function(e){if(void 0!==window[e+a])return e})+a]||f,p()?f:t):f}function g(){var e=[];return Array.prototype.map?(i.map(function(t){return["Cancel","CancelRequest"].map(function(n){e.push(t+n+o)})}),n=window["cancel"+o]||function(e,t){for(var n=void 0;t<e.length;t++)if(window[e[t]]){n=window[e[t]];break}return n}(e,0)||d,p()?d:n):d}switch(Date.now||(Date.now=function(){return(new Date).getTime()}),e){case"request":case"":r=u?f:h();break;case"cancel":r=g();break;case"native":u?(window.requestAnimationFrame=f,window.cancelAnimationFrame=d):(window.requestAnimationFrame=h(),window.cancelAnimationFrame=g());break;default:throw new Error("RequestFrame parameter is not a type.")}return r}})},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(e){return function(e){return!!e&&"object"===(void 0===e?"undefined":r(e))}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===o}(e)}(e)};var o="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function a(e,t){return t&&!0===t.clone&&i(e)?l(function(e){return Array.isArray(e)?[]:{}}(e),e,t):e}function s(e,t,n){var r=e.slice();return t.forEach(function(t,o){void 0===r[o]?r[o]=a(t,n):i(t)?r[o]=l(e[o],t,n):-1===e.indexOf(t)&&r.push(a(t,n))}),r}function l(e,t,n){var r=Array.isArray(t);return r===Array.isArray(e)?r?((n||{arrayMerge:s}).arrayMerge||s)(e,t,n):function(e,t,n){var r={};return i(e)&&Object.keys(e).forEach(function(t){r[t]=a(e[t],n)}),Object.keys(t).forEach(function(o){i(t[o])&&e[o]?r[o]=l(e[o],t[o],n):r[o]=a(t[o],n)}),r}(e,t,n):a(t,n)}l.all=function(e,t){if(!Array.isArray(e)||e.length<2)throw new Error("first argument should be an array with at least two elements");return e.reduce(function(e,n){return l(e,n,t)})};var u=l;e.exports=u},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(n(0));r.default.install("localPreview",function(){var e=this,t=r.default.util,n=t.createDom("xg-preview",'<input type="file">',{},"xgplayer-preview"),i=n.querySelector("input");e.config.preview&&e.config.preview.uploadEl&&(e.config.preview.uploadEl.appendChild(n),i.onchange=function(){e.uploadFile=i.files[0];var n=URL.createObjectURL(e.uploadFile);t.hasClass(e.root,"xgplayer-nostart")?(e.config.url=n,e.start()):(e.src=n,e.play())})})},function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(n(0));r.default.install("loading",function(){var e=r.default.util.createDom("xg-loading",'\n <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewbox="0 0 100 100">\n <path d="M100,50A50,50,0,1,1,50,0"></path>\n </svg>\n ',{},"xgplayer-loading");this.root.appendChild(e),this.once("destroy",function(){e=null})})},function(e,t,n){"use strict";(function(e){return e&&e.__esModule?e:{default:e}})(n(0)).default.install("i18n",function(){var e=this,t={},n=e.constructor.util;t.en={HAVE_NOTHING:"There is no information on whether audio/video is ready",HAVE_METADATA:"audio/video met
|