From b6bf20b61f9d92ce80fddef05be2a9e886f47b57 Mon Sep 17 00:00:00 2001 From: Alan Cordeiro <alamcordeiro@gmail.com> Date: Tue, 29 Oct 2019 21:23:24 -0500 Subject: [PATCH] Clappr -> clappr --- dist/clappr-pip.js | 8 ++++---- dist/clappr-pip.min.js | 2 +- webpack.config.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/clappr-pip.js b/dist/clappr-pip.js index 27719b3..b6762fb 100644 --- a/dist/clappr-pip.js +++ b/dist/clappr-pip.js @@ -1,12 +1,12 @@ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(require("Clappr")); + module.exports = factory(require("clappr")); else if(typeof define === 'function' && define.amd) - define(["Clappr"], factory); + define(["clappr"], factory); else if(typeof exports === 'object') - exports["ClapprPip"] = factory(require("Clappr")); + exports["ClapprPip"] = factory(require("clappr")); else - root["ClapprPip"] = factory(root["Clappr"]); + root["ClapprPip"] = factory(root["clappr"]); })(window, function(__WEBPACK_EXTERNAL_MODULE__2__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache diff --git a/dist/clappr-pip.min.js b/dist/clappr-pip.min.js index 8ef6ebf..8996521 100644 --- a/dist/clappr-pip.min.js +++ b/dist/clappr-pip.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("Clappr")):"function"==typeof define&&define.amd?define(["Clappr"],t):"object"==typeof exports?exports.ClapprPip=t(require("Clappr")):e.ClapprPip=t(e.Clappr)}(window,function(e){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},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=3)}([function(t,n){t.exports=e},function(e,t,n){"use strict";(function(i){Object.defineProperty(t,"__esModule",{value:!0});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},o=function(e){return e&&e.__esModule?e:{default:e}}(n(11));var u=setTimeout;function c(){}function a(e){if(!(this instanceof a))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],d(e,this)}function l(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,a._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var i;try{i=n(e._value)}catch(e){return void s(t.promise,e)}f(t.promise,i)}else(1===e._state?f:s)(t.promise,e._value)})):e._deferreds.push(t)}function f(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"===(void 0===t?"undefined":r(t))||"function"==typeof t)){var n=t.then;if(t instanceof a)return e._state=3,e._value=t,void p(e);if("function"==typeof n)return void d(function(e,t){return function(){e.apply(t,arguments)}}(n,t),e)}e._state=1,e._value=t,p(e)}catch(t){s(e,t)}}function s(e,t){e._state=2,e._value=t,p(e)}function p(e){2===e._state&&0===e._deferreds.length&&a._immediateFn(function(){e._handled||a._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)l(e,e._deferreds[t]);e._deferreds=null}function d(e,t){var n=!1;try{e(function(e){n||(n=!0,f(t,e))},function(e){n||(n=!0,s(t,e))})}catch(e){if(n)return;n=!0,s(t,e)}}a.prototype.catch=function(e){return this.then(null,e)},a.prototype.then=function(e,t){var n=new this.constructor(c);return l(this,new function(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}(e,t,n)),n},a.prototype.finally=o.default,a.all=function(e){return new a(function(t,n){if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var i=Array.prototype.slice.call(e);if(0===i.length)return t([]);var o=i.length;function u(e,c){try{if(c&&("object"===(void 0===c?"undefined":r(c))||"function"==typeof c)){var a=c.then;if("function"==typeof a)return void a.call(c,function(t){u(e,t)},n)}i[e]=c,0==--o&&t(i)}catch(e){n(e)}}for(var c=0;c<i.length;c++)u(c,i[c])})},a.resolve=function(e){return e&&"object"===(void 0===e?"undefined":r(e))&&e.constructor===a?e:new a(function(t){t(e)})},a.reject=function(e){return new a(function(t,n){n(e)})},a.race=function(e){return new a(function(t,n){for(var i=0,r=e.length;i<r;i++)e[i].then(t,n)})},a._immediateFn="function"==typeof i&&function(e){i(e)}||function(e){u(e,0)},a._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},t.default=a,e.exports=t.default}).call(this,n(8).setImmediate)},function(e,t,n){"use strict";var i,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(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":r(window))&&(i=window)}e.exports=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(4)),r=o(n(6));function o(e){return e&&e.__esModule?e:{default:e}}t.default={PipButton:i.default,PipPlugin:r.default,version:"0.2.0"},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0),o=function(e){return e&&e.__esModule?e:{default:e}}(n(5));var u=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=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.bindClick(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.UICorePlugin),i(t,[{key:"name",get:function(){return"pip_button"}},{key:"tagName",get:function(){return"button"}},{key:"pipPlugin",get:function(){return this.core.getPlugin("pip")}},{key:"isPipSupported",get:function(){return this.pipPlugin&&this.pipPlugin.isPictureInPictureSupported()}},{key:"attributes",get:function(){return{class:"media-control-button media-control-icon pip-button"}}}]),i(t,[{key:"bindEvents",value:function(){this.core.ready?this.listenTo(this.core.mediaControl,r.Events.MEDIACONTROL_RENDERED,this.addButtonToMediaControl):this.listenToOnce(this.core,r.Events.CORE_READY,this.bindEvents)}},{key:"bindClick",value:function(){var e=this;this.$el.click(function(){return e.togglePictureInPicture()})}},{key:"togglePictureInPicture",value:function(){this.pipPlugin&&this.pipPlugin.togglePictureInPicture()}},{key:"hide",value:function(){this.$el.hide()}},{key:"show",value:function(){this.$el.show()}},{key:"addButtonToMediaControl",value:function(){this.$el.remove(),this.isPipSupported&&this.core.mediaControl.$(".media-control-button[data-fullscreen]").after(this.el)}},{key:"render",value:function(){this.$el.css({float:"right",height:"100%"}),this.$el.append(o.default),this.$el.find("path[fill=none]").css({fill:"none"})}}]),t}();t.default=u,e.exports=t.default},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"></path><path d="M19 11h-8v6h8v-6zm4 10V3H1v18h22zm-2-1.98H3V4.97h18v14.05z"></path></svg>'},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0),o=c(n(7)),u=c(n(12));function c(e){return e&&e.__esModule?e:{default:e}}var a=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=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.playback&&n._onContainerChanged(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.CorePlugin),i(t,[{key:"name",get:function(){return"pip"}},{key:"playback",get:function(){return this.core.getCurrentPlayback()}},{key:"videoElement",get:function(){return this.playback&&this.playback.el}}]),i(t,[{key:"bindEvents",value:function(){this.listenTo(this.core,r.Events.CORE_ACTIVE_CONTAINER_CHANGED,this._onContainerChanged)}},{key:"getExternalInterface",value:function(){return{isPictureInPictureSupported:this.isPictureInPictureSupported,isPictureInPictureActive:this.isPictureInPictureActive,enterPictureInPicture:this.enterPictureInPicture,exitPictureInPicture:this.exitPictureInPicture,togglePictureInPicture:this.togglePictureInPicture}}},{key:"isPictureInPictureSupported",value:function(){return this._pip&&this._pip.isSupported}},{key:"isPictureInPictureActive",value:function(){return this._pip&&this._pip.isActive}},{key:"enterPictureInPicture",value:function(){return this._pip&&this._pip.enterPictureInPicture()}},{key:"exitPictureInPicture",value:function(){return this._pip&&this._pip.exitPictureInPicture()}},{key:"togglePictureInPicture",value:function(){return this._pip&&this._pip.togglePictureInPicture()}},{key:"_onContainerChanged",value:function(){this._pip=r.Browser.isSafari?new o.default(this.videoElement):new u.default(this.videoElement)}}]),t}();t.default=a,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function(e){return e&&e.__esModule?e:{default:e}}(n(1));var o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._el=t}return i(e,[{key:"isActive",get:function(){return"picture-in-picture"===this._el.webkitPresentationMode}},{key:"isSupported",get:function(){return this._el&&this._el.webkitSupportsPresentationMode&&"function"==typeof this._el.webkitSetPresentationMode}}]),i(e,[{key:"enterPictureInPicture",value:function(){var e=this;return new r.default(function(t,n){e.isSupported?t(e._el.webkitSetPresentationMode("picture-in-picture")):n("Picture in picture not supported")})}},{key:"exitPictureInPicture",value:function(){var e=this;return new r.default(function(t,n){e.isSupported?t(e._el.webkitSetPresentationMode("inline")):n("Picture in picture not supported")})}},{key:"togglePictureInPicture",value:function(){return this.isActive?this.exitPictureInPicture():this.enterPictureInPicture()}}]),e}();t.default=o,e.exports=t.default},function(e,t,n){"use strict";(function(e){var i=void 0!==e&&e||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(r.call(setTimeout,i,arguments),clearTimeout)},t.setInterval=function(){return new o(r.call(setInterval,i,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(i,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(9),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||void 0,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||void 0}).call(this,n(2))},function(e,t,n){"use strict";(function(e,t){!function(e,n){if(!e.setImmediate){var i,r=1,o={},u=!1,c=e.document,a=Object.getPrototypeOf&&Object.getPrototypeOf(e);a=a&&a.setTimeout?a:e,"[object process]"==={}.toString.call(e.process)?i=function(e){t.nextTick(function(){f(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?function(){var t="setImmediate$"+Math.random()+"$",n=function(n){n.source===e&&"string"==typeof n.data&&0===n.data.indexOf(t)&&f(+n.data.slice(t.length))};e.addEventListener?e.addEventListener("message",n,!1):e.attachEvent("onmessage",n),i=function(n){e.postMessage(t+n,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){f(e.data)},i=function(t){e.port2.postMessage(t)}}():c&&"onreadystatechange"in c.createElement("script")?function(){var e=c.documentElement;i=function(t){var n=c.createElement("script");n.onreadystatechange=function(){f(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():i=function(e){setTimeout(f,0,e)},a.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var u={callback:e,args:t};return o[r]=u,i(r),r++},a.clearImmediate=l}function l(e){delete o[e]}function f(e){if(u)setTimeout(f,0,e);else{var t=o[e];if(t){u=!0;try{!function(e){var t=e.callback,i=e.args;switch(i.length){case 0:t();break;case 1:t(i[0]);break;case 2:t(i[0],i[1]);break;case 3:t(i[0],i[1],i[2]);break;default:t.apply(n,i)}}(t)}finally{l(e),u=!1}}}}}("undefined"==typeof self?void 0===e?void 0:e:self)}).call(this,n(2),n(10))},function(e,t,n){"use strict";var i,r,o=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function a(e){if(i===setTimeout)return setTimeout(e,0);if((i===u||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:u}catch(e){i=u}try{r="function"==typeof clearTimeout?clearTimeout:c}catch(e){r=c}}();var l,f=[],s=!1,p=-1;function d(){s&&l&&(s=!1,l.length?f=l.concat(f):p=-1,f.length&&h())}function h(){if(!s){var e=a(d);s=!0;for(var t=f.length;t;){for(l=f,f=[];++p<t;)l&&l[p].run();p=-1,t=f.length}l=null,s=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===c||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function y(e,t){this.fun=e,this.array=t}function v(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];f.push(new y(e,t)),1!==f.length||s||a(h)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function(e){return e&&e.__esModule?e:{default:e}}(n(1));var o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._el=t}return i(e,[{key:"isActive",get:function(){return document.pictureInPictureElement===this._el}},{key:"isSupported",get:function(){return"pictureInPictureEnabled"in document&&this._el&&!this._el.disablePictureInPicture&&"function"==typeof this._el.requestPictureInPicture}}]),i(e,[{key:"enterPictureInPicture",value:function(){var e=this;return new r.default(function(t,n){e.isSupported?t(e._el.requestPictureInPicture()):n("Picture in picture not supported")})}},{key:"exitPictureInPicture",value:function(){var e=this;return new r.default(function(t,n){e.isSupported?t(document.exitPictureInPicture()):n("Picture in picture not supported")})}},{key:"togglePictureInPicture",value:function(){return this.isActive?this.exitPictureInPicture():this.enterPictureInPicture()}}]),e}();t.default=o,e.exports=t.default}])}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("clappr")):"function"==typeof define&&define.amd?define(["clappr"],t):"object"==typeof exports?exports.ClapprPip=t(require("clappr")):e.ClapprPip=t(e.Clappr)}(window,function(e){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},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=3)}([function(t,n){t.exports=e},function(e,t,n){"use strict";(function(i){Object.defineProperty(t,"__esModule",{value:!0});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},o=function(e){return e&&e.__esModule?e:{default:e}}(n(11));var u=setTimeout;function c(){}function a(e){if(!(this instanceof a))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],d(e,this)}function l(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,a._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var i;try{i=n(e._value)}catch(e){return void s(t.promise,e)}f(t.promise,i)}else(1===e._state?f:s)(t.promise,e._value)})):e._deferreds.push(t)}function f(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"===(void 0===t?"undefined":r(t))||"function"==typeof t)){var n=t.then;if(t instanceof a)return e._state=3,e._value=t,void p(e);if("function"==typeof n)return void d(function(e,t){return function(){e.apply(t,arguments)}}(n,t),e)}e._state=1,e._value=t,p(e)}catch(t){s(e,t)}}function s(e,t){e._state=2,e._value=t,p(e)}function p(e){2===e._state&&0===e._deferreds.length&&a._immediateFn(function(){e._handled||a._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)l(e,e._deferreds[t]);e._deferreds=null}function d(e,t){var n=!1;try{e(function(e){n||(n=!0,f(t,e))},function(e){n||(n=!0,s(t,e))})}catch(e){if(n)return;n=!0,s(t,e)}}a.prototype.catch=function(e){return this.then(null,e)},a.prototype.then=function(e,t){var n=new this.constructor(c);return l(this,new function(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}(e,t,n)),n},a.prototype.finally=o.default,a.all=function(e){return new a(function(t,n){if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var i=Array.prototype.slice.call(e);if(0===i.length)return t([]);var o=i.length;function u(e,c){try{if(c&&("object"===(void 0===c?"undefined":r(c))||"function"==typeof c)){var a=c.then;if("function"==typeof a)return void a.call(c,function(t){u(e,t)},n)}i[e]=c,0==--o&&t(i)}catch(e){n(e)}}for(var c=0;c<i.length;c++)u(c,i[c])})},a.resolve=function(e){return e&&"object"===(void 0===e?"undefined":r(e))&&e.constructor===a?e:new a(function(t){t(e)})},a.reject=function(e){return new a(function(t,n){n(e)})},a.race=function(e){return new a(function(t,n){for(var i=0,r=e.length;i<r;i++)e[i].then(t,n)})},a._immediateFn="function"==typeof i&&function(e){i(e)}||function(e){u(e,0)},a._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},t.default=a,e.exports=t.default}).call(this,n(8).setImmediate)},function(e,t,n){"use strict";var i,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(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":r(window))&&(i=window)}e.exports=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(4)),r=o(n(6));function o(e){return e&&e.__esModule?e:{default:e}}t.default={PipButton:i.default,PipPlugin:r.default,version:"0.2.0"},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0),o=function(e){return e&&e.__esModule?e:{default:e}}(n(5));var u=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=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.bindClick(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.UICorePlugin),i(t,[{key:"name",get:function(){return"pip_button"}},{key:"tagName",get:function(){return"button"}},{key:"pipPlugin",get:function(){return this.core.getPlugin("pip")}},{key:"isPipSupported",get:function(){return this.pipPlugin&&this.pipPlugin.isPictureInPictureSupported()}},{key:"attributes",get:function(){return{class:"media-control-button media-control-icon pip-button"}}}]),i(t,[{key:"bindEvents",value:function(){this.core.ready?this.listenTo(this.core.mediaControl,r.Events.MEDIACONTROL_RENDERED,this.addButtonToMediaControl):this.listenToOnce(this.core,r.Events.CORE_READY,this.bindEvents)}},{key:"bindClick",value:function(){var e=this;this.$el.click(function(){return e.togglePictureInPicture()})}},{key:"togglePictureInPicture",value:function(){this.pipPlugin&&this.pipPlugin.togglePictureInPicture()}},{key:"hide",value:function(){this.$el.hide()}},{key:"show",value:function(){this.$el.show()}},{key:"addButtonToMediaControl",value:function(){this.$el.remove(),this.isPipSupported&&this.core.mediaControl.$(".media-control-button[data-fullscreen]").after(this.el)}},{key:"render",value:function(){this.$el.css({float:"right",height:"100%"}),this.$el.append(o.default),this.$el.find("path[fill=none]").css({fill:"none"})}}]),t}();t.default=u,e.exports=t.default},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"></path><path d="M19 11h-8v6h8v-6zm4 10V3H1v18h22zm-2-1.98H3V4.97h18v14.05z"></path></svg>'},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0),o=c(n(7)),u=c(n(12));function c(e){return e&&e.__esModule?e:{default:e}}var a=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=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.playback&&n._onContainerChanged(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,r.CorePlugin),i(t,[{key:"name",get:function(){return"pip"}},{key:"playback",get:function(){return this.core.getCurrentPlayback()}},{key:"videoElement",get:function(){return this.playback&&this.playback.el}}]),i(t,[{key:"bindEvents",value:function(){this.listenTo(this.core,r.Events.CORE_ACTIVE_CONTAINER_CHANGED,this._onContainerChanged)}},{key:"getExternalInterface",value:function(){return{isPictureInPictureSupported:this.isPictureInPictureSupported,isPictureInPictureActive:this.isPictureInPictureActive,enterPictureInPicture:this.enterPictureInPicture,exitPictureInPicture:this.exitPictureInPicture,togglePictureInPicture:this.togglePictureInPicture}}},{key:"isPictureInPictureSupported",value:function(){return this._pip&&this._pip.isSupported}},{key:"isPictureInPictureActive",value:function(){return this._pip&&this._pip.isActive}},{key:"enterPictureInPicture",value:function(){return this._pip&&this._pip.enterPictureInPicture()}},{key:"exitPictureInPicture",value:function(){return this._pip&&this._pip.exitPictureInPicture()}},{key:"togglePictureInPicture",value:function(){return this._pip&&this._pip.togglePictureInPicture()}},{key:"_onContainerChanged",value:function(){this._pip=r.Browser.isSafari?new o.default(this.videoElement):new u.default(this.videoElement)}}]),t}();t.default=a,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function(e){return e&&e.__esModule?e:{default:e}}(n(1));var o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._el=t}return i(e,[{key:"isActive",get:function(){return"picture-in-picture"===this._el.webkitPresentationMode}},{key:"isSupported",get:function(){return this._el&&this._el.webkitSupportsPresentationMode&&"function"==typeof this._el.webkitSetPresentationMode}}]),i(e,[{key:"enterPictureInPicture",value:function(){var e=this;return new r.default(function(t,n){e.isSupported?t(e._el.webkitSetPresentationMode("picture-in-picture")):n("Picture in picture not supported")})}},{key:"exitPictureInPicture",value:function(){var e=this;return new r.default(function(t,n){e.isSupported?t(e._el.webkitSetPresentationMode("inline")):n("Picture in picture not supported")})}},{key:"togglePictureInPicture",value:function(){return this.isActive?this.exitPictureInPicture():this.enterPictureInPicture()}}]),e}();t.default=o,e.exports=t.default},function(e,t,n){"use strict";(function(e){var i=void 0!==e&&e||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(r.call(setTimeout,i,arguments),clearTimeout)},t.setInterval=function(){return new o(r.call(setInterval,i,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(i,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(9),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||void 0,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||void 0}).call(this,n(2))},function(e,t,n){"use strict";(function(e,t){!function(e,n){if(!e.setImmediate){var i,r=1,o={},u=!1,c=e.document,a=Object.getPrototypeOf&&Object.getPrototypeOf(e);a=a&&a.setTimeout?a:e,"[object process]"==={}.toString.call(e.process)?i=function(e){t.nextTick(function(){f(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?function(){var t="setImmediate$"+Math.random()+"$",n=function(n){n.source===e&&"string"==typeof n.data&&0===n.data.indexOf(t)&&f(+n.data.slice(t.length))};e.addEventListener?e.addEventListener("message",n,!1):e.attachEvent("onmessage",n),i=function(n){e.postMessage(t+n,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){f(e.data)},i=function(t){e.port2.postMessage(t)}}():c&&"onreadystatechange"in c.createElement("script")?function(){var e=c.documentElement;i=function(t){var n=c.createElement("script");n.onreadystatechange=function(){f(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():i=function(e){setTimeout(f,0,e)},a.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var u={callback:e,args:t};return o[r]=u,i(r),r++},a.clearImmediate=l}function l(e){delete o[e]}function f(e){if(u)setTimeout(f,0,e);else{var t=o[e];if(t){u=!0;try{!function(e){var t=e.callback,i=e.args;switch(i.length){case 0:t();break;case 1:t(i[0]);break;case 2:t(i[0],i[1]);break;case 3:t(i[0],i[1],i[2]);break;default:t.apply(n,i)}}(t)}finally{l(e),u=!1}}}}}("undefined"==typeof self?void 0===e?void 0:e:self)}).call(this,n(2),n(10))},function(e,t,n){"use strict";var i,r,o=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function a(e){if(i===setTimeout)return setTimeout(e,0);if((i===u||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:u}catch(e){i=u}try{r="function"==typeof clearTimeout?clearTimeout:c}catch(e){r=c}}();var l,f=[],s=!1,p=-1;function d(){s&&l&&(s=!1,l.length?f=l.concat(f):p=-1,f.length&&h())}function h(){if(!s){var e=a(d);s=!0;for(var t=f.length;t;){for(l=f,f=[];++p<t;)l&&l[p].run();p=-1,t=f.length}l=null,s=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===c||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function y(e,t){this.fun=e,this.array=t}function v(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];f.push(new y(e,t)),1!==f.length||s||a(h)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=function(e){return e&&e.__esModule?e:{default:e}}(n(1));var o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._el=t}return i(e,[{key:"isActive",get:function(){return document.pictureInPictureElement===this._el}},{key:"isSupported",get:function(){return"pictureInPictureEnabled"in document&&this._el&&!this._el.disablePictureInPicture&&"function"==typeof this._el.requestPictureInPicture}}]),i(e,[{key:"enterPictureInPicture",value:function(){var e=this;return new r.default(function(t,n){e.isSupported?t(e._el.requestPictureInPicture()):n("Picture in picture not supported")})}},{key:"exitPictureInPicture",value:function(){var e=this;return new r.default(function(t,n){e.isSupported?t(document.exitPictureInPicture()):n("Picture in picture not supported")})}},{key:"togglePictureInPicture",value:function(){return this.isActive?this.exitPictureInPicture():this.enterPictureInPicture()}}]),e}();t.default=o,e.exports=t.default}])}); \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index 55bfe55..afcfb44 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -17,7 +17,7 @@ module.exports = (env, argv) => { entry: path.resolve(__dirname, 'src/index.js'), plugins: plugins, externals: { - clappr: 'Clappr' + clappr: 'clappr' }, module: { rules: [