diff --git a/dist/artplayer-plugin-playlist.js b/dist/artplayer-plugin-playlist.js index fecbb1476..0576e60d2 100644 --- a/dist/artplayer-plugin-playlist.js +++ b/dist/artplayer-plugin-playlist.js @@ -5,4 +5,4 @@ * Released under the MIT License. */ -!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t=t||self)["artplayer-plugin-playlist"]=n()}(this,function(){"use strict";function t(t){var n=t.constructor.utils,e=n.append,i=n.errorHandle,r=t.player,l=t.events.proxy,a=t.template,o=a.$player,s=a.$video,u=e(o,'\n
".concat(t,"
")}).join("")}i.art.emit("subtitle:update",s)})}})}},{key:"load",value:function(e){var n,i=this.art.notice;return fetch(e).then(function(t){return n=t.headers.get("Content-Type"),t.text()}).then(function(t){return/x-subrip/gi.test(n)?W(D(t)):e}).catch(function(t){i.show(t),console.warn(t)})}},{key:"show",value:function(){var t=this.art,e=t.template.$subtitle,n=t.i18n,i=t.notice;_(e,"display","block"),this.state=!0,i.show(n.get("Show subtitle")),this.art.emit("subtitle:show",e)}},{key:"hide",value:function(){var t=this.art,e=t.template.$subtitle,n=t.i18n,i=t.notice;_(e,"display","none"),this.state=!1,i.show(n.get("Hide subtitle")),this.art.emit("subtitle:hide",e)}},{key:"toggle",value:function(){this.state?this.hide():this.show()}}]),n}();var mt=e(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});e.ContentRect=function(t){if("getBBox"in t){var e=t.getBBox();return Object.freeze({height:e.height,left:0,top:0,width:e.width})}var n=window.getComputedStyle(t);return Object.freeze({height:parseFloat(n.height||"0"),left:parseFloat(n.paddingLeft||"0"),top:parseFloat(n.paddingTop||"0"),width:parseFloat(n.width||"0")})}});t(mt);mt.ContentRect;var gt=e(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.target=t,this.$$broadcastWidth=this.$$broadcastHeight=0}return Object.defineProperty(t.prototype,"broadcastWidth",{get:function(){return this.$$broadcastWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"broadcastHeight",{get:function(){return this.$$broadcastHeight},enumerable:!0,configurable:!0}),t.prototype.isActive=function(){var t=mt.ContentRect(this.target);return!!t&&(t.width!==this.broadcastWidth||t.height!==this.broadcastHeight)},t}();e.ResizeObservation=n});t(gt);gt.ResizeObservation;var bt=e(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(t){this.target=t,this.contentRect=mt.ContentRect(t)};e.ResizeObserverEntry=n});t(bt);bt.ResizeObserverEntry;var wt=e(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=[],i=function(){function t(t){this.$$observationTargets=[],this.$$activeTargets=[],this.$$skippedTargets=[];var e=function(t){if(void 0===t)return"Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.";if("function"!=typeof t)return"Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function."}(t);if(e)throw TypeError(e);this.$$callback=t,n.push(this)}return t.prototype.observe=function(t){var e=r("observe",t);if(e)throw TypeError(e);0".concat(t,"
")}).join("")}i.art.emit("subtitle:update",s)})}})}},{key:"load",value:function(e){var n,i=this.art.notice;return fetch(e).then(function(t){return n=t.headers.get("Content-Type"),t.text()}).then(function(t){return/x-subrip/gi.test(n)?W(D(t)):e}).catch(function(t){i.show(t),console.warn(t)})}},{key:"show",value:function(){var t=this.art,e=t.template.$subtitle,n=t.i18n,i=t.notice;_(e,"display","block"),this.state=!0,i.show(n.get("Show subtitle")),this.art.emit("subtitle:show",e)}},{key:"hide",value:function(){var t=this.art,e=t.template.$subtitle,n=t.i18n,i=t.notice;_(e,"display","none"),this.state=!1,i.show(n.get("Hide subtitle")),this.art.emit("subtitle:hide",e)}},{key:"toggle",value:function(){this.state?this.hide():this.show()}}]),n}();var mt=e(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});e.ContentRect=function(t){if("getBBox"in t){var e=t.getBBox();return Object.freeze({height:e.height,left:0,top:0,width:e.width})}var n=window.getComputedStyle(t);return Object.freeze({height:parseFloat(n.height||"0"),left:parseFloat(n.paddingLeft||"0"),top:parseFloat(n.paddingTop||"0"),width:parseFloat(n.width||"0")})}});t(mt);mt.ContentRect;var gt=e(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.target=t,this.$$broadcastWidth=this.$$broadcastHeight=0}return Object.defineProperty(t.prototype,"broadcastWidth",{get:function(){return this.$$broadcastWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"broadcastHeight",{get:function(){return this.$$broadcastHeight},enumerable:!0,configurable:!0}),t.prototype.isActive=function(){var t=mt.ContentRect(this.target);return!!t&&(t.width!==this.broadcastWidth||t.height!==this.broadcastHeight)},t}();e.ResizeObservation=n});t(gt);gt.ResizeObservation;var bt=e(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(t){this.target=t,this.contentRect=mt.ContentRect(t)};e.ResizeObserverEntry=n});t(bt);bt.ResizeObserverEntry;var wt=e(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=[],i=function(){function t(t){this.$$observationTargets=[],this.$$activeTargets=[],this.$$skippedTargets=[];var e=function(t){if(void 0===t)return"Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.";if("function"!=typeof t)return"Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function."}(t);if(e)throw TypeError(e);this.$$callback=t,n.push(this)}return t.prototype.observe=function(t){var e=r("observe",t);if(e)throw TypeError(e);0".concat(t,"
")}).join("")}i.art.emit("subtitle:update",s)})}})}},{key:"load",value:function(e){var n,i=this.art.notice;return fetch(e).then(function(t){return n=t.headers.get("Content-Type"),t.text()}).then(function(t){return/x-subrip/gi.test(n)?W(D(t)):e}).catch(function(t){i.show(t),console.warn(t)})}},{key:"show",value:function(){var t=this.art,e=t.template.$subtitle,n=t.i18n,i=t.notice;_(e,"display","block"),this.state=!0,i.show(n.get("Show subtitle")),this.art.emit("subtitle:show",e)}},{key:"hide",value:function(){var t=this.art,e=t.template.$subtitle,n=t.i18n,i=t.notice;_(e,"display","none"),this.state=!1,i.show(n.get("Hide subtitle")),this.art.emit("subtitle:hide",e)}},{key:"toggle",value:function(){this.state?this.hide():this.show()}}]),n}();var mt=e(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});e.ContentRect=function(t){if("getBBox"in t){var e=t.getBBox();return Object.freeze({height:e.height,left:0,top:0,width:e.width})}var n=window.getComputedStyle(t);return Object.freeze({height:parseFloat(n.height||"0"),left:parseFloat(n.paddingLeft||"0"),top:parseFloat(n.paddingTop||"0"),width:parseFloat(n.width||"0")})}});t(mt);mt.ContentRect;var gt=e(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.target=t,this.$$broadcastWidth=this.$$broadcastHeight=0}return Object.defineProperty(t.prototype,"broadcastWidth",{get:function(){return this.$$broadcastWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"broadcastHeight",{get:function(){return this.$$broadcastHeight},enumerable:!0,configurable:!0}),t.prototype.isActive=function(){var t=mt.ContentRect(this.target);return!!t&&(t.width!==this.broadcastWidth||t.height!==this.broadcastHeight)},t}();e.ResizeObservation=n});t(gt);gt.ResizeObservation;var bt=e(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(t){this.target=t,this.contentRect=mt.ContentRect(t)};e.ResizeObserverEntry=n});t(bt);bt.ResizeObserverEntry;var wt=e(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=[],i=function(){function t(t){this.$$observationTargets=[],this.$$activeTargets=[],this.$$skippedTargets=[];var e=function(t){if(void 0===t)return"Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.";if("function"!=typeof t)return"Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function."}(t);if(e)throw TypeError(e);this.$$callback=t,n.push(this)}return t.prototype.observe=function(t){var e=r("observe",t);if(e)throw TypeError(e);0".concat(t,"
")}).join("")}i.art.emit("subtitle:update",s)})}})}},{key:"load",value:function(e){var n,i=this.art.notice;return fetch(e).then(function(t){return n=t.headers.get("Content-Type"),t.text()}).then(function(t){return/x-subrip/gi.test(n)?W(D(t)):e}).catch(function(t){i.show(t),console.warn(t)})}},{key:"show",value:function(){var t=this.art,e=t.template.$subtitle,n=t.i18n,i=t.notice;_(e,"display","block"),this.state=!0,i.show(n.get("Show subtitle")),this.art.emit("subtitle:show",e)}},{key:"hide",value:function(){var t=this.art,e=t.template.$subtitle,n=t.i18n,i=t.notice;_(e,"display","none"),this.state=!1,i.show(n.get("Hide subtitle")),this.art.emit("subtitle:hide",e)}},{key:"toggle",value:function(){this.state?this.hide():this.show()}}]),n}();var mt=e(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});e.ContentRect=function(t){if("getBBox"in t){var e=t.getBBox();return Object.freeze({height:e.height,left:0,top:0,width:e.width})}var n=window.getComputedStyle(t);return Object.freeze({height:parseFloat(n.height||"0"),left:parseFloat(n.paddingLeft||"0"),top:parseFloat(n.paddingTop||"0"),width:parseFloat(n.width||"0")})}});t(mt);mt.ContentRect;var gt=e(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.target=t,this.$$broadcastWidth=this.$$broadcastHeight=0}return Object.defineProperty(t.prototype,"broadcastWidth",{get:function(){return this.$$broadcastWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"broadcastHeight",{get:function(){return this.$$broadcastHeight},enumerable:!0,configurable:!0}),t.prototype.isActive=function(){var t=mt.ContentRect(this.target);return!!t&&(t.width!==this.broadcastWidth||t.height!==this.broadcastHeight)},t}();e.ResizeObservation=n});t(gt);gt.ResizeObservation;var bt=e(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(t){this.target=t,this.contentRect=mt.ContentRect(t)};e.ResizeObserverEntry=n});t(bt);bt.ResizeObserverEntry;var wt=e(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=[],i=function(){function t(t){this.$$observationTargets=[],this.$$activeTargets=[],this.$$skippedTargets=[];var e=function(t){if(void 0===t)return"Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.";if("function"!=typeof t)return"Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function."}(t);if(e)throw TypeError(e);this.$$callback=t,n.push(this)}return t.prototype.observe=function(t){var e=r("observe",t);if(e)throw TypeError(e);0