@gumlet/player.js 2.0.7 → 2.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Player.js
2
2
  =========
3
3
 
4
+ [![](https://data.jsdelivr.com/v1/package/npm/@gumlet/player.js/badge)](https://www.jsdelivr.com/package/npm/@gumlet/player.js)
5
+ [![](https://img.shields.io/npm/v/@gumlet/player.js.svg
6
+ )](https://www.npmjs.com/package/@gumlet/player.js)
7
+
8
+
4
9
  A JavaScript library for interacting with iframes that support Player.js
5
10
  spec.
6
11
 
@@ -0,0 +1 @@
1
+ {"name":"@gumlet/player.js","version":"2.0.10","description":"Gumlet Player.JS allows you to control gumlet player from your website","license":"MIT","repository":{"type":"git","url":"https://github.com/gumlet/player.js"},"main":"player.js","readme":"Please visit: https://github.com/gumlet/player.js/blob/main/README.md","author":"Gumlet Pte. Ltd.","homepage":"https://github.com/gumlet/player.js/blob/main/README.md","bugs":{"url":"https://www.gumlet.com/contact/"},"maintainers":[{"name":"Gumlet Team","email":"support@gumlet.com"}]}
@@ -1,2 +1,2 @@
1
- var r={EVENTS:{READY:"ready",PLAY:"play",PAUSE:"pause",ENDED:"ended",TIMEUPDATE:"timeupdate",PROGRESS:"progress",SEEKED:"seeked",ERROR:"error",FULLSCREEN_CHANGE:"fullscreenChange",PIP_CHANGE:"pipChange",PLAYBACK_RATE_CHANGE:"playbackRateChange",AUDIO_CHANGE:"audioChange",QUALITY_CHANGE:"qualityChange",VOLUME_CHANGE:"volumeChange"},POST_MESSAGE:!!window.postMessage,METHODS:{PLAY:"play",PAUSE:"pause",GETPAUSED:"getPaused",MUTE:"mute",UNMUTE:"unmute",GETMUTED:"getMuted",SETVOLUME:"setVolume",GETVOLUME:"getVolume",GETDURATION:"getDuration",SETCURRENTTIME:"setCurrentTime",GETCURRENTTIME:"getCurrentTime",SETLOOP:"setLoop",GETLOOP:"getLoop",SETPLAYBACKRATE:"setPlaybackRate",GETPLAYBACKRATE:"getPlaybackRate",REMOVEEVENTLISTENER:"removeEventListener",ADDEVENTLISTENER:"addEventListener"},DEBUG:!1,VERSION:"2.0",CONTEXT:"player.js",isString:function(o){return Object.prototype.toString.call(o)==="[object String]"},has:function(o,e){return Object.prototype.hasOwnProperty.call(o,e)}};r.METHODS.all=function(){let o=[];for(let e in r.METHODS)r.has(r.METHODS,e)&&r.isString(r.METHODS[e])&&o.push(r.METHODS[e]);return o},r.EVENTS.all=function(){let o=[];for(let e in r.EVENTS)r.has(r.EVENTS,e)&&r.isString(r.EVENTS[e])&&o.push(r.EVENTS[e]);return o},r.addEvent=function(o,e,t){o&&(o.addEventListener?o.addEventListener(e,t,!1):o.attachEvent?o.attachEvent("on"+e,t):o["on"+e]=t)},r.isNone=function(o){return o==null},r.assert=function(o,e){if(!o)throw e||"Player.js Assert Failed"},r.generateUUID=function(){if(crypto&&crypto.randomUUID)return crypto.randomUUID();{let o=URL.createObjectURL(new Blob);return o.substring(o.lastIndexOf("/")+1)}},r.isArray=function(o){return Object.prototype.toString.call(o)==="[object Array]"};var i=r;var h=class{constructor(){this.data={}}has(e,t){if(!Object.hasOwn(this.data,e))return!1;if(i.isNone(t))return!0;let n=this.data[e];for(let s=0;s<n.length;s++)if(n[s].id===t)return!0;return!1}add(e,t,n,s,u){let a={id:e,event:t,cb:n,ctx:s,one:u};this.has(t)?this.data[t].push(a):this.data[t]=[a]}execute(e,t,n,s){if(!this.has(e,t))return!1;let u=[],a=[];for(let l=0;l<this.data[e].length;l++){let c=this.data[e][l];i.isNone(t)||!i.isNone(t)&&c.id===t?(a.push({cb:c.cb,ctx:c.ctx?c.ctx:s,data:n}),c.one===!1&&u.push(c)):u.push(c)}u.length===0?delete this.data[e]:this.data[e]=u;for(let l=0;l<a.length;l++){let c=a[l];c.cb.call(c.ctx,c.data)}}on(e,t,n,s){this.add(e,t,n,s,!1)}one(e,t,n,s){this.add(e,t,n,s,!0)}off(e,t){let n=[];if(!Object.hasOwn(this.data,e))return n;let s=[];for(let u=0;u<this.data[e].length;u++){let a=this.data[e][u];!i.isNone(t)&&a.cb!==t?s.push(a):i.isNone(a.id)||n.push(a.id)}return s.length===0?delete this.data[e]:this.data[e]=s,n}},v=h;var m=[],d=class{constructor(e){let t=this;this.READIED=m,i.isString(e)&&(e=document.getElementById(e)),this.elem=e,i.assert(e.nodeName==="IFRAME",'playerjs.Player constructor requires an Iframe, got "'+e.nodeName+'"'),i.assert(e.src,"playerjs.Player constructor requires a Iframe with a 'src' attribute."),this.origin=new URL(e.src).origin,this.keeper=new v,this.isReady=!1,this.queue=[],this.events=i.EVENTS.all(),this.methods=i.METHODS.all(),i.POST_MESSAGE?i.addEvent(window,"message",function(n){t.receive(n)}):console.error("Post Message is not Available."),m.includes(e.src)?t.loaded=!0:this.elem.onload=function(){t.loaded=!0}}send(e,t,n){if(e.context=i.CONTEXT,e.version=i.VERSION,t){let s=i.generateUUID();e.listener=s,this.keeper.one(s,e.method,t,n)}return!this.isReady&&e.value!=="ready"?(console.debug("Player.queue",e),this.queue.push(e),!1):(console.debug("Player.send",e,this.origin),this.loaded===!0&&this.elem.contentWindow.postMessage(JSON.stringify(e),this.origin),!0)}receive(e){if(console.debug("Player.receive",e),e.origin!==this.origin)return!1;let t;try{t=JSON.parse(e.data)}catch(n){return!1}if(t.context!==i.CONTEXT)return!1;t.event==="ready"&&t.value&&t.value.src===this.elem.src&&this.ready(t),this.keeper.has(t.event,t.listener)&&this.keeper.execute(t.event,t.listener,t.value,this)}ready(e){if(this.isReady===!0)return!1;e.value.events&&(this.events=e.value.events),e.value.methods&&(this.methods=e.value.methods),this.isReady=!0,this.loaded=!0;for(let t=0;t<this.queue.length;t++){let n=this.queue[t];console.debug("Player.dequeue",n),e.event==="ready"&&this.keeper.execute(n.event,n.listener,!0,this),this.send(n)}this.queue=[]}on(e,t,n){let s=i.generateUUID();return e==="ready"?this.keeper.one(s,e,t,n):this.keeper.on(s,e,t,n),this.send({method:"addEventListener",value:e,listener:s}),!0}off(e,t){let n=this.keeper.off(e,t);if(console.debug("Player.off",n),n.length>0){for(let s in n)this.send({method:"removeEventListener",value:e,listener:n[s]});return!0}return!1}supports(e,t){i.assert(["method","event"].includes(e),'evtOrMethod needs to be either "event" or "method" got '+e),t=i.isArray(t)?t:[t];let n=e==="event"?this.events:this.methods;for(let s=0;s<t.length;s++)if(!n.includes(t[s]))return!1;return!0}};function L(o){return function(){let e={method:o},t=Array.prototype.slice.call(arguments);/^get/.test(o)?(i.assert(t.length>0,"Get methods require a callback."),t.unshift(e)):(/^set/.test(o)&&(i.assert(t.length!==0,"Set methods require a value."),e.value=t[0]),t=[e]),this.send.apply(this,t)}}for(let o of i.METHODS.all())Object.hasOwn(d.prototype,o)||(d.prototype[o]=L(o));i.addEvent(window,"message",function(o){let e;try{e=JSON.parse(o.data)}catch(t){return!1}if(e.context!==i.CONTEXT)return!1;e.event==="ready"&&e.value&&e.value.src&&m.push(e.value.src)});var y=d;var p=class{constructor(e,t){let n=this;this.isReady=!1,this.origin=new URL(document.referrer).origin,this.methods={},this.supported={events:e||i.EVENTS.all(),methods:t||i.METHODS.all()},this.eventListeners={},this.reject=!(window.self!==window.top&&i.POST_MESSAGE),this.reject||i.addEvent(window,"message",function(s){n.receive(s)})}receive(e){if(e.origin!==this.origin)return!1;let t={};if(typeof e.data=="object")t=e.data;else try{t=window.JSON.parse(e.data)}catch(s){console.error("JSON Parse Error",s)}if(console.debug("Receiver.receive",e,t),!t.method||t.context!==i.CONTEXT)return!1;if(!i.METHODS.all().includes(t.method))return this.emit("error",{code:2,msg:'Invalid Method "'+t.method+'"'}),!1;let n=i.isNone(t.listener)?null:t.listener;if(t.method==="addEventListener")Object.hasOwn(this.eventListeners,t.value)?this.eventListeners[t.value].includes(n)||this.eventListeners[t.value].push(n):this.eventListeners[t.value]=[n],t.value==="ready"&&this.isReady&&this.ready();else if(t.method==="removeEventListener"){if(Object.hasOwn(this.eventListeners,t.value)){let s=this.eventListeners[t.value].indexOf(n);s>-1&&this.eventListeners[t.value].splice(s,1),this.eventListeners[t.value].length===0&&delete this.eventListeners[t.value]}}else this.get(t.method,t.value,n)}get(e,t,n){let s=this;if(!Object.hasOwn(this.methods,e))return this.emit("error",{code:3,msg:'Method Not Supported"'+e+'"'}),!1;let u=this.methods[e];if(e.substr(0,3)==="get"){let a=function(l){s.send(e,l,n)};u.call(this,a)}else u.call(this,t)}on(e,t){this.methods[e]=t}send(e,t,n){if(console.debug("Receiver.send",e,t,n),this.reject)return console.error("Receiver.send.reject",e,t,n),!1;let s={context:i.CONTEXT,version:i.VERSION,event:e};i.isNone(t)||(s.value=t),i.isNone(n)||(s.listener=n);let u=JSON.stringify(s);window.parent.postMessage(u,this.origin===""?"*":this.origin)}emit(e,t){if(!Object.hasOwn(this.eventListeners,e))return!1;console.debug("Instance.emit",e,t,this.eventListeners[e]);for(let n=0;n<this.eventListeners[e].length;n++){let s=this.eventListeners[e][n];this.send(e,t,s)}return!0}ready(){console.debug("Receiver.ready"),this.isReady=!0;let e={src:window.location.toString(),events:this.supported.events,methods:this.supported.methods};this.emit("ready",e)||this.send("ready",e)}},f=p;var E=class{constructor(){this.init()}init(){let e={duration:20,currentTime:0,interval:null,timeupdate:function(){},volume:100,mute:!1,playing:!1,loop:!1,play:function(){e.interval=setInterval(function(){e.currentTime+=.25,e.timeupdate({seconds:e.currentTime,duration:e.duration})},250),e.playing=!0},pause:function(){clearInterval(e.interval),e.playing=!1}},t=this.receiver=new f;t.on("play",function(){let n=this;e.play(),this.emit("play"),e.timeupdate=function(s){n.emit("timeupdate",s)}}),t.on("pause",function(){e.pause(),this.emit("pause")}),t.on("getPaused",function(n){let s=!e.playing;n(s)}),t.on("getCurrentTime",function(n){n(e.currentTime)}),t.on("setCurrentTime",function(n){e.currentTime=n}),t.on("getDuration",function(n){n(e.duration)}),t.on("getVolume",function(n){n(e.volume)}),t.on("setVolume",function(n){e.volume=n}),t.on("mute",function(){e.mute=!0}),t.on("unmute",function(){e.mute=!1}),t.on("getMuted",function(n){n(e.mute)}),t.on("getLoop",function(n){n(e.loop)}),t.on("setLoop",function(n){e.loop=n}),t.on("setPlaybackRate",function(n){e.playbackRate=n}),t.on("getPlaybackRate",function(n){n(e.playbackRate)})}ready(){this.receiver.ready()}},O=E;var g=class{constructor(e){this.init(e)}init(e){i.assert(e,"VideoJSReceiver requires a player object");let t=this.receiver=new f;e.on("pause",function(){t.emit("pause")}),e.on("play",function(){t.emit("play")}),e.on("timeupdate",function(n){let s=e.currentTime(),u=e.duration();if(!s||!u)return!1;let a={seconds:s,duration:u};t.emit("timeupdate",a)}),e.on("ended",function(){t.emit("ended")}),e.on("error",function(){t.emit("error")}),t.on("play",function(){e.play()}),t.on("pause",function(){e.pause()}),t.on("getPaused",function(n){n(e.paused())}),t.on("getCurrentTime",function(n){n(e.currentTime())}),t.on("setCurrentTime",function(n){e.currentTime(n)}),t.on("getDuration",function(n){n(e.duration())}),t.on("getVolume",function(n){let s=e.volume()*100;n(s)}),t.on("setVolume",function(n){e.volume(n/100)}),t.on("mute",function(){e.volume(0)}),t.on("unmute",function(){e.volume(1)}),t.on("getMuted",function(n){let s=e.volume()===0;n(s)}),t.on("getLoop",function(n){n(e.loop())}),t.on("setLoop",function(n){e.loop(n)}),t.on("setPlaybackRate",function(n){e.playbackRate(n)}),t.on("getPlaybackRate",function(n){n(e.playbackRate())})}ready(){this.receiver.ready()}},S=g;var T=class{constructor(e){this.init(e)}init(e){i.assert(e,"HTML5Adapter requires a video element");let t=this.receiver=new f;e.addEventListener("playing",function(){t.emit("play")}),e.addEventListener("pause",function(){t.emit("pause")}),e.addEventListener("ended",function(){t.emit("ended")}),e.addEventListener("timeupdate",function(){t.emit("timeupdate",{seconds:e.currentTime,duration:e.duration})}),e.addEventListener("progress",function(){t.emit("buffered",{percent:e.buffered.length})}),t.on("play",function(){e.play()}),t.on("pause",function(){e.pause()}),t.on("getPaused",function(n){n(e.paused)}),t.on("getCurrentTime",function(n){n(e.currentTime)}),t.on("setCurrentTime",function(n){e.currentTime=n}),t.on("getDuration",function(n){n(e.duration)}),t.on("getVolume",function(n){let s=e.volume*100;n(s)}),t.on("setVolume",function(n){e.volume=n/100}),t.on("mute",function(){e.muted=!0}),t.on("unmute",function(){e.muted=!1}),t.on("getMuted",function(n){n(e.muted)}),t.on("getLoop",function(n){n(e.loop)}),t.on("setLoop",function(n){e.loop=n}),t.on("setPlaybackRate",function(n){e.playbackRate=n}),t.on("getPlaybackRate",function(n){n(e.playbackRate)})}ready(){this.receiver.ready()}},R=T;var N={Player:y,Receiver:f,MockAdapter:O,VideoJSAdapter:S,HTML5Adapter:R,CONTEXT:i.CONTEXT,VERSION:i.VERSION,METHODS:i.METHODS,addEvent:i.addEvent};typeof window<"u"&&(window.playerjs=N);var K=N;export{K as default};
2
- //# sourceMappingURL=player.min.js.map
1
+ /*! For license information please see player.min.js.LICENSE.txt */
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(self,(function(){return function(){"use strict";var e={d:function(t,n){for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:function(){return p}});const n={EVENTS:{READY:"ready",PLAY:"play",PAUSE:"pause",ENDED:"ended",TIMEUPDATE:"timeupdate",PROGRESS:"progress",SEEKED:"seeked",ERROR:"error",FULLSCREEN_CHANGE:"fullscreenChange",PIP_CHANGE:"pipChange",PLAYBACK_RATE_CHANGE:"playbackRateChange",AUDIO_CHANGE:"audioChange",QUALITY_CHANGE:"qualityChange",VOLUME_CHANGE:"volumeChange"},POST_MESSAGE:!!window.postMessage,METHODS:{PLAY:"play",PAUSE:"pause",GETPAUSED:"getPaused",MUTE:"mute",UNMUTE:"unmute",GETMUTED:"getMuted",SETVOLUME:"setVolume",GETVOLUME:"getVolume",GETDURATION:"getDuration",SETCURRENTTIME:"setCurrentTime",GETCURRENTTIME:"getCurrentTime",SETLOOP:"setLoop",GETLOOP:"getLoop",SETPLAYBACKRATE:"setPlaybackRate",GETPLAYBACKRATE:"getPlaybackRate",REMOVEEVENTLISTENER:"removeEventListener",ADDEVENTLISTENER:"addEventListener"},DEBUG:!1,VERSION:"2.0",CONTEXT:"player.js",isString:function(e){return"[object String]"===Object.prototype.toString.call(e)},has:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}};n.METHODS.all=function(){const e=[];for(const t in n.METHODS)n.has(n.METHODS,t)&&n.isString(n.METHODS[t])&&e.push(n.METHODS[t]);return e},n.EVENTS.all=function(){const e=[];for(const t in n.EVENTS)n.has(n.EVENTS,t)&&n.isString(n.EVENTS[t])&&e.push(n.EVENTS[t]);return e},n.addEvent=function(e,t,n){e&&(e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n)},n.isNone=function(e){return null==e},n.assert=function(e,t){if(!e)throw t||"Player.js Assert Failed"},n.generateUUID=function(){if(crypto&&crypto.randomUUID)return crypto.randomUUID();{const e=URL.createObjectURL(new Blob);return e.substring(e.lastIndexOf("/")+1)}},n.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)};var i=n;var o=class{constructor(){this.data={}}has(e,t){if(!Object.hasOwn(this.data,e))return!1;if(i.isNone(t))return!0;const n=this.data[e];for(let e=0;e<n.length;e++)if(n[e].id===t)return!0;return!1}add(e,t,n,i,o){const s={id:e,event:t,cb:n,ctx:i,one:o};this.has(t)?this.data[t].push(s):this.data[t]=[s]}execute(e,t,n,o){if(!this.has(e,t))return!1;const s=[],r=[];for(let a=0;a<this.data[e].length;a++){const u=this.data[e][a];i.isNone(t)||!i.isNone(t)&&u.id===t?(r.push({cb:u.cb,ctx:u.ctx?u.ctx:o,data:n}),!1===u.one&&s.push(u)):s.push(u)}0===s.length?delete this.data[e]:this.data[e]=s;for(let e=0;e<r.length;e++){const t=r[e];t.cb.call(t.ctx,t.data)}}on(e,t,n,i){this.add(e,t,n,i,!1)}one(e,t,n,i){this.add(e,t,n,i,!0)}off(e,t){const n=[];if(!Object.hasOwn(this.data,e))return n;const o=[];for(let s=0;s<this.data[e].length;s++){const r=this.data[e][s];i.isNone(t)||r.cb===t?i.isNone(r.id)||n.push(r.id):o.push(r)}return 0===o.length?delete this.data[e]:this.data[e]=o,n}};const s=[];class r{constructor(e,t=!1){const n=this;this.READIED=s,i.isString(e)&&(e=document.getElementById(e)),this.elem=e,this.debug=t,i.assert("IFRAME"===e.nodeName,'playerjs.Player constructor requires an Iframe, got "'+e.nodeName+'"'),i.assert(e.src,"playerjs.Player constructor requires a Iframe with a 'src' attribute."),this.origin=new URL(e.src).origin,this.keeper=new o,this.isReady=!1,this.queue=[],this.events=i.EVENTS.all(),this.methods=i.METHODS.all(),i.POST_MESSAGE?i.addEvent(window,"message",(function(e){n.receive(e)})):console.error("Post Message is not Available."),s.includes(e.src)?n.loaded=!0:this.elem.onload=function(){n.loaded=!0}}send(e,t,n){if(e.context=i.CONTEXT,e.version=i.VERSION,t){const o=i.generateUUID();e.listener=o,this.keeper.one(o,e.method,t,n)}return this.isReady||"ready"===e.value?(this.debug&&console.debug("Player.send",e,this.origin),!0===this.loaded&&this.elem.contentWindow.postMessage(JSON.stringify(e),this.origin),!0):(this.debug&&console.debug("Player.queue",e),this.queue.push(e),!1)}receive(e){if(this.debug&&console.debug("Player.receive",e),e.origin!==this.origin)return!1;let t;try{t=JSON.parse(e.data)}catch(e){return!1}if(t.context!==i.CONTEXT)return!1;"ready"===t.event&&t.value&&t.value.src===this.elem.src&&this.ready(t),this.keeper.has(t.event,t.listener)&&this.keeper.execute(t.event,t.listener,t.value,this)}ready(e){if(!0===this.isReady)return!1;e.value.events&&(this.events=e.value.events),e.value.methods&&(this.methods=e.value.methods),this.isReady=!0,this.loaded=!0;for(let t=0;t<this.queue.length;t++){const n=this.queue[t];this.debug&&console.debug("Player.dequeue",n),"ready"===e.event&&this.keeper.execute(n.event,n.listener,!0,this),this.send(n)}this.queue=[]}on(e,t,n){const o=i.generateUUID();return"ready"===e?this.keeper.one(o,e,t,n):this.keeper.on(o,e,t,n),this.send({method:"addEventListener",value:e,listener:o}),!0}off(e,t){const n=this.keeper.off(e,t);if(this.debug&&console.debug("Player.off",n),n.length>0){for(const t in n)this.send({method:"removeEventListener",value:e,listener:n[t]});return!0}return!1}supports(e,t){i.assert(["method","event"].includes(e),'evtOrMethod needs to be either "event" or "method" got '+e),t=i.isArray(t)?t:[t];const n="event"===e?this.events:this.methods;for(let e=0;e<t.length;e++)if(!n.includes(t[e]))return!1;return!0}}function a(e){return function(){const t={method:e};let n=Array.prototype.slice.call(arguments);/^get/.test(e)?(i.assert(n.length>0,"Get methods require a callback."),n.unshift(t)):(/^set/.test(e)&&(i.assert(0!==n.length,"Set methods require a value."),t.value=n[0]),n=[t]),this.send.apply(this,n)}}for(const e of i.METHODS.all())Object.hasOwn(r.prototype,e)||(r.prototype[e]=a(e));i.addEvent(window,"message",(function(e){let t;try{t=JSON.parse(e.data)}catch(e){return!1}if(t.context!==i.CONTEXT)return!1;"ready"===t.event&&t.value&&t.value.src&&s.push(t.value.src)}));var u=r;var c=class{constructor(e,t){const n=this;this.isReady=!1,this.origin=new URL(document.referrer).origin,this.methods={},this.supported={events:e||i.EVENTS.all(),methods:t||i.METHODS.all()},this.eventListeners={},this.reject=!(window.self!==window.top&&i.POST_MESSAGE),this.reject||i.addEvent(window,"message",(function(e){n.receive(e)}))}receive(e){if(e.origin!==this.origin)return!1;let t={};if("object"==typeof e.data)t=e.data;else try{t=window.JSON.parse(e.data)}catch(e){console.error("JSON Parse Error",e)}if(console.debug("Receiver.receive",e,t),!t.method)return!1;if(t.context!==i.CONTEXT)return!1;if(!i.METHODS.all().includes(t.method))return this.emit("error",{code:2,msg:'Invalid Method "'+t.method+'"'}),!1;const n=i.isNone(t.listener)?null:t.listener;if("addEventListener"===t.method)Object.hasOwn(this.eventListeners,t.value)?this.eventListeners[t.value].includes(n)||this.eventListeners[t.value].push(n):this.eventListeners[t.value]=[n],"ready"===t.value&&this.isReady&&this.ready();else if("removeEventListener"===t.method){if(Object.hasOwn(this.eventListeners,t.value)){const e=this.eventListeners[t.value].indexOf(n);e>-1&&this.eventListeners[t.value].splice(e,1),0===this.eventListeners[t.value].length&&delete this.eventListeners[t.value]}}else this.get(t.method,t.value,n)}get(e,t,n){const i=this;if(!Object.hasOwn(this.methods,e))return this.emit("error",{code:3,msg:'Method Not Supported"'+e+'"'}),!1;const o=this.methods[e];if("get"===e.substr(0,3)){const t=function(t){i.send(e,t,n)};o.call(this,t)}else o.call(this,t)}on(e,t){this.methods[e]=t}send(e,t,n){if(console.debug("Receiver.send",e,t,n),this.reject)return console.error("Receiver.send.reject",e,t,n),!1;const o={context:i.CONTEXT,version:i.VERSION,event:e};i.isNone(t)||(o.value=t),i.isNone(n)||(o.listener=n);const s=JSON.stringify(o);window.parent.postMessage(s,""===this.origin?"*":this.origin)}emit(e,t){if(!Object.hasOwn(this.eventListeners,e))return!1;console.debug("Instance.emit",e,t,this.eventListeners[e]);for(let n=0;n<this.eventListeners[e].length;n++){const i=this.eventListeners[e][n];this.send(e,t,i)}return!0}ready(){console.debug("Receiver.ready"),this.isReady=!0;const e={src:window.location.toString(),events:this.supported.events,methods:this.supported.methods};this.emit("ready",e)||this.send("ready",e)}};var d=class{constructor(){this.init()}init(){const e={duration:20,currentTime:0,interval:null,timeupdate:function(){},volume:100,mute:!1,playing:!1,loop:!1,play:function(){e.interval=setInterval((function(){e.currentTime+=.25,e.timeupdate({seconds:e.currentTime,duration:e.duration})}),250),e.playing=!0},pause:function(){clearInterval(e.interval),e.playing=!1}},t=this.receiver=new c;t.on("play",(function(){const t=this;e.play(),this.emit("play"),e.timeupdate=function(e){t.emit("timeupdate",e)}})),t.on("pause",(function(){e.pause(),this.emit("pause")})),t.on("getPaused",(function(t){t(!e.playing)})),t.on("getCurrentTime",(function(t){t(e.currentTime)})),t.on("setCurrentTime",(function(t){e.currentTime=t})),t.on("getDuration",(function(t){t(e.duration)})),t.on("getVolume",(function(t){t(e.volume)})),t.on("setVolume",(function(t){e.volume=t})),t.on("mute",(function(){e.mute=!0})),t.on("unmute",(function(){e.mute=!1})),t.on("getMuted",(function(t){t(e.mute)})),t.on("getLoop",(function(t){t(e.loop)})),t.on("setLoop",(function(t){e.loop=t})),t.on("setPlaybackRate",(function(t){e.playbackRate=t})),t.on("getPlaybackRate",(function(t){t(e.playbackRate)}))}ready(){this.receiver.ready()}};var l=class{constructor(e){this.init(e)}init(e){i.assert(e,"VideoJSReceiver requires a player object");const t=this.receiver=new c;e.on("pause",(function(){t.emit("pause")})),e.on("play",(function(){t.emit("play")})),e.on("timeupdate",(function(n){const i=e.currentTime(),o=e.duration();if(!i||!o)return!1;const s={seconds:i,duration:o};t.emit("timeupdate",s)})),e.on("ended",(function(){t.emit("ended")})),e.on("error",(function(){t.emit("error")})),t.on("play",(function(){e.play()})),t.on("pause",(function(){e.pause()})),t.on("getPaused",(function(t){t(e.paused())})),t.on("getCurrentTime",(function(t){t(e.currentTime())})),t.on("setCurrentTime",(function(t){e.currentTime(t)})),t.on("getDuration",(function(t){t(e.duration())})),t.on("getVolume",(function(t){t(100*e.volume())})),t.on("setVolume",(function(t){e.volume(t/100)})),t.on("mute",(function(){e.volume(0)})),t.on("unmute",(function(){e.volume(1)})),t.on("getMuted",(function(t){t(0===e.volume())})),t.on("getLoop",(function(t){t(e.loop())})),t.on("setLoop",(function(t){e.loop(t)})),t.on("setPlaybackRate",(function(t){e.playbackRate(t)})),t.on("getPlaybackRate",(function(t){t(e.playbackRate())}))}ready(){this.receiver.ready()}};var h=class{constructor(e){this.init(e)}init(e){i.assert(e,"HTML5Adapter requires a video element");const t=this.receiver=new c;e.addEventListener("playing",(function(){t.emit("play")})),e.addEventListener("pause",(function(){t.emit("pause")})),e.addEventListener("ended",(function(){t.emit("ended")})),e.addEventListener("timeupdate",(function(){t.emit("timeupdate",{seconds:e.currentTime,duration:e.duration})})),e.addEventListener("progress",(function(){t.emit("buffered",{percent:e.buffered.length})})),t.on("play",(function(){e.play()})),t.on("pause",(function(){e.pause()})),t.on("getPaused",(function(t){t(e.paused)})),t.on("getCurrentTime",(function(t){t(e.currentTime)})),t.on("setCurrentTime",(function(t){e.currentTime=t})),t.on("getDuration",(function(t){t(e.duration)})),t.on("getVolume",(function(t){t(100*e.volume)})),t.on("setVolume",(function(t){e.volume=t/100})),t.on("mute",(function(){e.muted=!0})),t.on("unmute",(function(){e.muted=!1})),t.on("getMuted",(function(t){t(e.muted)})),t.on("getLoop",(function(t){t(e.loop)})),t.on("setLoop",(function(t){e.loop=t})),t.on("setPlaybackRate",(function(t){e.playbackRate=t})),t.on("getPlaybackRate",(function(t){t(e.playbackRate)}))}ready(){this.receiver.ready()}};const f={Player:u,Receiver:c,MockAdapter:d,VideoJSAdapter:l,HTML5Adapter:h,CONTEXT:i.CONTEXT,VERSION:i.VERSION,METHODS:i.METHODS,addEvent:i.addEvent};"undefined"!=typeof window&&(window.playerjs=f);var p={playerjs:f};return t}()}));
@@ -0,0 +1,10 @@
1
+ /*!
2
+ *
3
+ * Copyright (C) 2025, Gumlet Pte Ltd., All Rights Reserved
4
+ *
5
+ * This source code and its use and distribution, is subject to the terms
6
+ * and conditions of the applicable license agreement.
7
+ *
8
+ * @gumlet/player.js version 2.0.10
9
+ *
10
+ */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "title": "Player.js",
3
3
  "name": "@gumlet/player.js",
4
- "version": "2.0.7",
4
+ "version": "2.0.10",
5
5
  "homepage": "http://github.com/gumlet/player.js",
6
6
  "main": "dist/player.min.js",
7
7
  "module": "dist/player.min.js",
@@ -9,12 +9,13 @@
9
9
  "type": "git",
10
10
  "url": "git://github.com/gumlet/player.js.git"
11
11
  },
12
- "type": "module",
13
12
  "author": {
14
13
  "name": "Gumlet"
15
14
  },
16
15
  "scripts": {
17
- "prepublishOnly": "standard && node esbuild.js"
16
+ "build:debug": "webpack --progress --config webpack.config.debug.js",
17
+ "build:release": "webpack --progress --config webpack.config.release.js",
18
+ "prepublishOnly": "standard && webpack --progress --config webpack.config.release.js"
18
19
  },
19
20
  "files": [
20
21
  "dist/*"
@@ -24,8 +25,20 @@
24
25
  },
25
26
  "browserslist": "defaults",
26
27
  "license": "MIT",
28
+ "dependencies": {
29
+ "@babel/cli": "^7.16.0",
30
+ "@babel/core": "^7.16.0",
31
+ "@babel/eslint-parser": "^7.16.3",
32
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
33
+ "@babel/plugin-proposal-object-rest-spread": "^7.20.7",
34
+ "@babel/preset-env": "^7.16.4",
35
+ "babel-loader": "^8.2.3",
36
+ "generate-json-webpack-plugin": "^2.0.0",
37
+ "webpack": "^5.64.0",
38
+ "webpack-cli": "^4.9.1"
39
+ },
27
40
  "devDependencies": {
28
- "esbuild": "^0.24.0",
41
+ "esbuild": "^0.25.0",
29
42
  "standard": "^17.1.2"
30
43
  }
31
44
  }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/core.js", "../src/keeper.js", "../src/player.js", "../src/receiver.js", "../src/adapters/mock.js", "../src/adapters/video.js", "../src/adapters/html.js", "../src/main.js"],
4
- "sourcesContent": ["const core = {\n EVENTS: {\n READY: 'ready',\n PLAY: 'play',\n PAUSE: 'pause',\n ENDED: 'ended',\n TIMEUPDATE: 'timeupdate',\n PROGRESS: 'progress',\n SEEKED: 'seeked',\n ERROR: 'error',\n FULLSCREEN_CHANGE: 'fullscreenChange',\n PIP_CHANGE: 'pipChange',\n PLAYBACK_RATE_CHANGE: 'playbackRateChange',\n AUDIO_CHANGE: 'audioChange',\n QUALITY_CHANGE: 'qualityChange',\n VOLUME_CHANGE: 'volumeChange'\n },\n\n POST_MESSAGE: !!window.postMessage,\n\n METHODS: {\n PLAY: 'play',\n PAUSE: 'pause',\n GETPAUSED: 'getPaused',\n MUTE: 'mute',\n UNMUTE: 'unmute',\n GETMUTED: 'getMuted',\n SETVOLUME: 'setVolume',\n GETVOLUME: 'getVolume',\n GETDURATION: 'getDuration',\n SETCURRENTTIME: 'setCurrentTime',\n GETCURRENTTIME: 'getCurrentTime',\n SETLOOP: 'setLoop',\n GETLOOP: 'getLoop',\n SETPLAYBACKRATE: 'setPlaybackRate',\n GETPLAYBACKRATE: 'getPlaybackRate',\n REMOVEEVENTLISTENER: 'removeEventListener',\n ADDEVENTLISTENER: 'addEventListener'\n },\n\n DEBUG: false,\n VERSION: '2.0',\n CONTEXT: 'player.js',\n\n isString: function (obj) {\n return Object.prototype.toString.call(obj) === '[object String]'\n },\n\n has: function (obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key)\n }\n}\n\ncore.METHODS.all = function () {\n const all = []\n for (const key in core.METHODS) {\n if (core.has(core.METHODS, key) && core.isString(core.METHODS[key])) {\n all.push(core.METHODS[key])\n }\n }\n return all\n}\n\ncore.EVENTS.all = function () {\n const all = []\n for (const key in core.EVENTS) {\n if (core.has(core.EVENTS, key) && core.isString(core.EVENTS[key])) {\n all.push(core.EVENTS[key])\n }\n }\n return all\n}\n\ncore.addEvent = function (elem, type, eventHandle) {\n if (!elem) { return }\n if (elem.addEventListener) {\n elem.addEventListener(type, eventHandle, false)\n } else if (elem.attachEvent) {\n elem.attachEvent('on' + type, eventHandle)\n } else {\n elem['on' + type] = eventHandle\n }\n}\n\ncore.isNone = function (obj) {\n return (obj === null || obj === undefined)\n}\n\ncore.assert = function (test, msg) {\n if (!test) {\n throw msg || 'Player.js Assert Failed'\n }\n}\n\ncore.generateUUID = function () {\n if (crypto && crypto.randomUUID) {\n return crypto.randomUUID()\n } else {\n const url = URL.createObjectURL(new Blob())\n return url.substring(url.lastIndexOf('/') + 1)\n }\n}\n\ncore.isArray = function (obj) {\n return Object.prototype.toString.call(obj) === '[object Array]'\n}\n\nexport default core\n", "/*\n* Keeper is just a method for keeping track of all the callbacks.\n*/\nimport core from './core'\n\nclass Keeper {\n constructor () {\n this.data = {}\n }\n\n has (event, id) {\n if (!Object.hasOwn(this.data, event)) {\n return false\n }\n\n if (core.isNone(id)) {\n return true\n }\n\n // Figure out if we have the event.\n const events = this.data[event]\n\n for (let i = 0; i < events.length; i++) {\n if (events[i].id === id) {\n return true\n }\n }\n\n return false\n }\n\n add (id, event, cb, ctx, one) {\n const d = {\n id,\n event,\n cb,\n ctx,\n one\n }\n\n if (this.has(event)) {\n this.data[event].push(d)\n } else {\n this.data[event] = [d]\n }\n }\n\n execute (event, id, data, ctx) {\n if (!this.has(event, id)) {\n return false\n }\n\n const keep = []\n const execute = []\n\n for (let i = 0; i < this.data[event].length; i++) {\n const d = this.data[event][i]\n\n // There are omni events, in that they do not have an id. i.e \"ready\".\n // Or there is an ID and we only want to execute the right id'd method.\n if (core.isNone(id) || (!core.isNone(id) && d.id === id)) {\n execute.push({\n cb: d.cb,\n ctx: d.ctx ? d.ctx : ctx,\n data\n })\n\n // If we only wanted to execute this once.\n if (d.one === false) {\n keep.push(d)\n }\n } else {\n keep.push(d)\n }\n }\n\n if (keep.length === 0) {\n delete this.data[event]\n } else {\n this.data[event] = keep\n }\n\n // We need to execute everything after we deal with the one stuff. otherwise\n // we have issues to order of operations.\n for (let n = 0; n < execute.length; n++) {\n const e = execute[n]\n e.cb.call(e.ctx, e.data)\n }\n }\n\n on (id, event, cb, ctx) {\n this.add(id, event, cb, ctx, false)\n }\n\n one (id, event, cb, ctx) {\n this.add(id, event, cb, ctx, true)\n }\n\n off (event, cb) {\n // We should probably restructure so this is a bit less of a pain.\n const listeners = []\n\n if (!Object.hasOwn(this.data, event)) {\n return listeners\n }\n\n const keep = []\n\n // Loop through everything.\n for (let i = 0; i < this.data[event].length; i++) {\n const data = this.data[event][i]\n // If we only keep if there was a CB and the CB is there.\n if (!core.isNone(cb) && data.cb !== cb) {\n keep.push(data)\n } else if (!core.isNone(data.id)) {\n listeners.push(data.id)\n }\n }\n\n if (keep.length === 0) {\n delete this.data[event]\n } else {\n this.data[event] = keep\n }\n\n return listeners\n }\n}\n\nexport default Keeper\n", "/*\n* Player.js is a javascript library for interacting with iframes via\n* postMessage that use an Open Player Spec\n*\n*/\nimport core from './core'\nimport Keeper from './keeper'\n\nconst READIED = []\n\nclass Player {\n constructor (elem) {\n const self = this\n this.READIED = READIED\n\n if (core.isString(elem)) {\n elem = document.getElementById(elem)\n }\n\n this.elem = elem\n\n // make sure we have an iframe\n core.assert(elem.nodeName === 'IFRAME',\n 'playerjs.Player constructor requires an Iframe, got \"' + elem.nodeName + '\"')\n core.assert(elem.src,\n 'playerjs.Player constructor requires a Iframe with a \\'src\\' attribute.')\n\n // Figure out the origin of where we are sending messages.\n this.origin = (new URL(elem.src)).origin\n\n // Event handling.\n this.keeper = new Keeper()\n\n // Queuing before ready.\n this.isReady = false\n this.queue = []\n\n // Assume that everything is supported, unless we know otherwise.\n this.events = core.EVENTS.all()\n this.methods = core.METHODS.all()\n\n if (core.POST_MESSAGE) {\n // Set up the reciever.\n core.addEvent(window, 'message', function (e) {\n self.receive(e)\n })\n } else {\n console.error('Post Message is not Available.')\n }\n\n // See if we caught the src event first, otherwise assume we haven't loaded\n if (READIED.includes(elem.src)) {\n self.loaded = true\n } else {\n // Try the onload event, just lets us give another test.\n this.elem.onload = function () {\n self.loaded = true\n }\n }\n }\n\n send (data, callback, ctx) {\n // Add the context and version to the data.\n data.context = core.CONTEXT\n data.version = core.VERSION\n\n // We are expecting a response.\n if (callback) {\n // Create a UUID\n const id = core.generateUUID()\n\n // Set the listener.\n data.listener = id\n\n // Only hang on to this listener once.\n this.keeper.one(id, data.method, callback, ctx)\n }\n\n if (!this.isReady && data.value !== 'ready') {\n console.debug('Player.queue', data)\n this.queue.push(data)\n return false\n }\n\n console.debug('Player.send', data, this.origin)\n\n if (this.loaded === true) {\n this.elem.contentWindow.postMessage(JSON.stringify(data), this.origin)\n }\n\n return true\n }\n\n receive (e) {\n console.debug('Player.receive', e)\n\n if (e.origin !== this.origin) {\n return false\n }\n\n let data\n try {\n data = JSON.parse(e.data)\n } catch (err) {\n // Not a valid response.\n return false\n }\n\n // abort if this message wasn't a player.js message\n if (data.context !== core.CONTEXT) {\n return false\n }\n\n // We need to determine if we are ready.\n if (data.event === 'ready' && data.value && data.value.src === this.elem.src) {\n this.ready(data)\n }\n\n if (this.keeper.has(data.event, data.listener)) {\n this.keeper.execute(data.event, data.listener, data.value, this)\n }\n }\n\n ready (data) {\n if (this.isReady === true) {\n return false\n }\n\n // If we got a list of supported methods, we should set them.\n if (data.value.events) {\n this.events = data.value.events\n }\n if (data.value.methods) {\n this.methods = data.value.methods\n }\n\n // set ready.\n this.isReady = true\n this.loaded = true\n\n // Clear the queue\n for (let i = 0; i < this.queue.length; i++) {\n const obj = this.queue[i]\n\n console.debug('Player.dequeue', obj)\n\n if (data.event === 'ready') {\n this.keeper.execute(obj.event, obj.listener, true, this)\n }\n this.send(obj)\n }\n this.queue = []\n }\n\n on (event, callback, ctx) {\n const id = core.generateUUID()\n\n if (event === 'ready') {\n // We only want to call ready once.\n this.keeper.one(id, event, callback, ctx)\n } else {\n this.keeper.on(id, event, callback, ctx)\n }\n\n this.send({\n method: 'addEventListener',\n value: event,\n listener: id\n })\n\n return true\n }\n\n off (event, callback) {\n const listeners = this.keeper.off(event, callback)\n console.debug('Player.off', listeners)\n\n if (listeners.length > 0) {\n for (const i in listeners) {\n this.send({\n method: 'removeEventListener',\n value: event,\n listener: listeners[i]\n })\n }\n return true\n }\n\n return false\n }\n\n // Based on what ready passed back, we can determine if the events/method are\n // supported by the player.\n supports (evtOrMethod, names) {\n core.assert(['method', 'event'].includes(evtOrMethod),\n 'evtOrMethod needs to be either \"event\" or \"method\" got ' + evtOrMethod)\n\n // Make everything an array.\n names = core.isArray(names) ? names : [names]\n\n const all = evtOrMethod === 'event' ? this.events : this.methods\n\n for (let i = 0; i < names.length; i++) {\n if (!all.includes(names[i])) {\n return false\n }\n }\n\n return true\n }\n}\n\n// create function to add to the Player prototype\nfunction createPrototypeFunction (name) {\n return function () {\n const data = {\n method: name\n }\n\n let args = Array.prototype.slice.call(arguments)\n\n // for getters add the passed parameters to the arguments for the send call\n if (/^get/.test(name)) {\n core.assert(args.length > 0, 'Get methods require a callback.')\n args.unshift(data)\n } else {\n // for setter add the first arg to the value field\n if (/^set/.test(name)) {\n core.assert(args.length !== 0, 'Set methods require a value.')\n data.value = args[0]\n }\n args = [data]\n }\n\n this.send.apply(this, args)\n }\n}\n\n// Loop through the methods to add them to the prototype.\nfor (const methodName of core.METHODS.all()) {\n if (!Object.hasOwn(Player.prototype, methodName)) {\n Player.prototype[methodName] = createPrototypeFunction(methodName)\n }\n}\n\ncore.addEvent(window, 'message', function (e) {\n let data\n try {\n data = JSON.parse(e.data)\n } catch (err) {\n return false\n }\n\n // abort if this message wasn't a player.js message\n if (data.context !== core.CONTEXT) {\n return false\n }\n\n // We need to determine if we are ready.\n if (data.event === 'ready' && data.value && data.value.src) {\n READIED.push(data.value.src)\n }\n})\n\nexport default Player\n", "/*\n* Does all the wiring up for the backend.\n*\n* var receiver = new playerjs.Receiver();\n* receiver.on('play', function(){ video.play() });\n* receiver.on('getDuration', function(callback){ callback(video.duration) });\n* receiver.emit('timeupdate', {});\n*/\n\nimport core from './core'\n\nclass Receiver {\n constructor (events, methods) {\n const self = this\n\n // Deal with the ready crap.\n this.isReady = false\n\n // Bind the window message.\n this.origin = (new URL(document.referrer)).origin\n\n // Create a holder for all the methods.\n this.methods = {}\n\n // holds all the information about what's supported\n this.supported = {\n events: events || core.EVENTS.all(),\n methods: methods || core.METHODS.all()\n }\n\n // Deals with the adding and removing of event listeners.\n this.eventListeners = {}\n\n // We can't send any messages.\n this.reject = !(window.self !== window.top && core.POST_MESSAGE)\n\n // We aren't in an iframe, don't listen.\n if (!this.reject) {\n core.addEvent(window, 'message', function (e) {\n self.receive(e)\n })\n }\n }\n\n receive (e) {\n // Only want to listen to events that came from our origin.\n if (e.origin !== this.origin) {\n return false\n }\n\n // Browsers that support postMessage also support JSON.\n let data = {}\n if (typeof e.data === 'object') {\n data = e.data\n } else {\n try {\n data = window.JSON.parse(e.data)\n } catch (err) {\n console.error('JSON Parse Error', err)\n }\n }\n\n console.debug('Receiver.receive', e, data)\n\n // Nothing for us to do.\n if (!data.method) {\n return false\n }\n\n // make sure the context is correct.\n if (data.context !== core.CONTEXT) {\n return false\n }\n\n // Make sure we have a valid method.\n if (!core.METHODS.all().includes(data.method)) {\n this.emit('error', {\n code: 2,\n msg: 'Invalid Method \"' + data.method + '\"'\n })\n return false\n }\n\n // See if we added a listener\n const listener = !core.isNone(data.listener) ? data.listener : null\n\n // Add Event Listener.\n if (data.method === 'addEventListener') {\n if (Object.hasOwn(this.eventListeners, data.value)) {\n // If the listener is the same, i.e. null only add it once.\n if (!this.eventListeners[data.value].includes(listener)) {\n this.eventListeners[data.value].push(listener)\n }\n } else {\n this.eventListeners[data.value] = [listener]\n }\n\n if (data.value === 'ready' && this.isReady) {\n this.ready()\n }\n } else if (data.method === 'removeEventListener') { // Remove the event listener.\n if (Object.hasOwn(this.eventListeners, data.value)) {\n const index = this.eventListeners[data.value].indexOf(listener)\n\n // if we find the element, remove it.\n if (index > -1) {\n this.eventListeners[data.value].splice(index, 1)\n }\n\n if (this.eventListeners[data.value].length === 0) {\n delete this.eventListeners[data.value]\n }\n }\n } else { // Go get it.\n this.get(data.method, data.value, listener)\n }\n }\n\n get (method, value, listener) {\n const self = this\n\n // Now lets do it.\n if (!Object.hasOwn(this.methods, method)) {\n this.emit('error', {\n code: 3,\n msg: 'Method Not Supported\"' + method + '\"'\n })\n return false\n }\n\n const func = this.methods[method]\n\n if (method.substr(0, 3) === 'get') {\n const callback = function (val) {\n self.send(method, val, listener)\n }\n func.call(this, callback)\n } else {\n func.call(this, value)\n }\n }\n\n on (event, callback) {\n this.methods[event] = callback\n }\n\n send (event, value, listener) {\n console.debug('Receiver.send', event, value, listener)\n\n if (this.reject) {\n // We are not in a frame, or we don't support POST_MESSAGE\n console.error('Receiver.send.reject', event, value, listener)\n return false\n }\n\n const data = {\n context: core.CONTEXT,\n version: core.VERSION,\n event\n }\n\n if (!core.isNone(value)) {\n data.value = value\n }\n\n if (!core.isNone(listener)) {\n data.listener = listener\n }\n\n const msg = JSON.stringify(data)\n window.parent.postMessage(msg, this.origin === '' ? '*' : this.origin)\n }\n\n emit (event, value) {\n if (!Object.hasOwn(this.eventListeners, event)) {\n return false\n }\n\n console.debug('Instance.emit', event, value, this.eventListeners[event])\n\n for (let i = 0; i < this.eventListeners[event].length; i++) {\n const listener = this.eventListeners[event][i]\n this.send(event, value, listener)\n }\n\n return true\n }\n\n ready () {\n console.debug('Receiver.ready')\n this.isReady = true\n\n const data = {\n src: window.location.toString(),\n events: this.supported.events,\n methods: this.supported.methods\n }\n\n if (!this.emit('ready', data)) {\n this.send('ready', data)\n }\n }\n}\n\nexport default Receiver\n", "import Receiver from '../receiver'\n\nclass MockAdapter {\n constructor () {\n this.init()\n }\n\n init () {\n // Our mock video\n const video = {\n duration: 20,\n currentTime: 0,\n interval: null,\n timeupdate: function () {},\n volume: 100,\n mute: false,\n playing: false,\n loop: false,\n play: function () {\n video.interval = setInterval(function () {\n video.currentTime += 0.25\n video.timeupdate({\n seconds: video.currentTime,\n duration: video.duration\n })\n }, 250)\n video.playing = true\n },\n pause: function () {\n clearInterval(video.interval)\n video.playing = false\n }\n }\n\n // Set up the actual receiver\n const receiver = this.receiver = new Receiver()\n\n receiver.on('play', function () {\n const self = this\n video.play()\n this.emit('play')\n video.timeupdate = function (data) {\n self.emit('timeupdate', data)\n }\n })\n\n receiver.on('pause', function () {\n video.pause()\n this.emit('pause')\n })\n\n receiver.on('getPaused', function (callback) {\n const isPaused = !video.playing\n callback(isPaused)\n })\n\n receiver.on('getCurrentTime', function (callback) {\n callback(video.currentTime)\n })\n\n receiver.on('setCurrentTime', function (value) {\n video.currentTime = value\n })\n\n receiver.on('getDuration', function (callback) {\n callback(video.duration)\n })\n\n receiver.on('getVolume', function (callback) {\n callback(video.volume)\n })\n\n receiver.on('setVolume', function (value) {\n video.volume = value\n })\n\n receiver.on('mute', function () {\n video.mute = true\n })\n\n receiver.on('unmute', function () {\n video.mute = false\n })\n\n receiver.on('getMuted', function (callback) {\n callback(video.mute)\n })\n\n receiver.on('getLoop', function (callback) {\n callback(video.loop)\n })\n\n receiver.on('setLoop', function (value) {\n video.loop = value\n })\n\n receiver.on('setPlaybackRate', function (value) {\n video.playbackRate = value\n })\n\n receiver.on('getPlaybackRate', function (callback) {\n callback(video.playbackRate)\n })\n }\n\n ready () {\n this.receiver.ready()\n }\n}\n\nexport default MockAdapter\n", "import core from '../core'\nimport Receiver from '../receiver'\n\nclass VideoJSAdapter {\n constructor (player) {\n this.init(player)\n }\n\n init (player) {\n core.assert(player, 'VideoJSReceiver requires a player object')\n\n // Set up the actual receiver\n const receiver = this.receiver = new Receiver()\n\n /* EVENTS */\n player.on('pause', function () {\n receiver.emit('pause')\n })\n\n player.on('play', function () {\n receiver.emit('play')\n })\n\n player.on('timeupdate', function (e) {\n const seconds = player.currentTime()\n const duration = player.duration()\n\n if (!seconds || !duration) {\n return false\n }\n\n const value = {\n seconds,\n duration\n }\n receiver.emit('timeupdate', value)\n })\n\n player.on('ended', function () {\n receiver.emit('ended')\n })\n\n player.on('error', function () {\n receiver.emit('error')\n })\n\n /* METHODS */\n receiver.on('play', function () {\n player.play()\n })\n\n receiver.on('pause', function () {\n player.pause()\n })\n\n receiver.on('getPaused', function (callback) {\n callback(player.paused())\n })\n\n receiver.on('getCurrentTime', function (callback) {\n callback(player.currentTime())\n })\n\n receiver.on('setCurrentTime', function (value) {\n player.currentTime(value)\n })\n\n receiver.on('getDuration', function (callback) {\n callback(player.duration())\n })\n\n receiver.on('getVolume', function (callback) {\n const volume = player.volume() * 100\n callback(volume)\n })\n\n receiver.on('setVolume', function (value) {\n player.volume(value / 100)\n })\n\n receiver.on('mute', function () {\n player.volume(0)\n })\n\n receiver.on('unmute', function () {\n player.volume(1)\n })\n\n receiver.on('getMuted', function (callback) {\n const isMuted = player.volume() === 0\n callback(isMuted)\n })\n\n receiver.on('getLoop', function (callback) {\n callback(player.loop())\n })\n\n receiver.on('setLoop', function (value) {\n player.loop(value)\n })\n\n receiver.on('setPlaybackRate', function (value) {\n player.playbackRate(value)\n })\n\n receiver.on('getPlaybackRate', function (callback) {\n callback(player.playbackRate())\n })\n }\n\n ready () {\n this.receiver.ready()\n }\n}\n\nexport default VideoJSAdapter\n", "import core from '../core'\nimport Receiver from '../receiver'\n\nclass HTML5Adapter {\n constructor (video) {\n this.init(video)\n }\n\n init (video) {\n core.assert(video, 'HTML5Adapter requires a video element')\n\n // Set up the actual receiver\n const receiver = this.receiver = new Receiver()\n\n /* EVENTS */\n video.addEventListener('playing', function () {\n receiver.emit('play')\n })\n\n video.addEventListener('pause', function () {\n receiver.emit('pause')\n })\n\n video.addEventListener('ended', function () {\n receiver.emit('ended')\n })\n\n video.addEventListener('timeupdate', function () {\n receiver.emit('timeupdate', {\n seconds: video.currentTime,\n duration: video.duration\n })\n })\n\n video.addEventListener('progress', function () {\n receiver.emit('buffered', {\n percent: video.buffered.length\n })\n })\n\n /* Methods */\n receiver.on('play', function () {\n video.play()\n })\n\n receiver.on('pause', function () {\n video.pause()\n })\n\n receiver.on('getPaused', function (callback) {\n callback(video.paused)\n })\n\n receiver.on('getCurrentTime', function (callback) {\n callback(video.currentTime)\n })\n\n receiver.on('setCurrentTime', function (value) {\n video.currentTime = value\n })\n\n receiver.on('getDuration', function (callback) {\n callback(video.duration)\n })\n\n receiver.on('getVolume', function (callback) {\n const volume = video.volume * 100\n callback(volume)\n })\n\n receiver.on('setVolume', function (value) {\n video.volume = value / 100\n })\n\n receiver.on('mute', function () {\n video.muted = true\n })\n\n receiver.on('unmute', function () {\n video.muted = false\n })\n\n receiver.on('getMuted', function (callback) {\n callback(video.muted)\n })\n\n receiver.on('getLoop', function (callback) {\n callback(video.loop)\n })\n\n receiver.on('setLoop', function (value) {\n video.loop = value\n })\n\n receiver.on('setPlaybackRate', function (value) {\n video.playbackRate = value\n })\n\n receiver.on('getPlaybackRate', function (callback) {\n callback(video.playbackRate)\n })\n }\n\n ready () {\n this.receiver.ready()\n }\n}\n\nexport default HTML5Adapter\n", "import core from './core'\nimport Player from './player'\nimport Receiver from './receiver'\nimport MockAdapter from './adapters/mock'\nimport VideoJSAdapter from './adapters/video'\nimport HTML5Adapter from './adapters/html'\n\nconst playerjs = {\n Player,\n Receiver,\n MockAdapter,\n VideoJSAdapter,\n HTML5Adapter,\n CONTEXT: core.CONTEXT,\n VERSION: core.VERSION,\n METHODS: core.METHODS,\n addEvent: core.addEvent\n}\n\n// Attach to the window object explicitly\nif (typeof window !== 'undefined') {\n window.playerjs = playerjs\n}\n\nexport default playerjs\n"],
5
- "mappings": "AAAA,IAAMA,EAAO,CACX,OAAQ,CACN,MAAO,QACP,KAAM,OACN,MAAO,QACP,MAAO,QACP,WAAY,aACZ,SAAU,WACV,OAAQ,SACR,MAAO,QACP,kBAAmB,mBACnB,WAAY,YACZ,qBAAsB,qBACtB,aAAc,cACd,eAAgB,gBAChB,cAAe,cACjB,EAEA,aAAc,CAAC,CAAC,OAAO,YAEvB,QAAS,CACP,KAAM,OACN,MAAO,QACP,UAAW,YACX,KAAM,OACN,OAAQ,SACR,SAAU,WACV,UAAW,YACX,UAAW,YACX,YAAa,cACb,eAAgB,iBAChB,eAAgB,iBAChB,QAAS,UACT,QAAS,UACT,gBAAiB,kBACjB,gBAAiB,kBACjB,oBAAqB,sBACrB,iBAAkB,kBACpB,EAEA,MAAO,GACP,QAAS,MACT,QAAS,YAET,SAAU,SAAUC,EAAK,CACvB,OAAO,OAAO,UAAU,SAAS,KAAKA,CAAG,IAAM,iBACjD,EAEA,IAAK,SAAUA,EAAKC,EAAK,CACvB,OAAO,OAAO,UAAU,eAAe,KAAKD,EAA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,EAAK,QACd,QAASA,EAAK,QACd,QAASA,EAAK,QACd,SAAUA,EAAK,QACjB,EAGI,OAAO,OAAW,MACpB,OAAO,SAAWN,GAGpB,IAAOO,EAAQP",
6
- "names": ["core", "obj", "key", "all", "elem", "type", "eventHandle", "test", "msg", "url", "core_default", "Keeper", "event", "id", "core_default", "events", "i", "cb", "ctx", "one", "d", "data", "keep", "execute", "n", "e", "listeners", "keeper_default", "READIED", "Player", "elem", "self", "core_default", "keeper_default", "e", "data", "callback", "ctx", "id", "err", "i", "obj", "event", "listeners", "evtOrMethod", "names", "all", "createPrototypeFunction", "name", "args", "methodName", "player_default", "Receiver", "events", "methods", "self", "core_default", "e", "data", "err", "listener", "index", "method", "value", "func", "callback", "val", "event", "msg", "i", "receiver_default", "MockAdapter", "video", "receiver", "receiver_default", "self", "data", "callback", "isPaused", "value", "mock_default", "VideoJSAdapter", "player", "core_default", "receiver", "receiver_default", "e", "seconds", "duration", "value", "callback", "volume", "isMuted", "video_default", "HTML5Adapter", "video", "core_default", "receiver", "receiver_default", "callback", "value", "volume", "html_default", "playerjs", "player_default", "receiver_default", "mock_default", "video_default", "html_default", "core_default", "main_default"]
7
- }