@enplug/sdk-player
Advanced tools
Comparing version 0.10.2 to 0.10.3
@@ -1,2 +0,2 @@ | ||
var enplug=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t){e.exports={name:"@enplug/sdk-player",version:"0.10.2",description:"Enplug Player SDK",main:"./src/index.ts",typings:"./src/index.d.ts",scripts:{clean:"rimraf dist/ && mkdirp dist",lint:"tslint -c tslint.json './src/**/*.ts' -e './**/*.d.ts'",test:"karma start test/karma.conf.js",bundle:"npm run clean && webpack",start:"npm-run-all clean lint test",release:"npm run bundle && enplug-release-sdk","release:dev":"npm run bundle && enplug-release-sdk --dev"},repository:{type:"git",url:"git+https://github.com/Enplug/sdk.git"},keywords:["Enplug"],author:"Enplug",license:"ISC",bugs:{url:"https://github.com/Enplug/sdk/issues"},files:["src/","dist/"],homepage:"https://github.com/Enplug/sdk#readme",devDependencies:{"@enplug/scripts":"1.1.15-beta2","@types/jasmine":"^2.6.0","@types/node":"^8.0.45","command-line-args":"^4.0.7","es6-shim":"^0.35.3",fs:"0.0.1-security",inquirer:"^6.0.0","jasmine-core":"^2.8.0",karma:"^1.7.1","karma-chrome-launcher":"^2.2.0","karma-jasmine":"^1.1.0","karma-phantomjs-launcher":"~1.0.4","karma-phantomjs-shim":"~1.5.0","karma-spec-reporter":"0.0.31","karma-typescript":"~3.0.7",mkdirp:"^0.5.1","npm-run-all":"^4.1.1",path:"^0.12.7",rimraf:"^2.6.2",s3:"^4.4.0",shelljs:"^0.7.8","ts-loader":"^3.1.1",tslint:"^5.7.0",typescript:"^2.5.3","uglifyjs-webpack-plugin":"^1.0.1",webpack:"^3.8.1"},config:{destination:"sdk/v1",destinationDev:"sdk/dev",aws:{buckets:["apps.enplug.in","apps.enplug.com"],s3:{cache:!1,overwrite:!0,region:"us-west-2",sslEnabled:!0,apiVersion:"2016-05-01",params:{ACL:"public-read"}}}}}},function(e,t,n){var r,i;r=[n,t,n(0)],void 0===(i=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.version=n.version,this.resolveMap=new Map}return e.prototype.send=function(e,t,n){var r=this,i=this.getQueryParam("apptoken"),o=this.createToken(),s=this.getAppUrl(),a={service:e,action:t,payload:n,token:o,appToken:i,appUrl:s,playerSdkVersion:this.version};return this.validateOutboundMessage(a)?new Promise(function(e,t){r.resolveMap.set(o,[e,t]),r.sendToPlayer(a)}):Promise.reject("[Enplug SDK: "+this.version+"] Message invalid.")},e.prototype.receive=function(e){if(e&&"object"==typeof e.payload&&!Array.isArray(e.payload)&&(e.payload=this.replaceMediaUrlsWithBlobUrls(e.payload)),e&&Array.isArray(e.payload)){for(var t=[],n=0,r=e.payload;n<r.length;n++){var i=r[n],o=this.replaceMediaUrlsWithBlobUrls(i);t.push(o)}e.payload=t}if(e.token&&this.resolveMap.has(e.token)){var s=this.resolveMap.get(e.token);this.dispatchMessageToApp(e,s)}else"event"===e.service&&this.dispatchEvent(e)},e.prototype.replaceMediaUrlsWithBlobUrls=function(e,t){if(!e)return e;if(!(t=t||e.blobs)||!t.size)return e;for(var n in e)e.hasOwnProperty(n)&&(e[n]&&"object"==typeof e[n]&&"blobs"!==n?e[n]=this.replaceMediaUrlsWithBlobUrls(e[n],t):t.has(e[n])&&(e[n]=window.URL.createObjectURL(t.get(e[n]))));return e},e.prototype.setEventsBus=function(e){this.playerEvents=e},e.prototype.getQueryParam=function(e){var t=new URL(window.location.href).searchParams;return t?t.get(e):""},e.prototype.validateOutboundMessage=function(e){return e&&null!=e.service&&null!=e.action},e.prototype.dispatchMessageToApp=function(e,t){var n=t[0],r=t[1];"error"===e.action?(console.log("[Enplug SDK: "+this.version+"] Error received: "+e.payload.message),r(e.payload)):"reload"===e.action?window.location.reload():n(e.payload)},e.prototype.dispatchEvent=function(e){var t=this;if("destroy"===e.action){this.playerEvents.fireEvent(e.action,function(){return t.send("status","destroy-finished")})}else this.playerEvents.fireEvent(e.action,e.payload)},e.prototype.createToken=function(){var e=Math.random().toString(36).substr(2);return this.resolveMap.has(e)?this.createToken():e},e.prototype.getAppUrl=function(){return""+window.location.host+window.location.pathname},e}();t.default=r}.apply(t,r))||(e.exports=i)},function(e,t,n){var r,i;r=[n,t,n(0),n(4),n(5),n(6),n(7),n(3),n(8),n(9),n(10),n(11),n(12),n(13)],void 0===(i=function(e,t,n,r,i,o,s,a,u,p,l,c,d,f){"use strict";function g(e){var t,g=n.version;e._epBridge?(console.log("[Enplug SDK: "+g+"] Creating bridge from standard implementation (JavaBridge)."),t=new a.default(e._epBridge)):e._epBridgeSend?(console.log("[Enplug SDK: "+g+"] Creating bridge from CEF implementation (CefBridge)."),t=new s.default(e._epBridgeSend)):(console.log("[Enplug SDK: "+g+"] No global sender found. Assuming WebPlayer (WebBridge)."),t=new f.default);var h=new r.default(t),v=new i.default(t),y=new o.default(t),b=new p.default(t),m=new u.default(t),_=new l.default(t),w=new c.default(t),O=new d.default(t);return{appStatus:h,assets:v,cache:y,notifications:m,off:b.off.bind(b),on:b.on.bind(b),once:b.once.bind(b),playRecorder:_,settings:w,social:O}}Object.defineProperty(t,"__esModule",{value:!0}),t.createEnplugPlayerSDK=g,t.default=g(window)}.apply(t,r))||(e.exports=i)},function(e,t,n){var r,i,o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});r=[n,t,n(1)],void 0===(i=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){function t(t){var n=e.call(this)||this;return n.javaGlobal=t,n.javaGlobal.receive=n.receive.bind(n),n}return s(t,e),t.prototype.sendToPlayer=function(e){this.javaGlobal.send(JSON.stringify(e))},t.prototype.receive=function(t){try{var n=JSON.parse(t);e.prototype.receive.call(this,n)}catch(e){}},t}(n.default);t.default=r}.apply(t,r))||(e.exports=i)},function(e,t,n){var r,i;r=[n,t,n(0)],void 0===(i=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.bridge=e,this.canInterruptInternal=!0,this.version=n.version}return e.prototype.start=function(){return this.bridge.send("status","start")},e.prototype.hide=function(){return this.bridge.send("status","hide")},e.prototype.error=function(){return this.bridge.send("status","error")},e.prototype.setCanInterrupt=function(e){var t=this;if("boolean"!=typeof e)return Promise.reject(new TypeError("[Enplug SDK: "+this.version+"] You can only set canInterrupt to a boolean value"));var n=this.canInterruptInternal;return this.canInterruptInternal=e,this.bridge.send("status","set-interrupt",{canInterrupt:e}).then(function(){return e},function(e){return t.canInterruptInternal=n,n})},Object.defineProperty(e.prototype,"canInterrupt",{get:function(){return Promise.resolve(this.canInterruptInternal)},enumerable:!0,configurable:!0}),e.prototype.getTrigger=function(){return this.bridge.send("status","get-trigger")},e.prototype.toggleSound=function(e){return this.bridge.send("status","toggle-sound",{enabled:e})},e}();t.default=r}.apply(t,r))||(e.exports=i)},function(e,t,n){var r;void 0===(r=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.bridge=e}return e.prototype.getList=function(){return this.bridge.send("asset","get-list")},e.prototype.getNext=function(){return this.bridge.send("asset","get-next")},e.prototype.getAsset=function(){return this.bridge.send("asset","get-asset")},e.prototype.getTheme=function(){return this.bridge.send("asset","get-theme")},e}();t.default=n}.apply(t,[n,t]))||(e.exports=r)},function(e,t,n){var r;void 0===(r=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.bridge=e}return e.prototype.getFile=function(e){return this.bridge.send("cache","get-file",e).then(function(t){return t?window.URL.createObjectURL(t):e})},e}();t.default=n}.apply(t,[n,t]))||(e.exports=r)},function(e,t,n){var r,i,o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});r=[n,t,n(1)],void 0===(i=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){function t(t){var n=e.call(this)||this;return n.cefGlobalSend=t,window._epBridge={receive:n.receive.bind(n)},n}return s(t,e),t.prototype.sendToPlayer=function(e){return this.cefGlobalSend({request:JSON.stringify(e),persistent:!1})},t.prototype.receive=function(t){try{var n=JSON.parse(t);e.prototype.receive.call(this,n)}catch(e){}},t}(n.default);t.default=r}.apply(t,r))||(e.exports=i)},function(e,t,n){var r;void 0===(r=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.bridge=e}return e.prototype.post=function(e){return this.bridge.send("notification","post",{message:e}).then(function(e){return e?e.notificationId:""})},e}();t.default=n}.apply(t,[n,t]))||(e.exports=r)},function(e,t,n){var r,i;r=[n,t,n(0)],void 0===(i=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.bridge=e,this.handlerMap=new Map,this.version=n.version,this.bridge.setEventsBus(this)}return e.prototype.on=function(e,t){this.checkArgumentTypes(e,t),this.handlerMap.has(e)?this.handlerMap.get(e).add(t):this.handlerMap.set(e,new Set([t])),this.bridge.send("event","set-listener",{eventName:e})},e.prototype.off=function(e,t){if(this.checkArgumentTypes(e,t),this.handlerMap.has(e)){var n=this.handlerMap.get(e);n.has(t)&&n.delete(t)}},e.prototype.once=function(e,t){var n=this;this.checkArgumentTypes(e,t);var r=function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];n.off(e,r),t.apply(void 0,i)};this.on(e,r)},e.prototype.fireEvent=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this.handlerMap.get(e);r&&r.forEach(function(e){e.apply(void 0,t)})},e.prototype.checkArgumentTypes=function(e,t){if(null==e||"string"!=typeof e)throw new TypeError("[Enplug SDK: "+this.version+"] An event name is required to attach an event handler");if(null==t||"function"!=typeof t)throw new TypeError("[Enplug SDK: "+this.version+"] A handler function is required for .on/.off/.once")},e}();t.default=r}.apply(t,r))||(e.exports=i)},function(e,t,n){var r;void 0===(r=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.bridge=e}return e.prototype.report=function(e,t,n,r){void 0===r&&(r="");var i={assetId:e,referenceId:t,playDuration:n};return""!==r&&(i.additionalInfo=r),this.bridge.send("playrecorder","report",i)},e}();t.default=n}.apply(t,[n,t]))||(e.exports=r)},function(e,t,n){var r,i;r=[n,t,n(0)],void 0===(i=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.bridge=e,this.version=n.version}return Object.defineProperty(e.prototype,"all",{get:function(){var e=this;return this.bridge.send("settings","get-all").then(function(t){return console.log("[Enplug SDK: "+e.version+"] Settings: Returning all settings: "+JSON.stringify(t)),t})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"is4K",{get:function(){var e=this;return this.is4KCache?Promise.resolve(this.is4K):this.bridge.send("settings","is4K").then(function(t){return console.log("[Enplug SDK: "+e.version+"] Settings: Returning setting is4k: "+(t&&t.value)),e.is4KCache=t.value,e.is4KCache},function(){return!1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transitionType",{get:function(){var e=this;return this.bridge.send("settings","transition-type").then(function(t){return t&&t.value?(console.log("[Enplug SDK: "+e.version+"] Settings: Returning setting transition-type: "+(t&&t.value)),t.value):"NONE"},function(){return"NONE"})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"whitelabel",{get:function(){var e=this;return this.bridge.send("settings","get-whitelabel").then(function(t){return t&&t.value?(console.log("[Enplug SDK: "+e.version+"] Settings: Returning setting whitelabel: "+(t&&t.value)),t.value):""},function(){return""})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isMuted",{get:function(){var e=this;return this.bridge.send("settings","is-muted").then(function(t){return!(!t||!t.value)&&(console.log("[Enplug SDK: "+e.version+"] Settings: Returning setting is-muted: "+(t&&t.value)),t.value)},function(){return!1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"zoning",{get:function(){var e=this;return this.bridge.send("settings","get-zoning-info").then(function(t){return t&&t.value?(console.log("[Enplug SDK: "+e.version+"] Settings: Returning zoning info: "+JSON.stringify(t.value)),t.value):null})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"locale",{get:function(){var e=this;return this.bridge.send("settings","get-locale").then(function(t){return t&&t.value?(console.log("[Enplug SDK: "+e.version+"] Settings: Returning locale info: "+JSON.stringify(t.value)),t.value):"en"})},enumerable:!0,configurable:!0}),e}();t.default=r}.apply(t,r))||(e.exports=i)},function(e,t,n){var r;void 0===(r=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.bridge=e}return e.prototype.getFeeds=function(){return this.bridge.send("social","get-feeds")},e.prototype.getItems=function(){return this.bridge.send("social","get-items")},e}();t.default=n}.apply(t,[n,t]))||(e.exports=r)},function(e,t,n){var r,i,o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});r=[n,t,n(1)],void 0===(i=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){function t(){var t=e.call(this)||this;return t.destination=t.getQueryParam("origin"),window.epBridge={receive:t.receive.bind(t)},window.addEventListener("message",t.handleIframeMessage.bind(t)),t}return s(t,e),t.prototype.handleIframeMessage=function(e){if(e.origin===this.destination){var t=e.data;if("string"==typeof e.data)try{t=JSON.parse(e.data)}catch(n){t=e.data}this.receive(t)}},t.prototype.sendToPlayer=function(e){var t=this.destination.startsWith("file://")?"*":this.destination;parent.postMessage(e,t)},t.prototype.validateOutboundMessage=function(t){return e.prototype.validateOutboundMessage.call(this,t)},t}(n.default);t.default=r}.apply(t,r))||(e.exports=i)}]).default; | ||
var enplug=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t){e.exports={name:"@enplug/sdk-player",version:"0.10.3",description:"Enplug Player SDK",main:"./src/index.ts",typings:"./src/index.d.ts",scripts:{clean:"rimraf dist/ && mkdirp dist",lint:"tslint -c tslint.json './src/**/*.ts' -e './**/*.d.ts'",test:"karma start test/karma.conf.js",bundle:"npm run clean && webpack",start:"npm-run-all clean lint test",release:"npm run bundle && enplug-release-sdk","release:dev":"npm run bundle && enplug-release-sdk --dev"},repository:{type:"git",url:"git+https://github.com/Enplug/sdk.git"},keywords:["Enplug"],author:"Enplug",license:"ISC",bugs:{url:"https://github.com/Enplug/sdk/issues"},files:["src/","dist/"],homepage:"https://github.com/Enplug/sdk#readme",devDependencies:{"@enplug/scripts":"^1.6.0","@types/jasmine":"^2.6.0","@types/node":"^8.0.45","command-line-args":"^4.0.7","es6-shim":"^0.35.3",fs:"0.0.1-security",inquirer:"^6.0.0","jasmine-core":"^2.8.0",karma:"^1.7.1","karma-chrome-launcher":"^2.2.0","karma-jasmine":"^1.1.0","karma-phantomjs-launcher":"~1.0.4","karma-phantomjs-shim":"~1.5.0","karma-spec-reporter":"0.0.31","karma-typescript":"~3.0.7",mkdirp:"^0.5.1","npm-run-all":"^4.1.1",path:"^0.12.7",rimraf:"^2.6.2",s3:"^4.4.0",shelljs:"^0.7.8","ts-loader":"^3.1.1",tslint:"^5.7.0",typescript:"^2.5.3","uglifyjs-webpack-plugin":"^1.0.1",webpack:"^3.8.1"},config:{destination:"sdk/v1",destinationDev:"sdk/dev/",aws:{buckets:["apps.enplug.in","apps.enplug.com"],s3:{cache:!1,overwrite:!0,region:"us-west-2",sslEnabled:!0,apiVersion:"2016-05-01",params:{ACL:"public-read"}}}}}},function(e,t,n){var r,i;r=[n,t,n(0)],void 0===(i=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.version=n.version,this.resolveMap=new Map}return e.prototype.send=function(e,t,n){var r=this,i=this.getQueryParam("apptoken"),o=this.createToken(),s=this.getAppUrl(),a={service:e,action:t,payload:n,token:o,appToken:i,appUrl:s,playerSdkVersion:this.version};return this.validateOutboundMessage(a)?new Promise(function(e,t){r.resolveMap.set(o,[e,t]),r.sendToPlayer(a)}):Promise.reject("[Enplug SDK: "+this.version+"] Message invalid.")},e.prototype.receive=function(e){if(e&&"object"==typeof e.payload&&!Array.isArray(e.payload)&&(e.payload=this.replaceMediaUrlsWithBlobUrls(e.payload)),e&&Array.isArray(e.payload)){for(var t=[],n=0,r=e.payload;n<r.length;n++){var i=r[n],o=this.replaceMediaUrlsWithBlobUrls(i);t.push(o)}e.payload=t}if(e.token&&this.resolveMap.has(e.token)){var s=this.resolveMap.get(e.token);this.dispatchMessageToApp(e,s)}else"event"===e.service&&this.dispatchEvent(e)},e.prototype.replaceMediaUrlsWithBlobUrls=function(e,t){if(!e)return e;if(!(t=t||e.blobs)||!t.size)return e;for(var n in e)e.hasOwnProperty(n)&&(e[n]&&"object"==typeof e[n]&&"blobs"!==n?e[n]=this.replaceMediaUrlsWithBlobUrls(e[n],t):t.has(e[n])&&(e[n]=window.URL.createObjectURL(t.get(e[n]))));return e},e.prototype.setEventsBus=function(e){this.playerEvents=e},e.prototype.getQueryParam=function(e){var t=new URL(window.location.href).searchParams;return t?t.get(e):""},e.prototype.validateOutboundMessage=function(e){return e&&null!=e.service&&null!=e.action},e.prototype.dispatchMessageToApp=function(e,t){var n=t[0],r=t[1];"error"===e.action?(console.log("[Enplug SDK: "+this.version+"] Error received: "+e.payload.message),r(e.payload)):"reload"===e.action?window.location.reload():n(e.payload)},e.prototype.dispatchEvent=function(e){var t=this;if("destroy"===e.action){this.playerEvents.fireEvent(e.action,function(){return t.send("status","destroy-finished")})}else this.playerEvents.fireEvent(e.action,e.payload)},e.prototype.createToken=function(){var e=Math.random().toString(36).substr(2);return this.resolveMap.has(e)?this.createToken():e},e.prototype.getAppUrl=function(){return""+window.location.host+window.location.pathname},e}();t.default=r}.apply(t,r))||(e.exports=i)},function(e,t,n){var r,i;r=[n,t,n(0),n(4),n(5),n(6),n(7),n(3),n(8),n(9),n(10),n(11),n(12),n(13)],void 0===(i=function(e,t,n,r,i,o,s,a,u,p,l,c,d,f){"use strict";function g(e){var t,g=n.version;e._epBridge?(console.log("[Enplug SDK: "+g+"] Creating bridge from standard implementation (JavaBridge)."),t=new a.default(e._epBridge)):e._epBridgeSend?(console.log("[Enplug SDK: "+g+"] Creating bridge from CEF implementation (CefBridge)."),t=new s.default(e._epBridgeSend)):(console.log("[Enplug SDK: "+g+"] No global sender found. Assuming WebPlayer (WebBridge)."),t=new f.default);var h=new r.default(t),v=new i.default(t),y=new o.default(t),b=new p.default(t),m=new u.default(t),_=new l.default(t),w=new c.default(t),O=new d.default(t);return{appStatus:h,assets:v,cache:y,notifications:m,off:b.off.bind(b),on:b.on.bind(b),once:b.once.bind(b),playRecorder:_,settings:w,social:O}}Object.defineProperty(t,"__esModule",{value:!0}),t.createEnplugPlayerSDK=g,t.default=g(window)}.apply(t,r))||(e.exports=i)},function(e,t,n){var r,i,o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});r=[n,t,n(1)],void 0===(i=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){function t(t){var n=e.call(this)||this;return n.javaGlobal=t,n.javaGlobal.receive=n.receive.bind(n),n}return s(t,e),t.prototype.sendToPlayer=function(e){this.javaGlobal.send(JSON.stringify(e))},t.prototype.receive=function(t){try{var n=JSON.parse(t);e.prototype.receive.call(this,n)}catch(e){}},t}(n.default);t.default=r}.apply(t,r))||(e.exports=i)},function(e,t,n){var r,i;r=[n,t,n(0)],void 0===(i=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.bridge=e,this.canInterruptInternal=!0,this.version=n.version}return e.prototype.start=function(){return this.bridge.send("status","start")},e.prototype.hide=function(){return this.bridge.send("status","hide")},e.prototype.error=function(){return this.bridge.send("status","error")},e.prototype.setCanInterrupt=function(e){var t=this;if("boolean"!=typeof e)return Promise.reject(new TypeError("[Enplug SDK: "+this.version+"] You can only set canInterrupt to a boolean value"));var n=this.canInterruptInternal;return this.canInterruptInternal=e,this.bridge.send("status","set-interrupt",{canInterrupt:e}).then(function(){return e},function(e){return t.canInterruptInternal=n,n})},Object.defineProperty(e.prototype,"canInterrupt",{get:function(){return Promise.resolve(this.canInterruptInternal)},enumerable:!0,configurable:!0}),e.prototype.getTrigger=function(){return this.bridge.send("status","get-trigger")},e.prototype.toggleSound=function(e){return this.bridge.send("status","toggle-sound",{enabled:e})},e}();t.default=r}.apply(t,r))||(e.exports=i)},function(e,t,n){var r;void 0===(r=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.bridge=e}return e.prototype.getList=function(){return this.bridge.send("asset","get-list")},e.prototype.getNext=function(){return this.bridge.send("asset","get-next")},e.prototype.getAsset=function(){return this.bridge.send("asset","get-asset")},e.prototype.getTheme=function(){return this.bridge.send("asset","get-theme")},e}();t.default=n}.apply(t,[n,t]))||(e.exports=r)},function(e,t,n){var r;void 0===(r=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.bridge=e}return e.prototype.getFile=function(e){return this.bridge.send("cache","get-file",e).then(function(t){return t?window.URL.createObjectURL(t):e})},e}();t.default=n}.apply(t,[n,t]))||(e.exports=r)},function(e,t,n){var r,i,o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});r=[n,t,n(1)],void 0===(i=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){function t(t){var n=e.call(this)||this;return n.cefGlobalSend=t,window._epBridge={receive:n.receive.bind(n)},n}return s(t,e),t.prototype.sendToPlayer=function(e){return this.cefGlobalSend({request:JSON.stringify(e),persistent:!1})},t.prototype.receive=function(t){try{var n=JSON.parse(t);e.prototype.receive.call(this,n)}catch(e){}},t}(n.default);t.default=r}.apply(t,r))||(e.exports=i)},function(e,t,n){var r;void 0===(r=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.bridge=e}return e.prototype.post=function(e){return this.bridge.send("notification","post",{message:e}).then(function(e){return e?e.notificationId:""})},e}();t.default=n}.apply(t,[n,t]))||(e.exports=r)},function(e,t,n){var r,i;r=[n,t,n(0)],void 0===(i=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.bridge=e,this.handlerMap=new Map,this.version=n.version,this.bridge.setEventsBus(this)}return e.prototype.on=function(e,t){this.checkArgumentTypes(e,t),this.handlerMap.has(e)?this.handlerMap.get(e).add(t):this.handlerMap.set(e,new Set([t])),this.bridge.send("event","set-listener",{eventName:e})},e.prototype.off=function(e,t){if(this.checkArgumentTypes(e,t),this.handlerMap.has(e)){var n=this.handlerMap.get(e);n.has(t)&&n.delete(t)}},e.prototype.once=function(e,t){var n=this;this.checkArgumentTypes(e,t);var r=function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];n.off(e,r),t.apply(void 0,i)};this.on(e,r)},e.prototype.fireEvent=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this.handlerMap.get(e);r&&r.forEach(function(e){e.apply(void 0,t)})},e.prototype.checkArgumentTypes=function(e,t){if(null==e||"string"!=typeof e)throw new TypeError("[Enplug SDK: "+this.version+"] An event name is required to attach an event handler");if(null==t||"function"!=typeof t)throw new TypeError("[Enplug SDK: "+this.version+"] A handler function is required for .on/.off/.once")},e}();t.default=r}.apply(t,r))||(e.exports=i)},function(e,t,n){var r;void 0===(r=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.bridge=e}return e.prototype.report=function(e,t,n,r){void 0===r&&(r="");var i={assetId:e,referenceId:t,playDuration:n};return""!==r&&(i.additionalInfo=r),this.bridge.send("playrecorder","report",i)},e}();t.default=n}.apply(t,[n,t]))||(e.exports=r)},function(e,t,n){var r,i;r=[n,t,n(0)],void 0===(i=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.bridge=e,this.version=n.version}return Object.defineProperty(e.prototype,"all",{get:function(){var e=this;return this.bridge.send("settings","get-all").then(function(t){return console.log("[Enplug SDK: "+e.version+"] Settings: Returning all settings: "+JSON.stringify(t)),t})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"deviceId",{get:function(){var e=this;return this.bridge.send("settings","get-deviceid").then(function(t){return t&&t.value?(console.log("[Enplug SDK: "+e.version+"] Settings: Returning setting deviveId: "+(t&&t.value)),t.value):""},function(){return""})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"is4K",{get:function(){var e=this;return this.is4KCache?Promise.resolve(this.is4K):this.bridge.send("settings","is4K").then(function(t){return console.log("[Enplug SDK: "+e.version+"] Settings: Returning setting is4k: "+(t&&t.value)),e.is4KCache=t.value,e.is4KCache},function(){return!1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"transitionType",{get:function(){var e=this;return this.bridge.send("settings","transition-type").then(function(t){return t&&t.value?(console.log("[Enplug SDK: "+e.version+"] Settings: Returning setting transition-type: "+(t&&t.value)),t.value):"NONE"},function(){return"NONE"})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"whitelabel",{get:function(){var e=this;return this.bridge.send("settings","get-whitelabel").then(function(t){return t&&t.value?(console.log("[Enplug SDK: "+e.version+"] Settings: Returning setting whitelabel: "+(t&&t.value)),t.value):""},function(){return""})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isMuted",{get:function(){var e=this;return this.bridge.send("settings","is-muted").then(function(t){return!(!t||!t.value)&&(console.log("[Enplug SDK: "+e.version+"] Settings: Returning setting is-muted: "+(t&&t.value)),t.value)},function(){return!1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"zoning",{get:function(){var e=this;return this.bridge.send("settings","get-zoning-info").then(function(t){return t&&t.value?(console.log("[Enplug SDK: "+e.version+"] Settings: Returning zoning info: "+JSON.stringify(t.value)),t.value):null})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"locale",{get:function(){var e=this;return this.bridge.send("settings","get-locale").then(function(t){return t&&t.value?(console.log("[Enplug SDK: "+e.version+"] Settings: Returning locale info: "+JSON.stringify(t.value)),t.value):"en"})},enumerable:!0,configurable:!0}),e}();t.default=r}.apply(t,r))||(e.exports=i)},function(e,t,n){var r;void 0===(r=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.bridge=e}return e.prototype.getFeeds=function(){return this.bridge.send("social","get-feeds")},e.prototype.getItems=function(){return this.bridge.send("social","get-items")},e}();t.default=n}.apply(t,[n,t]))||(e.exports=r)},function(e,t,n){var r,i,o,s=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});r=[n,t,n(1)],void 0===(i=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){function t(){var t=e.call(this)||this;return t.destination=t.getQueryParam("origin"),window.epBridge={receive:t.receive.bind(t)},window.addEventListener("message",t.handleIframeMessage.bind(t)),t}return s(t,e),t.prototype.handleIframeMessage=function(e){if(e.origin===this.destination){var t=e.data;if("string"==typeof e.data)try{t=JSON.parse(e.data)}catch(n){t=e.data}this.receive(t)}},t.prototype.sendToPlayer=function(e){var t=this.destination.startsWith("file://")?"*":this.destination;parent.postMessage(e,t)},t.prototype.validateOutboundMessage=function(t){return e.prototype.validateOutboundMessage.call(this,t)},t}(n.default);t.default=r}.apply(t,r))||(e.exports=i)}]).default; | ||
//# sourceMappingURL=player.js.map |
{ | ||
"name": "@enplug/sdk-player", | ||
"version": "0.10.2", | ||
"version": "0.10.3", | ||
"description": "Enplug Player SDK", | ||
@@ -34,3 +34,3 @@ "main": "./src/index.ts", | ||
"devDependencies": { | ||
"@enplug/scripts": "1.1.15-beta2", | ||
"@enplug/scripts": "^1.6.0", | ||
"@types/jasmine": "^2.6.0", | ||
@@ -64,3 +64,3 @@ "@types/node": "^8.0.45", | ||
"destination": "sdk/v1", | ||
"destinationDev": "sdk/dev", | ||
"destinationDev": "sdk/dev/", | ||
"aws": { | ||
@@ -67,0 +67,0 @@ "buckets": [ |
@@ -32,2 +32,3 @@ /** | ||
const all: Promise<any>; | ||
const deviceId: Promise<string>; | ||
const is4K: Promise<boolean>; | ||
@@ -34,0 +35,0 @@ const isMuted: Promise<boolean>; |
@@ -24,2 +24,13 @@ /** | ||
get deviceId(): Promise<string> { | ||
return this.bridge.send(Service.Settings, Action.GetDeviceId).then((payload) => { | ||
if (payload && payload.value) { | ||
console.log(`[Enplug SDK: ${this.version}] Settings: Returning setting deviveId: ${payload && payload.value}`); | ||
return payload.value as string; | ||
} else { | ||
return ''; | ||
} | ||
}, () => ''); | ||
} | ||
get is4K(): Promise<boolean> { | ||
@@ -26,0 +37,0 @@ if (this.is4KCache) { |
Sorry, the diff of this file is not supported yet
103137
1234