@playkit-js/playkit-js-providers 2.40.0 → 2.40.1
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/CHANGELOG.md +9 -0
- package/dist/playkit-analytics-service.js +1 -1
- package/dist/playkit-bookmark-service.js +1 -1
- package/dist/playkit-ott-provider.js +1 -1
- package/dist/playkit-ovp-provider.js +1 -1
- package/dist/playkit-ovp-provider.js.map +1 -1
- package/dist/playkit-stats-service.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### 2.40.1 (2023-12-21)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **FEC-13566:** remove documents from playlist ([#227](https://github.com/kaltura/playkit-js-providers/issues/227)) ([f2a1cb3](https://github.com/kaltura/playkit-js-providers/commit/f2a1cb3))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
5
14
|
## 2.40.0 (2023-11-26)
|
|
6
15
|
|
|
7
16
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.analytics=t():(e.playkit=e.playkit||{},e.playkit.services=e.playkit.services||{},e.playkit.services.analytics=t())}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=9)}([function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(2);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=function e(t,r,n,o){void 0===o&&(o={}),this.severity=t,this.category=r,this.code=n,this.data=o,e._logger.error("Category:"+r+" | Code:"+n+" |",o)};o(a,"Severity",{RECOVERABLE:1,CRITICAL:2}),o(a,"Category",{NETWORK:1,SERVICE:2,PROVIDER:3}),o(a,"Code",{UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,BAD_SERVER_RESPONSE:1005,MULTIREQUEST_API_ERROR:1006,API_RESPONSE_MISMATCH:1007,ERROR:2e3,BLOCK_ACTION:2001,MEDIA_STATUS_NOT_READY:2002,MISSING_MANDATORY_PARAMS:3e3,MISSING_PLAY_SOURCE:3001,METHOD_NOT_IMPLEMENTED:3002}),o(a,"_logger",Object(n.a)("Error"))},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=function(){function e(e){void 0===e&&(e=new Map),o(this,"retryConfig",{async:!0,timeout:0,maxAttempts:4}),o(this,"_attemptCounter",1),this.headers=e}var t=e.prototype;return t.getUrl=function(e){return e+"/service/"+this.service+(this.action?"/action/"+this.action:"")},t.doHttpRequest=function(){var e=this,t=new Promise((function(t,r){e._requestPromise={resolve:t,reject:r}}));return this.url||this._requestPromise.reject(new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,n.a.Code.MALFORMED_DATA_URI,{url:this.url})),this._createXHR(),t},t._createXHR=function(){var e=this,t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===t.readyState&&200===t.status)try{var r=JSON.parse(t.responseText);return e.responseHeaders=e._getResponseHeaders(t),e._requestPromise.resolve(r)}catch(r){e._requestPromise.reject(e._createError(t,n.a.Code.BAD_SERVER_RESPONSE,{text:t.responseText}))}},t.open(this.method,this.url,this.retryConfig.async),this.retryConfig.async&&this.retryConfig.timeout&&(t.timeout=this.retryConfig.timeout);var r=performance.now();t.ontimeout=function(){e._handleError(t,n.a.Code.TIMEOUT,{timeout:(performance.now()-r)/1e3,statusText:t.statusText})},t.onerror=t.onabort=function(){e._handleError(t,n.a.Code.HTTP_ERROR,{text:t.responseText,statusText:t.statusText})},this.headers.forEach((function(e,r){t.setRequestHeader(r,e)})),t.send(this.params)},t._getResponseHeaders=function(e){return e.getAllResponseHeaders().split("\n").filter((function(e){return 0===e.toLowerCase().indexOf("x-")}))},t._handleError=function(e,t,r){var n=this._createError(e,t,r);if(e.onreadystatechange=function(){},e.onerror=function(){},e.ontimeout=function(){},e.onabort=function(){},!(this.retryConfig.maxAttempts&&this._attemptCounter<this.retryConfig.maxAttempts))return this._requestPromise.reject(n);this._attemptCounter++,this._createXHR()},t._createError=function(e,t,r){return Object.assign(r,{url:this.url,headers:this._getResponseHeaders(e),attempt:this._attemptCounter}),new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,t,r)},e}()},function(e,t,r){"use strict";var n={get:function(){return{VERSION:"",DEBUG:{value:"",name:""},ERROR:{value:"",name:""},INFO:{value:"",name:""},OFF:{value:"",name:""},TIME:{value:"",name:""},TRACE:{value:"",name:""},WARN:{value:"",name:""},createDefaultHandler:function(){},debug:function(){},enabledFor:function(){},error:function(){},get:function(){},getLevel:function(){},info:function(){},log:function(){},setHandler:function(){},setLevel:function(){},time:function(){},timeEnd:function(){},trace:function(){},useDefaults:function(){},warn:function(){}}}};function o(e){return n.get(e)}t.a=o},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(4),o={serviceUrl:"https://cdnapisec.kaltura.com/api_v3",cdnUrl:"https://cdnapisec.kaltura.com",serviceParams:{apiVersion:"3.3.0",format:1},useApiCaptions:!0,loadThumbnailWithKs:!1,replaceHostOnlyManifestUrls:!1},a=function(){function e(){}return e.set=function(e){e&&Object.assign(o,e)},e.get=function(){return Object(n.a)(o)},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function e(t){var r;return Array.isArray(t)?(r=t.length>0?t.slice(0):[]).forEach((function(t,n){("object"==typeof t&&t!=={}||Array.isArray(t)&&t.length>0)&&(r[n]=e(t))})):"object"==typeof t?(r=Object.assign({},t),Object.keys(r).forEach((function(t){("object"==typeof r[t]&&r[t]!=={}||Array.isArray(r[t])&&r[t].length>0)&&(r[t]=e(r[t]))}))):r=t,r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(1),o=r(2);var a=function(e){var t,r,n;n=!1,(r="hasError")in(t=this)?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,"KalturaAPIException"===e.objectType?(this.hasError=!0,this.error=new i(e.code,e.message)):e.error&&"KalturaAPIException"===e.error.objectType?(this.hasError=!0,this.error=new i(e.error.code,e.error.message)):this.data=e},i=function(e,t){this.code=e,this.message=t},s=r(0);function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var f=function(e){var t,r;function n(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return c(u(t=e.call.apply(e,[this].concat(n))||this),"requests",[]),t}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var o=n.prototype;return o.add=function(e){var t;this.requests.push(e);var r={},n={service:e.service,action:e.action};return Object.assign(r,((t={})[this.requests.length]=Object.assign(n,e.params),t)),Object.assign(r,this.params),this.params=r,this},o.execute=function(e){var t=this;return new Promise((function(r,o){try{t.params=JSON.stringify(t.params)}catch(e){n._logger.error(""+e.message),o(new s.a(s.a.Severity.CRITICAL,s.a.Category.PROVIDER,s.a.Code.FAILED_PARSING_REQUEST,{error:e,params:t.params}))}t.doHttpRequest().then((function(n){var a=new l(n,e);a.success?r({headers:t.responseHeaders,response:a}):o(new s.a(s.a.Severity.CRITICAL,s.a.Category.NETWORK,s.a.Code.MULTIREQUEST_API_ERROR,{url:t.url,headers:t.responseHeaders,results:a.results}))}),(function(e){o(e)}))}))},n}(n.a);c(f,"_logger",Object(o.a)("MultiRequestBuilder"));var l=function e(t,r){void 0===r&&(r=!0),c(this,"results",[]);var n=t.result?t.result:t,o=(Array.isArray(n)?n:[n]).map((function(e){return new a(e)})),i=o.filter((function(e){return e.hasError}));i.forEach((function(t){e._logger.error("Service returned an error with error code: "+t.error.code+" and message: "+t.error.message+".")})),this.results=o,r&&i.length||i.length===this.results.length?this.success=!1:(this.results=this.results.filter((function(e){return!e.hasError})),this.success=!0)};c(l,"_logger",Object(o.a)("MultiRequestResult"))},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){var t=[],r=/\[\]$/,n=function(e){return"[object Array]"===Object.prototype.toString.call(e)},o=function(e,r){r="function"==typeof r?r():null==r?"":r,t[t.length]=encodeURIComponent(e)+"="+encodeURIComponent(r)};return function e(a,i){var s,u,c;if(a)if(n(i))for(s=0,u=i.length;s<u;s++)r.test(a)?o(a,i[s]):e(a+":"+("object"==typeof i[s]?s:""),i[s]);else if(i&&"[object Object]"===String(i))for(c in i)e(a+":"+c,i[c]);else o(a,i);else if(n(i))for(s=0,u=i.length;s<u;s++)o(i[s].name,i[s].value);else for(c in i)e(c,i[c]);return t}("",e).join("&").replace(/%20/g,"+")}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(5),o=r(3),a=function(){function e(){}return e.getMultiRequest=function(e,t,r){var a=o.a.get(),i=a.serviceParams;Object.assign(i,{ks:t,clientTag:"html5:v"+e}),r&&Object.assign(i,{partnerId:r});var s=new Map;s.set("Content-Type","application/json");var u=new n.a(s);return u.method="POST",u.service="multirequest",u.url=u.getUrl(a.serviceUrl),u.params=i,u},e}()},,function(e,t,r){"use strict";r.r(t),r.d(t,"OVPAnalyticsService",(function(){return s})),r.d(t,"OVPConfiguration",(function(){return o.a})),r.d(t,"RequestBuilder",(function(){return n.a})),r.d(t,"NAME",(function(){return u})),r.d(t,"VERSION",(function(){return c}));var n=r(1),o=r(3),a=r(7),i=r(6);var s=function(e){var t,r;function a(){return e.apply(this,arguments)||this}return r=e,(t=a).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,a.trackEvent=function(e,t,r){return"POST"===r?a._trackEventByPOST(e,t):a._trackEventByGET(e,t)},a._trackEventByGET=function(e,t){var r=o.a.get(),a={};Object.assign(a,r.serviceParams,t);var s=new n.a;return s.service="analytics",s.action="trackEvent",s.method="GET",s.retryConfig.maxAttempts=1,s.tag="analytics-trackEvent",s.params=a,s.url=e+"?service="+s.service+"&action="+s.action+"&"+Object(i.a)(s.params),s},a._trackEventByPOST=function(e,t){var r=o.a.get(),a={};Object.assign(a,r.serviceParams,t);var s=new Map;s.set("Content-Type","application/json");var u=new n.a(s),c={eventType:a.eventType,partnerId:a.partnerId,entryId:a.entryId,sessionId:a.sessionId};return["eventType","partnerId","entryId","sessionId"].forEach((function(e){return delete a[e]})),u.service="analytics",u.action="trackEvent",u.method="POST",u.retryConfig.maxAttempts=1,u.tag="analytics-trackEvent",u.params=JSON.stringify(a),u.url=e+"?service="+u.service+"&action="+u.action+"&"+Object(i.a)(c),u},a}(a.a),u="@playkit-js/playkit-js-providers-analytics-service",c="2.40.0"}])}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.analytics=t():(e.playkit=e.playkit||{},e.playkit.services=e.playkit.services||{},e.playkit.services.analytics=t())}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=9)}([function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(2);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=function e(t,r,n,o){void 0===o&&(o={}),this.severity=t,this.category=r,this.code=n,this.data=o,e._logger.error("Category:"+r+" | Code:"+n+" |",o)};o(a,"Severity",{RECOVERABLE:1,CRITICAL:2}),o(a,"Category",{NETWORK:1,SERVICE:2,PROVIDER:3}),o(a,"Code",{UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,BAD_SERVER_RESPONSE:1005,MULTIREQUEST_API_ERROR:1006,API_RESPONSE_MISMATCH:1007,ERROR:2e3,BLOCK_ACTION:2001,MEDIA_STATUS_NOT_READY:2002,MISSING_MANDATORY_PARAMS:3e3,MISSING_PLAY_SOURCE:3001,METHOD_NOT_IMPLEMENTED:3002}),o(a,"_logger",Object(n.a)("Error"))},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=function(){function e(e){void 0===e&&(e=new Map),o(this,"retryConfig",{async:!0,timeout:0,maxAttempts:4}),o(this,"_attemptCounter",1),this.headers=e}var t=e.prototype;return t.getUrl=function(e){return e+"/service/"+this.service+(this.action?"/action/"+this.action:"")},t.doHttpRequest=function(){var e=this,t=new Promise((function(t,r){e._requestPromise={resolve:t,reject:r}}));return this.url||this._requestPromise.reject(new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,n.a.Code.MALFORMED_DATA_URI,{url:this.url})),this._createXHR(),t},t._createXHR=function(){var e=this,t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===t.readyState&&200===t.status)try{var r=JSON.parse(t.responseText);return e.responseHeaders=e._getResponseHeaders(t),e._requestPromise.resolve(r)}catch(r){e._requestPromise.reject(e._createError(t,n.a.Code.BAD_SERVER_RESPONSE,{text:t.responseText}))}},t.open(this.method,this.url,this.retryConfig.async),this.retryConfig.async&&this.retryConfig.timeout&&(t.timeout=this.retryConfig.timeout);var r=performance.now();t.ontimeout=function(){e._handleError(t,n.a.Code.TIMEOUT,{timeout:(performance.now()-r)/1e3,statusText:t.statusText})},t.onerror=t.onabort=function(){e._handleError(t,n.a.Code.HTTP_ERROR,{text:t.responseText,statusText:t.statusText})},this.headers.forEach((function(e,r){t.setRequestHeader(r,e)})),t.send(this.params)},t._getResponseHeaders=function(e){return e.getAllResponseHeaders().split("\n").filter((function(e){return 0===e.toLowerCase().indexOf("x-")}))},t._handleError=function(e,t,r){var n=this._createError(e,t,r);if(e.onreadystatechange=function(){},e.onerror=function(){},e.ontimeout=function(){},e.onabort=function(){},!(this.retryConfig.maxAttempts&&this._attemptCounter<this.retryConfig.maxAttempts))return this._requestPromise.reject(n);this._attemptCounter++,this._createXHR()},t._createError=function(e,t,r){return Object.assign(r,{url:this.url,headers:this._getResponseHeaders(e),attempt:this._attemptCounter}),new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,t,r)},e}()},function(e,t,r){"use strict";var n={get:function(){return{VERSION:"",DEBUG:{value:"",name:""},ERROR:{value:"",name:""},INFO:{value:"",name:""},OFF:{value:"",name:""},TIME:{value:"",name:""},TRACE:{value:"",name:""},WARN:{value:"",name:""},createDefaultHandler:function(){},debug:function(){},enabledFor:function(){},error:function(){},get:function(){},getLevel:function(){},info:function(){},log:function(){},setHandler:function(){},setLevel:function(){},time:function(){},timeEnd:function(){},trace:function(){},useDefaults:function(){},warn:function(){}}}};function o(e){return n.get(e)}t.a=o},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(4),o={serviceUrl:"https://cdnapisec.kaltura.com/api_v3",cdnUrl:"https://cdnapisec.kaltura.com",serviceParams:{apiVersion:"3.3.0",format:1},useApiCaptions:!0,loadThumbnailWithKs:!1,replaceHostOnlyManifestUrls:!1},a=function(){function e(){}return e.set=function(e){e&&Object.assign(o,e)},e.get=function(){return Object(n.a)(o)},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function e(t){var r;return Array.isArray(t)?(r=t.length>0?t.slice(0):[]).forEach((function(t,n){("object"==typeof t&&t!=={}||Array.isArray(t)&&t.length>0)&&(r[n]=e(t))})):"object"==typeof t?(r=Object.assign({},t),Object.keys(r).forEach((function(t){("object"==typeof r[t]&&r[t]!=={}||Array.isArray(r[t])&&r[t].length>0)&&(r[t]=e(r[t]))}))):r=t,r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(1),o=r(2);var a=function(e){var t,r,n;n=!1,(r="hasError")in(t=this)?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,"KalturaAPIException"===e.objectType?(this.hasError=!0,this.error=new i(e.code,e.message)):e.error&&"KalturaAPIException"===e.error.objectType?(this.hasError=!0,this.error=new i(e.error.code,e.error.message)):this.data=e},i=function(e,t){this.code=e,this.message=t},s=r(0);function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var f=function(e){var t,r;function n(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return c(u(t=e.call.apply(e,[this].concat(n))||this),"requests",[]),t}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var o=n.prototype;return o.add=function(e){var t;this.requests.push(e);var r={},n={service:e.service,action:e.action};return Object.assign(r,((t={})[this.requests.length]=Object.assign(n,e.params),t)),Object.assign(r,this.params),this.params=r,this},o.execute=function(e){var t=this;return new Promise((function(r,o){try{t.params=JSON.stringify(t.params)}catch(e){n._logger.error(""+e.message),o(new s.a(s.a.Severity.CRITICAL,s.a.Category.PROVIDER,s.a.Code.FAILED_PARSING_REQUEST,{error:e,params:t.params}))}t.doHttpRequest().then((function(n){var a=new l(n,e);a.success?r({headers:t.responseHeaders,response:a}):o(new s.a(s.a.Severity.CRITICAL,s.a.Category.NETWORK,s.a.Code.MULTIREQUEST_API_ERROR,{url:t.url,headers:t.responseHeaders,results:a.results}))}),(function(e){o(e)}))}))},n}(n.a);c(f,"_logger",Object(o.a)("MultiRequestBuilder"));var l=function e(t,r){void 0===r&&(r=!0),c(this,"results",[]);var n=t.result?t.result:t,o=(Array.isArray(n)?n:[n]).map((function(e){return new a(e)})),i=o.filter((function(e){return e.hasError}));i.forEach((function(t){e._logger.error("Service returned an error with error code: "+t.error.code+" and message: "+t.error.message+".")})),this.results=o,r&&i.length||i.length===this.results.length?this.success=!1:(this.results=this.results.filter((function(e){return!e.hasError})),this.success=!0)};c(l,"_logger",Object(o.a)("MultiRequestResult"))},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){var t=[],r=/\[\]$/,n=function(e){return"[object Array]"===Object.prototype.toString.call(e)},o=function(e,r){r="function"==typeof r?r():null==r?"":r,t[t.length]=encodeURIComponent(e)+"="+encodeURIComponent(r)};return function e(a,i){var s,u,c;if(a)if(n(i))for(s=0,u=i.length;s<u;s++)r.test(a)?o(a,i[s]):e(a+":"+("object"==typeof i[s]?s:""),i[s]);else if(i&&"[object Object]"===String(i))for(c in i)e(a+":"+c,i[c]);else o(a,i);else if(n(i))for(s=0,u=i.length;s<u;s++)o(i[s].name,i[s].value);else for(c in i)e(c,i[c]);return t}("",e).join("&").replace(/%20/g,"+")}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(5),o=r(3),a=function(){function e(){}return e.getMultiRequest=function(e,t,r){var a=o.a.get(),i=a.serviceParams;Object.assign(i,{ks:t,clientTag:"html5:v"+e}),r&&Object.assign(i,{partnerId:r});var s=new Map;s.set("Content-Type","application/json");var u=new n.a(s);return u.method="POST",u.service="multirequest",u.url=u.getUrl(a.serviceUrl),u.params=i,u},e}()},,function(e,t,r){"use strict";r.r(t),r.d(t,"OVPAnalyticsService",(function(){return s})),r.d(t,"OVPConfiguration",(function(){return o.a})),r.d(t,"RequestBuilder",(function(){return n.a})),r.d(t,"NAME",(function(){return u})),r.d(t,"VERSION",(function(){return c}));var n=r(1),o=r(3),a=r(7),i=r(6);var s=function(e){var t,r;function a(){return e.apply(this,arguments)||this}return r=e,(t=a).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,a.trackEvent=function(e,t,r){return"POST"===r?a._trackEventByPOST(e,t):a._trackEventByGET(e,t)},a._trackEventByGET=function(e,t){var r=o.a.get(),a={};Object.assign(a,r.serviceParams,t);var s=new n.a;return s.service="analytics",s.action="trackEvent",s.method="GET",s.retryConfig.maxAttempts=1,s.tag="analytics-trackEvent",s.params=a,s.url=e+"?service="+s.service+"&action="+s.action+"&"+Object(i.a)(s.params),s},a._trackEventByPOST=function(e,t){var r=o.a.get(),a={};Object.assign(a,r.serviceParams,t);var s=new Map;s.set("Content-Type","application/json");var u=new n.a(s),c={eventType:a.eventType,partnerId:a.partnerId,entryId:a.entryId,sessionId:a.sessionId};return["eventType","partnerId","entryId","sessionId"].forEach((function(e){return delete a[e]})),u.service="analytics",u.action="trackEvent",u.method="POST",u.retryConfig.maxAttempts=1,u.tag="analytics-trackEvent",u.params=JSON.stringify(a),u.url=e+"?service="+u.service+"&action="+u.action+"&"+Object(i.a)(c),u},a}(a.a),u="@playkit-js/playkit-js-providers-analytics-service",c="2.40.1"}])}));
|
|
2
2
|
//# sourceMappingURL=playkit-analytics-service.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.bookmark=t():(e.playkit=e.playkit||{},e.playkit.services=e.playkit.services||{},e.playkit.services.bookmark=t())}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=8)}([function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(2);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=function e(t,r,n,o){void 0===o&&(o={}),this.severity=t,this.category=r,this.code=n,this.data=o,e._logger.error("Category:"+r+" | Code:"+n+" |",o)};o(a,"Severity",{RECOVERABLE:1,CRITICAL:2}),o(a,"Category",{NETWORK:1,SERVICE:2,PROVIDER:3}),o(a,"Code",{UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,BAD_SERVER_RESPONSE:1005,MULTIREQUEST_API_ERROR:1006,API_RESPONSE_MISMATCH:1007,ERROR:2e3,BLOCK_ACTION:2001,MEDIA_STATUS_NOT_READY:2002,MISSING_MANDATORY_PARAMS:3e3,MISSING_PLAY_SOURCE:3001,METHOD_NOT_IMPLEMENTED:3002}),o(a,"_logger",Object(n.a)("Error"))},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=function(){function e(e){void 0===e&&(e=new Map),o(this,"retryConfig",{async:!0,timeout:0,maxAttempts:4}),o(this,"_attemptCounter",1),this.headers=e}var t=e.prototype;return t.getUrl=function(e){return e+"/service/"+this.service+(this.action?"/action/"+this.action:"")},t.doHttpRequest=function(){var e=this,t=new Promise((function(t,r){e._requestPromise={resolve:t,reject:r}}));return this.url||this._requestPromise.reject(new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,n.a.Code.MALFORMED_DATA_URI,{url:this.url})),this._createXHR(),t},t._createXHR=function(){var e=this,t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===t.readyState&&200===t.status)try{var r=JSON.parse(t.responseText);return e.responseHeaders=e._getResponseHeaders(t),e._requestPromise.resolve(r)}catch(r){e._requestPromise.reject(e._createError(t,n.a.Code.BAD_SERVER_RESPONSE,{text:t.responseText}))}},t.open(this.method,this.url,this.retryConfig.async),this.retryConfig.async&&this.retryConfig.timeout&&(t.timeout=this.retryConfig.timeout);var r=performance.now();t.ontimeout=function(){e._handleError(t,n.a.Code.TIMEOUT,{timeout:(performance.now()-r)/1e3,statusText:t.statusText})},t.onerror=t.onabort=function(){e._handleError(t,n.a.Code.HTTP_ERROR,{text:t.responseText,statusText:t.statusText})},this.headers.forEach((function(e,r){t.setRequestHeader(r,e)})),t.send(this.params)},t._getResponseHeaders=function(e){return e.getAllResponseHeaders().split("\n").filter((function(e){return 0===e.toLowerCase().indexOf("x-")}))},t._handleError=function(e,t,r){var n=this._createError(e,t,r);if(e.onreadystatechange=function(){},e.onerror=function(){},e.ontimeout=function(){},e.onabort=function(){},!(this.retryConfig.maxAttempts&&this._attemptCounter<this.retryConfig.maxAttempts))return this._requestPromise.reject(n);this._attemptCounter++,this._createXHR()},t._createError=function(e,t,r){return Object.assign(r,{url:this.url,headers:this._getResponseHeaders(e),attempt:this._attemptCounter}),new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,t,r)},e}()},function(e,t,r){"use strict";var n={get:function(){return{VERSION:"",DEBUG:{value:"",name:""},ERROR:{value:"",name:""},INFO:{value:"",name:""},OFF:{value:"",name:""},TIME:{value:"",name:""},TRACE:{value:"",name:""},WARN:{value:"",name:""},createDefaultHandler:function(){},debug:function(){},enabledFor:function(){},error:function(){},get:function(){},getLevel:function(){},info:function(){},log:function(){},setHandler:function(){},setLevel:function(){},time:function(){},timeEnd:function(){},trace:function(){},useDefaults:function(){},warn:function(){}}}};function o(e){return n.get(e)}t.a=o},,function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function e(t){var r;return Array.isArray(t)?(r=t.length>0?t.slice(0):[]).forEach((function(t,n){("object"==typeof t&&t!=={}||Array.isArray(t)&&t.length>0)&&(r[n]=e(t))})):"object"==typeof t?(r=Object.assign({},t),Object.keys(r).forEach((function(t){("object"==typeof r[t]&&r[t]!=={}||Array.isArray(r[t])&&r[t].length>0)&&(r[t]=e(r[t]))}))):r=t,r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(1),o=r(2);var a=function(e){var t,r,n;n=!1,(r="hasError")in(t=this)?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,"KalturaAPIException"===e.objectType?(this.hasError=!0,this.error=new i(e.code,e.message)):e.error&&"KalturaAPIException"===e.error.objectType?(this.hasError=!0,this.error=new i(e.error.code,e.error.message)):this.data=e},i=function(e,t){this.code=e,this.message=t},s=r(0);function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var f=function(e){var t,r;function n(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return c(u(t=e.call.apply(e,[this].concat(n))||this),"requests",[]),t}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var o=n.prototype;return o.add=function(e){var t;this.requests.push(e);var r={},n={service:e.service,action:e.action};return Object.assign(r,((t={})[this.requests.length]=Object.assign(n,e.params),t)),Object.assign(r,this.params),this.params=r,this},o.execute=function(e){var t=this;return new Promise((function(r,o){try{t.params=JSON.stringify(t.params)}catch(e){n._logger.error(""+e.message),o(new s.a(s.a.Severity.CRITICAL,s.a.Category.PROVIDER,s.a.Code.FAILED_PARSING_REQUEST,{error:e,params:t.params}))}t.doHttpRequest().then((function(n){var a=new l(n,e);a.success?r({headers:t.responseHeaders,response:a}):o(new s.a(s.a.Severity.CRITICAL,s.a.Category.NETWORK,s.a.Code.MULTIREQUEST_API_ERROR,{url:t.url,headers:t.responseHeaders,results:a.results}))}),(function(e){o(e)}))}))},n}(n.a);c(f,"_logger",Object(o.a)("MultiRequestBuilder"));var l=function e(t,r){void 0===r&&(r=!0),c(this,"results",[]);var n=t.result?t.result:t,o=(Array.isArray(n)?n:[n]).map((function(e){return new a(e)})),i=o.filter((function(e){return e.hasError}));i.forEach((function(t){e._logger.error("Service returned an error with error code: "+t.error.code+" and message: "+t.error.message+".")})),this.results=o,r&&i.length||i.length===this.results.length?this.success=!1:(this.results=this.results.filter((function(e){return!e.hasError})),this.success=!0)};c(l,"_logger",Object(o.a)("MultiRequestResult"))},,,function(e,t,r){"use strict";r.r(t),r.d(t,"OTTBookmarkService",(function(){return u})),r.d(t,"OTTConfiguration",(function(){return i})),r.d(t,"RequestBuilder",(function(){return n.a})),r.d(t,"NAME",(function(){return c})),r.d(t,"VERSION",(function(){return f}));var n=r(1),o=r(4),a={serviceParams:{apiVersion:"7.8.1"}},i=function(){function e(){}return e.set=function(e){e&&Object.assign(a,e)},e.get=function(){return Object(o.a)(a)},e}(),s=r(5);var u=function(e){var t,r;function o(){return e.apply(this,arguments)||this}return r=e,(t=o).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,o.add=function(e,t,r){var o=new Map;o.set("Content-Type","application/json");var a=new n.a(o);a.service="bookmark",a.action="add",a.method="POST",a.url=a.getUrl(e);var s={objectType:"KalturaBookmarkPlayerData",action:r.playerData.action,averageBitrate:r.playerData.averageBitrate,totalBitrate:r.playerData.totalBitrate,currentBitrate:r.playerData.currentBitrate,fileId:r.playerData.fileId},u={objectType:"KalturaBookmark",type:r.type,context:r.context,id:r.id,position:r.position,playerData:s};r.programId&&(u.programId=r.programId);var c=i.get().serviceParams;return Object.assign(c,{bookmark:u,ks:t}),a.params=JSON.stringify(c),a},o}(function(){function e(){}return e.getMultiRequest=function(e,t){var r=i.get(),n=r.serviceParams;e&&Object.assign(n,{ks:e}),t&&Object.assign(n,{partnerId:t});var o=new Map;o.set("Content-Type","application/json");var a=new s.a(o);return a.method="POST",a.service="multirequest",a.url=a.getUrl(r.serviceUrl),a.params=n,a},e}()),c="@playkit-js/playkit-js-providers-bookmark-service",f="2.40.
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.bookmark=t():(e.playkit=e.playkit||{},e.playkit.services=e.playkit.services||{},e.playkit.services.bookmark=t())}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=8)}([function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(2);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=function e(t,r,n,o){void 0===o&&(o={}),this.severity=t,this.category=r,this.code=n,this.data=o,e._logger.error("Category:"+r+" | Code:"+n+" |",o)};o(a,"Severity",{RECOVERABLE:1,CRITICAL:2}),o(a,"Category",{NETWORK:1,SERVICE:2,PROVIDER:3}),o(a,"Code",{UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,BAD_SERVER_RESPONSE:1005,MULTIREQUEST_API_ERROR:1006,API_RESPONSE_MISMATCH:1007,ERROR:2e3,BLOCK_ACTION:2001,MEDIA_STATUS_NOT_READY:2002,MISSING_MANDATORY_PARAMS:3e3,MISSING_PLAY_SOURCE:3001,METHOD_NOT_IMPLEMENTED:3002}),o(a,"_logger",Object(n.a)("Error"))},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=function(){function e(e){void 0===e&&(e=new Map),o(this,"retryConfig",{async:!0,timeout:0,maxAttempts:4}),o(this,"_attemptCounter",1),this.headers=e}var t=e.prototype;return t.getUrl=function(e){return e+"/service/"+this.service+(this.action?"/action/"+this.action:"")},t.doHttpRequest=function(){var e=this,t=new Promise((function(t,r){e._requestPromise={resolve:t,reject:r}}));return this.url||this._requestPromise.reject(new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,n.a.Code.MALFORMED_DATA_URI,{url:this.url})),this._createXHR(),t},t._createXHR=function(){var e=this,t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===t.readyState&&200===t.status)try{var r=JSON.parse(t.responseText);return e.responseHeaders=e._getResponseHeaders(t),e._requestPromise.resolve(r)}catch(r){e._requestPromise.reject(e._createError(t,n.a.Code.BAD_SERVER_RESPONSE,{text:t.responseText}))}},t.open(this.method,this.url,this.retryConfig.async),this.retryConfig.async&&this.retryConfig.timeout&&(t.timeout=this.retryConfig.timeout);var r=performance.now();t.ontimeout=function(){e._handleError(t,n.a.Code.TIMEOUT,{timeout:(performance.now()-r)/1e3,statusText:t.statusText})},t.onerror=t.onabort=function(){e._handleError(t,n.a.Code.HTTP_ERROR,{text:t.responseText,statusText:t.statusText})},this.headers.forEach((function(e,r){t.setRequestHeader(r,e)})),t.send(this.params)},t._getResponseHeaders=function(e){return e.getAllResponseHeaders().split("\n").filter((function(e){return 0===e.toLowerCase().indexOf("x-")}))},t._handleError=function(e,t,r){var n=this._createError(e,t,r);if(e.onreadystatechange=function(){},e.onerror=function(){},e.ontimeout=function(){},e.onabort=function(){},!(this.retryConfig.maxAttempts&&this._attemptCounter<this.retryConfig.maxAttempts))return this._requestPromise.reject(n);this._attemptCounter++,this._createXHR()},t._createError=function(e,t,r){return Object.assign(r,{url:this.url,headers:this._getResponseHeaders(e),attempt:this._attemptCounter}),new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,t,r)},e}()},function(e,t,r){"use strict";var n={get:function(){return{VERSION:"",DEBUG:{value:"",name:""},ERROR:{value:"",name:""},INFO:{value:"",name:""},OFF:{value:"",name:""},TIME:{value:"",name:""},TRACE:{value:"",name:""},WARN:{value:"",name:""},createDefaultHandler:function(){},debug:function(){},enabledFor:function(){},error:function(){},get:function(){},getLevel:function(){},info:function(){},log:function(){},setHandler:function(){},setLevel:function(){},time:function(){},timeEnd:function(){},trace:function(){},useDefaults:function(){},warn:function(){}}}};function o(e){return n.get(e)}t.a=o},,function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function e(t){var r;return Array.isArray(t)?(r=t.length>0?t.slice(0):[]).forEach((function(t,n){("object"==typeof t&&t!=={}||Array.isArray(t)&&t.length>0)&&(r[n]=e(t))})):"object"==typeof t?(r=Object.assign({},t),Object.keys(r).forEach((function(t){("object"==typeof r[t]&&r[t]!=={}||Array.isArray(r[t])&&r[t].length>0)&&(r[t]=e(r[t]))}))):r=t,r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(1),o=r(2);var a=function(e){var t,r,n;n=!1,(r="hasError")in(t=this)?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,"KalturaAPIException"===e.objectType?(this.hasError=!0,this.error=new i(e.code,e.message)):e.error&&"KalturaAPIException"===e.error.objectType?(this.hasError=!0,this.error=new i(e.error.code,e.error.message)):this.data=e},i=function(e,t){this.code=e,this.message=t},s=r(0);function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var f=function(e){var t,r;function n(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return c(u(t=e.call.apply(e,[this].concat(n))||this),"requests",[]),t}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var o=n.prototype;return o.add=function(e){var t;this.requests.push(e);var r={},n={service:e.service,action:e.action};return Object.assign(r,((t={})[this.requests.length]=Object.assign(n,e.params),t)),Object.assign(r,this.params),this.params=r,this},o.execute=function(e){var t=this;return new Promise((function(r,o){try{t.params=JSON.stringify(t.params)}catch(e){n._logger.error(""+e.message),o(new s.a(s.a.Severity.CRITICAL,s.a.Category.PROVIDER,s.a.Code.FAILED_PARSING_REQUEST,{error:e,params:t.params}))}t.doHttpRequest().then((function(n){var a=new l(n,e);a.success?r({headers:t.responseHeaders,response:a}):o(new s.a(s.a.Severity.CRITICAL,s.a.Category.NETWORK,s.a.Code.MULTIREQUEST_API_ERROR,{url:t.url,headers:t.responseHeaders,results:a.results}))}),(function(e){o(e)}))}))},n}(n.a);c(f,"_logger",Object(o.a)("MultiRequestBuilder"));var l=function e(t,r){void 0===r&&(r=!0),c(this,"results",[]);var n=t.result?t.result:t,o=(Array.isArray(n)?n:[n]).map((function(e){return new a(e)})),i=o.filter((function(e){return e.hasError}));i.forEach((function(t){e._logger.error("Service returned an error with error code: "+t.error.code+" and message: "+t.error.message+".")})),this.results=o,r&&i.length||i.length===this.results.length?this.success=!1:(this.results=this.results.filter((function(e){return!e.hasError})),this.success=!0)};c(l,"_logger",Object(o.a)("MultiRequestResult"))},,,function(e,t,r){"use strict";r.r(t),r.d(t,"OTTBookmarkService",(function(){return u})),r.d(t,"OTTConfiguration",(function(){return i})),r.d(t,"RequestBuilder",(function(){return n.a})),r.d(t,"NAME",(function(){return c})),r.d(t,"VERSION",(function(){return f}));var n=r(1),o=r(4),a={serviceParams:{apiVersion:"7.8.1"}},i=function(){function e(){}return e.set=function(e){e&&Object.assign(a,e)},e.get=function(){return Object(o.a)(a)},e}(),s=r(5);var u=function(e){var t,r;function o(){return e.apply(this,arguments)||this}return r=e,(t=o).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,o.add=function(e,t,r){var o=new Map;o.set("Content-Type","application/json");var a=new n.a(o);a.service="bookmark",a.action="add",a.method="POST",a.url=a.getUrl(e);var s={objectType:"KalturaBookmarkPlayerData",action:r.playerData.action,averageBitrate:r.playerData.averageBitrate,totalBitrate:r.playerData.totalBitrate,currentBitrate:r.playerData.currentBitrate,fileId:r.playerData.fileId},u={objectType:"KalturaBookmark",type:r.type,context:r.context,id:r.id,position:r.position,playerData:s};r.programId&&(u.programId=r.programId);var c=i.get().serviceParams;return Object.assign(c,{bookmark:u,ks:t}),a.params=JSON.stringify(c),a},o}(function(){function e(){}return e.getMultiRequest=function(e,t){var r=i.get(),n=r.serviceParams;e&&Object.assign(n,{ks:e}),t&&Object.assign(n,{partnerId:t});var o=new Map;o.set("Content-Type","application/json");var a=new s.a(o);return a.method="POST",a.service="multirequest",a.url=a.getUrl(r.serviceUrl),a.params=n,a},e}()),c="@playkit-js/playkit-js-providers-bookmark-service",f="2.40.1"}])}));
|
|
2
2
|
//# sourceMappingURL=playkit-bookmark-service.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ott=t():(e.playkit=e.playkit||{},e.playkit.providers=e.playkit.providers||{},e.playkit.providers.ott=t())}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=19)}([function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(2);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function e(t,r,n,a){void 0===a&&(a={}),this.severity=t,this.category=r,this.code=n,this.data=a,e._logger.error("Category:"+r+" | Code:"+n+" |",a)};a(i,"Severity",{RECOVERABLE:1,CRITICAL:2}),a(i,"Category",{NETWORK:1,SERVICE:2,PROVIDER:3}),a(i,"Code",{UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,BAD_SERVER_RESPONSE:1005,MULTIREQUEST_API_ERROR:1006,API_RESPONSE_MISMATCH:1007,ERROR:2e3,BLOCK_ACTION:2001,MEDIA_STATUS_NOT_READY:2002,MISSING_MANDATORY_PARAMS:3e3,MISSING_PLAY_SOURCE:3001,METHOD_NOT_IMPLEMENTED:3002}),a(i,"_logger",Object(n.b)("Error"))},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(8);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function(){function e(){this.metadata=new Map,this.sources=new n.a,this.type=e.Type.UNKNOWN}return e.prototype.toJSON=function(){return{id:this.id,name:this.name,sources:this.sources.toJSON(),duration:this.duration,dvrStatus:this.dvrStatus,status:this.status,metadata:this.metadata,type:this.type,poster:this.poster,assetReferenceType:this.assetReferenceType,downloadUrl:this.downloadUrl}},e}();a(i,"Type",{VOD:"Vod",LIVE:"Live",IMAGE:"Image",AUDIO:"Audio",UNKNOWN:"Unknown"}),a(i,"DvrStatus",{ON:1,OFF:0})},function(e,t,r){"use strict";r.d(t,"c",(function(){return o})),r.d(t,"d",(function(){return u})),r.d(t,"e",(function(){return i})),r.d(t,"a",(function(){return a}));var n={get:function(){return{VERSION:"",DEBUG:{value:"",name:""},ERROR:{value:"",name:""},INFO:{value:"",name:""},OFF:{value:"",name:""},TIME:{value:"",name:""},TRACE:{value:"",name:""},WARN:{value:"",name:""},createDefaultHandler:function(){},debug:function(){},enabledFor:function(){},error:function(){},get:function(){},getLevel:function(){},info:function(){},log:function(){},setHandler:function(){},setLevel:function(){},time:function(){},timeEnd:function(){},trace:function(){},useDefaults:function(){},warn:function(){}}}},a={};function i(e){e&&"function"==typeof e.getLogger&&(n.get=e.getLogger),e&&e.LogLevel&&(a=e.LogLevel)}function s(e){return n.get(e)}function o(e){return s(e).getLevel()}function u(e,t){s(t).setLevel(e)}t.b=s},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function(){function e(e){void 0===e&&(e=new Map),a(this,"retryConfig",{async:!0,timeout:0,maxAttempts:4}),a(this,"_attemptCounter",1),this.headers=e}var t=e.prototype;return t.getUrl=function(e){return e+"/service/"+this.service+(this.action?"/action/"+this.action:"")},t.doHttpRequest=function(){var e=this,t=new Promise((function(t,r){e._requestPromise={resolve:t,reject:r}}));return this.url||this._requestPromise.reject(new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,n.a.Code.MALFORMED_DATA_URI,{url:this.url})),this._createXHR(),t},t._createXHR=function(){var e=this,t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===t.readyState&&200===t.status)try{var r=JSON.parse(t.responseText);return e.responseHeaders=e._getResponseHeaders(t),e._requestPromise.resolve(r)}catch(r){e._requestPromise.reject(e._createError(t,n.a.Code.BAD_SERVER_RESPONSE,{text:t.responseText}))}},t.open(this.method,this.url,this.retryConfig.async),this.retryConfig.async&&this.retryConfig.timeout&&(t.timeout=this.retryConfig.timeout);var r=performance.now();t.ontimeout=function(){e._handleError(t,n.a.Code.TIMEOUT,{timeout:(performance.now()-r)/1e3,statusText:t.statusText})},t.onerror=t.onabort=function(){e._handleError(t,n.a.Code.HTTP_ERROR,{text:t.responseText,statusText:t.statusText})},this.headers.forEach((function(e,r){t.setRequestHeader(r,e)})),t.send(this.params)},t._getResponseHeaders=function(e){return e.getAllResponseHeaders().split("\n").filter((function(e){return 0===e.toLowerCase().indexOf("x-")}))},t._handleError=function(e,t,r){var n=this._createError(e,t,r);if(e.onreadystatechange=function(){},e.onerror=function(){},e.ontimeout=function(){},e.onabort=function(){},!(this.retryConfig.maxAttempts&&this._attemptCounter<this.retryConfig.maxAttempts))return this._requestPromise.reject(n);this._attemptCounter++,this._createXHR()},t._createError=function(e,t,r){return Object.assign(r,{url:this.url,headers:this._getResponseHeaders(e),attempt:this._attemptCounter}),new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,t,r)},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){var t,r,n;n=!1,(r="hasError")in(t=this)?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,"KalturaAPIException"===e.objectType?(this.hasError=!0,this.error=new a(e.code,e.message)):e.error&&"KalturaAPIException"===e.error.objectType?(this.hasError=!0,this.error=new a(e.error.code,e.error.message)):this.data=e},a=function(e,t){this.code=e,this.message=t}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return i}));var n={DASH:{name:"dash",mimeType:"application/dash+xml",pathExt:"mpd"},HLS:{name:"hls",mimeType:"application/x-mpegURL",pathExt:"m3u8"},WVM:{name:"wvm",mimeType:"video/wvm",pathExt:"wvm"},MP4:{name:"mp4",mimeType:"video/mp4",pathExt:"mp4"},MP3:{name:"mp3",mimeType:"audio/mpeg",pathExt:"mp3"}},a=new Map([["mpegdash",n.DASH],["applehttp",n.HLS],["url",n.MP4]]);function i(e){var t=a.get(e);return!!t&&t.name===n.MP4.name}},function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n,a,i,s=function(e){this.scheme=e.scheme,this.licenseURL=e.licenseURL,this.certificate=e.certificate};i={"drm.PLAYREADY_CENC":"com.microsoft.playready","drm.WIDEVINE_CENC":"com.widevine.alpha","fairplay.FAIRPLAY":"com.apple.fairplay",WIDEVINE_CENC:"com.widevine.alpha",PLAYREADY_CENC:"com.microsoft.playready",FAIRPLAY:"com.apple.fairplay"},(a="Scheme")in(n=s)?Object.defineProperty(n,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[a]=i},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){this.message=e.message,this.code=e.code}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));r(9);var n=r(5),a=(r(13),function(){function e(){this.progressive=[],this.dash=[],this.hls=[],this.image=[]}var t=e.prototype;return t.map=function(e,t){if(t)switch(t.name){case n.a.MP4.name:this.progressive.push(e);break;case n.a.DASH.name:this.dash.push(e);break;case n.a.HLS.name:this.hls.push(e)}},t.toJSON=function(){var e={progressive:[],dash:[],hls:[],image:[]};return this.progressive.forEach((function(t){return e.progressive.push(t.toJSON())})),this.hls.forEach((function(t){return e.hls.push(t.toJSON())})),this.dash.forEach((function(t){return e.dash.push(t.toJSON())})),e.image=this.image,e},e}())},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));r(12);var n=function(){function e(){}return e.prototype.toJSON=function(){var e={id:this.id,url:this.url,mimetype:this.mimetype};return this.bandwidth&&(e.bandwidth=this.bandwidth),this.width&&(e.width=this.width),this.height&&(e.height=this.height),this.label&&(e.label=this.label),this.drmData&&this.drmData.length>0&&(e.drmData=[],this.drmData.forEach((function(t){Array.isArray(e.drmData)&&e.drmData.push(t.toJSON())}))),e},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));r(11);var n=r(0);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function(){function e(e){a(this,"_loadersResponseMap",new Map),a(this,"_loaders",new Map),this._networkRetryConfig=e}var t=e.prototype;return t.add=function(e,t,r){var n=this,a=new e(t);if(a.isValid()){this._loaders.set(e.id,a);var i=this._multiRequest.requests.length,s=a.requests;this._multiRequest.retryConfig=this._networkRetryConfig,s.forEach((function(e){e.params=e.params||{},e.params.ks=e.params.ks||r,n._multiRequest.add(e)}));var o=Array.from(new Array(s.length),(function(e,t){return t+i}));this._loadersResponseMap.set(e.id,o)}},t.fetchData=function(e){var t=this;return new Promise((function(r,a){t._multiRequest.execute(e).then((function(e){t._multiResponse=e.response,t.prepareData(e.response).success?r(t._loaders):a(new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,n.a.Code.API_RESPONSE_MISMATCH,{headers:e.headers}))}),(function(e){a(e)}))}))},t.prepareData=function(e){var t=this;return this._loaders.forEach((function(r,n){var a=t._loadersResponseMap.get(n);try{a&&a.length>0&&(r.response=e.results.slice(a[0],a[a.length-1]+1))}catch(e){return{success:!1,error:e}}})),{success:!0,data:this._loaders}},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(3),a=r(2),i=r(4),s=r(0);function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var c=function(e){var t,r;function n(){for(var t,r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return u(o(t=e.call.apply(e,[this].concat(n))||this),"requests",[]),t}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var a=n.prototype;return a.add=function(e){var t;this.requests.push(e);var r={},n={service:e.service,action:e.action};return Object.assign(r,((t={})[this.requests.length]=Object.assign(n,e.params),t)),Object.assign(r,this.params),this.params=r,this},a.execute=function(e){var t=this;return new Promise((function(r,a){try{t.params=JSON.stringify(t.params)}catch(e){n._logger.error(""+e.message),a(new s.a(s.a.Severity.CRITICAL,s.a.Category.PROVIDER,s.a.Code.FAILED_PARSING_REQUEST,{error:e,params:t.params}))}t.doHttpRequest().then((function(n){var i=new p(n,e);i.success?r({headers:t.responseHeaders,response:i}):a(new s.a(s.a.Severity.CRITICAL,s.a.Category.NETWORK,s.a.Code.MULTIREQUEST_API_ERROR,{url:t.url,headers:t.responseHeaders,results:i.results}))}),(function(e){a(e)}))}))},n}(n.a);u(c,"_logger",Object(a.b)("MultiRequestBuilder"));var p=function e(t,r){void 0===r&&(r=!0),u(this,"results",[]);var n=t.result?t.result:t,a=(Array.isArray(n)?n:[n]).map((function(e){return new i.a(e)})),s=a.filter((function(e){return e.hasError}));s.forEach((function(t){e._logger.error("Service returned an error with error code: "+t.error.code+" and message: "+t.error.message+".")})),this.results=a,r&&s.length||s.length===this.results.length?this.success=!1:(this.results=this.results.filter((function(e){return!e.hasError})),this.success=!0)};u(p,"_logger",Object(a.b)("MultiRequestResult"))},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){function e(e,t,r){this.licenseUrl=e,this.scheme=t,r&&(this.certificate=r)}return e.prototype.toJSON=function(){var e={licenseUrl:this.licenseUrl,scheme:this.scheme};return this.certificate&&(e.certificate=this.certificate),e},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){function e(t){this.id=t.id,this.url=e.extractBaseThumbnailUrl(t.dataUrl),this.mimetype=""}return e.extractBaseThumbnailUrl=function(e){return e.match(".+entry_id/[a-zA-Z0-9_]+/")[0].slice(0,-1)},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(2),a=(r(10),r(0));function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),e}var o=function(){function e(e,t){var r,a,i;i={async:!0,timeout:0,maxAttempts:4},(a="_networkRetryConfig")in(r=this)?Object.defineProperty(r,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[a]=i,Object(n.e)(e.logger),this._partnerId=e.partnerId,this._widgetId=e.widgetId,this._uiConfId=e.uiConfId,this._isAnonymous=!e.ks,this._ks=e.ks||"",this._playerVersion=t}s(e,[{key:"partnerId",get:function(){return this._partnerId}},{key:"widgetId",get:function(){return this._widgetId||this.defaultWidgetId}},{key:"defaultWidgetId",get:function(){return"_"+this._partnerId}},{key:"uiConfId",get:function(){return this._uiConfId}},{key:"ks",get:function(){return this._ks},set:function(e){this._ks=e}},{key:"playerVersion",get:function(){return this._playerVersion}},{key:"isAnonymous",get:function(){return this._isAnonymous}}]);var t=e.prototype;return t.getMediaConfig=function(e){return Promise.reject(new a.a(a.a.Severity.CRITICAL,a.a.Category.PROVIDER,a.a.Code.METHOD_NOT_IMPLEMENTED,{message:"getMediaConfig method must be implement by the derived class"}))},t.getPlaylistConfig=function(e){return Promise.reject(new a.a(a.a.Severity.CRITICAL,a.a.Category.PROVIDER,a.a.Code.METHOD_NOT_IMPLEMENTED,{message:"The provider does not support loading playlist by id"}))},t.getEntryListConfig=function(e){return Promise.reject(new a.a(a.a.Severity.CRITICAL,a.a.Category.PROVIDER,a.a.Code.METHOD_NOT_IMPLEMENTED,{message:"The provider does not support loading entry list"}))},t._verifyHasSources=function(e){if(0===e.hls.concat(e.dash,e.progressive,e.image).length)throw new a.a(a.a.Severity.CRITICAL,a.a.Category.SERVICE,a.a.Code.MISSING_PLAY_SOURCE,{action:"",messages:"No play source for entry id: "+e.id})},t.getLogLevel=function(e){return Object(n.c)(e)},t.setLogLevel=function(e,t){Object(n.d)(e,t)},s(e,[{key:"LogLevel",get:function(){return n.a}}]),e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function e(t){var r;return Array.isArray(t)?(r=t.length>0?t.slice(0):[]).forEach((function(t,n){("object"==typeof t&&t!=={}||Array.isArray(t)&&t.length>0)&&(r[n]=e(t))})):"object"==typeof t?(r=Object.assign({},t),Object.keys(r).forEach((function(t){("object"==typeof r[t]&&r[t]!=={}||Array.isArray(r[t])&&r[t].length>0)&&(r[t]=e(r[t]))}))):r=t,r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));r(1);var n=function(){this.items=[]}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){this.url=e.url,this.clickThroughUrl=e.clickThroughUrl}},,function(e,t,r){"use strict";r.r(t),r.d(t,"Provider",(function(){return ee})),r.d(t,"ContextType",(function(){return ne})),r.d(t,"MediaType",(function(){return ae})),r.d(t,"NAME",(function(){return te})),r.d(t,"VERSION",(function(){return re}));var n=r(14),a=r(2),i=r(15),s={serviceParams:{apiVersion:"7.8.1"}},o=function(){function e(){}return e.set=function(e){e&&Object.assign(s,e)},e.get=function(){return Object(i.a)(s)},e}(),u=r(10),c=r(11),p=function(){function e(){}return e.getMultiRequest=function(e,t){var r=o.get(),n=r.serviceParams;e&&Object.assign(n,{ks:e}),t&&Object.assign(n,{partnerId:t});var a=new Map;a.set("Content-Type","application/json");var i=new c.a(a);return i.method="POST",i.service="multirequest",i.url=i.getUrl(r.serviceUrl),i.params=n,i},e}();var f=function(e){var t,r;function n(t,r,n){var a;return void 0===r&&(r=""),(a=e.call(this,n)||this)._multiRequest=p.getMultiRequest(r,t),a}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(u.a),d=r(3);var l=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.anonymousLogin=function(e,t,r){var n=new Map;n.set("Content-Type","application/json");var a=new d.a(n);a.service="ottuser",a.action="anonymousLogin",a.method="POST",a.url=a.getUrl(e);var i={partnerId:t};return r&&Object.assign(i,{udid:r}),a.params=i,a},n}(p);function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function y(e,t,r){return t&&h(e.prototype,t),r&&h(e,r),e}var g=function(){function e(e){var t,r,n;n={},(r="_response")in(t=this)?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,this.requests=this.buildRequests(e),this._partnerId=e.partnerId}y(e,null,[{key:"id",get:function(){return"session"}}]);var t=e.prototype;return t.buildRequests=function(e){var t=o.get(),r=[];return r.push(l.anonymousLogin(t.serviceUrl,e.partnerId,e.udid)),r},t.isValid=function(){return!!this._partnerId},y(e,[{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){this._response.ks=e[0].data.ks},get:function(){return this._response.ks}}]),e}();var m=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.getPlaybackContext=function(e,t,r,n,a){var i=new Map;i.set("Content-Type","application/json");var s=new d.a(i);s.service="asset",s.action="getPlaybackContext",s.method="POST",s.url=s.getUrl(e);var o={objectType:"KalturaPlaybackContextOptions"};return Object.assign(o,a),s.params={assetId:r,assetType:n,contextDataParams:o,ks:t},s},n.get=function(e,t,r,n){var a=new Map;a.set("Content-Type","application/json");var i=new d.a(a);return i.service="asset",i.action="get",i.method="POST",i.url=i.getUrl(e),i.params={id:r,assetReferenceType:n,ks:t},i},n}(p),v=r(4),_=r(7);var b,T,E,O=function(e){this.type=e.type};E={BLOCK:"BLOCK",START_DATE_OFFSET:"START_DATE_OFFSET",END_DATE_OFFSET:"END_DATE_OFFSET",USER_BLOCK:"USER_BLOCK",ALLOW_PLAYBACK:"ALLOW_PLAYBACK",BLOCK_PLAYBACK:"BLOCK_PLAYBACK",APPLY_DISCOUNT_MODULE:"APPLY_DISCOUNT_MODULE"},(T="Type")in(b=O)?Object.defineProperty(b,T,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[T]=E;var R=r(6);var I=function(){function e(e){var t=this;!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"drm",[]),this.format=e.format,this.adsPolicy=e.adsPolicy,this.adsParam=e.adsParam,this.duration=e.duration,this.url=e.url,this.type=e.type,this.fileId=e.id,this.protocols=e.protocols,e.drm&&e.drm.map((function(e){return t.drm.push(new R.a(e))}))}var t=e.prototype;return t.hasDrmData=function(){return this.drm&&this.drm.length>0},t.getProtocol=function(e){var t="";if(this.protocols&&this.protocols.length>0)this.protocols.split(",").forEach((function(r){r===e&&(t=r)}));else if("http"===e)return e;return t},e}();var A=function(e){this.streamertype=e.streamertype,this.url=e.url};function C(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(A,"StreamerType",{HLS:"hls",DASH:"dash",PROGRESSIVE:"progressive"});var S=function(e){var t,r;function n(t){var r;if(P(C(r=e.call(this,t)||this),"sources",[]),P(C(r),"actions",[]),P(C(r),"messages",[]),P(C(r),"plugins",[]),!r.hasError){var n=t.messages;n&&n.map((function(e){return r.messages.push(new _.a(e))}));var a=t.actions;a&&a.map((function(e){return r.actions.push(new O(e))}));var i=t.sources;i&&i.map((function(e){return r.sources.push(new I(e))}));var s=t.plugins;s&&s.map((function(e){return r.plugins.push(new A(e))}))}return r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var a=n.prototype;return a.hasBlockAction=function(){return void 0!==this.getBlockAction()},a.getBlockAction=function(){return this.actions.find((function(e){return e.type===O.Type.BLOCK}))},a.getErrorMessages=function(){return this.messages},n}(v.a);function w(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}P(S,"Type",{DOWNLOAD:"DOWNLOAD",TRAILER:"TRAILER",CATCHUP:"CATCHUP",START_OVER:"START_OVER",PLAYBACK:"PLAYBACK"});var L=function(e){var t,r;function n(t){var r;return D(w(r=e.call(this,t)||this),"name",""),D(w(r),"description",""),D(w(r),"tags",[]),D(w(r),"metas",[]),D(w(r),"pictures",[]),r.hasError||(r.id=t.id,r.name=t.name,r.description=t.description,r.createDate=t.createDate,r.endDate=t.endDate,r.plays=t.plays,r.views=t.views,r.metas=r._formatTagsMetas(t.metas),r.tags=r._formatTagsMetas(t.tags),r.pictures=t.images),r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.prototype._formatTagsMetas=function(e){var t=[];return Object.keys(e).forEach((function(r){if(e[r].objects){var n="";e[r].objects.forEach((function(e){n+=e.value+"|"})),t.push({key:r,value:n})}else t.push({key:r,value:e[r].value})})),t},n}(v.a);function k(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function j(e,t,r){return t&&k(e.prototype,t),r&&k(e,r),e}D(L,"Type",{MEDIA:"media",RECORDING:"recording",EPG:"epg"}),D(L,"AssetReferenceType",{MEDIA:"media",EPG_INTERNAL:"epg_internal",EPG_EXTERNAL:"epg_external",NPVR:"nPVR"});var M=function(){function e(e){!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"_response",{}),this.requests=this.buildRequests(e),this._entryId=e.entryId}j(e,null,[{key:"id",get:function(){return"asset"}}]);var t=e.prototype;return t.buildRequests=function(e){var t=o.get(),r=[];return r.push(m.get(t.serviceUrl,e.ks,e.entryId,e.assetReferenceType)),r.push(m.getPlaybackContext(t.serviceUrl,e.ks,e.entryId,e.type,e.playbackContext)),r},t.isValid=function(){return!!this._entryId},j(e,[{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){this._response.mediaDataResult=new L(e[0].data),this._response.playBackContextResult=new S(e[1].data)},get:function(){return this._response}}]),e}();function N(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function x(e,t,r){return t&&N(e.prototype,t),r&&N(e,r),e}var U,B,q,V,H=function(){function e(e){!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"_response",{playlistItems:{entries:[]}}),this.requests=this.buildRequests(e),this._entries=e.entries}x(e,null,[{key:"id",get:function(){return"asset_list"}}]);var t=e.prototype;return t.buildRequests=function(e){var t=o.get(),r=[];return e.entries.forEach((function(n){var a=n.assetReferenceType||L.AssetReferenceType.MEDIA;r.push(m.get(t.serviceUrl,e.ks,n.entryId||n,a))})),r},t.isValid=function(){return!(!this._entries||!this._entries.length)},x(e,[{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){var t=this;e.forEach((function(e){t._response.playlistItems.entries.push({mediaDataResult:new L(e.data)})}))},get:function(){return this._response}}]),e}(),K=r(1),F=r(12),Y=r(9),W=r(8),G=r(16),J=r(17),X=r(5);var Q=((V={})[L.Type.MEDIA]=((U={})[S.Type.TRAILER]=function(){return{type:K.a.Type.VOD}},U[S.Type.PLAYBACK]=function(e){return"KalturaLiveAsset"===e.objectType?{type:K.a.Type.LIVE,dvrStatus:e.enableTrickPlay?K.a.DvrStatus.ON:K.a.DvrStatus.OFF}:parseInt(e.externalIds)>0?{type:K.a.Type.LIVE,dvrStatus:K.a.DvrStatus.OFF}:{type:K.a.Type.VOD}},U),V[L.Type.EPG]=((B={})[S.Type.CATCHUP]=function(){return{type:K.a.Type.VOD}},B[S.Type.START_OVER]=function(){return{type:K.a.Type.LIVE,dvrStatus:K.a.DvrStatus.ON}},B),V[L.Type.RECORDING]=((q={})[S.Type.PLAYBACK]=function(){return{type:K.a.Type.VOD}},q),V),z=function(){function e(){}return e.getMediaEntry=function(t,r){var n=new K.a;e._fillBaseData(n,t,r);var a=t.playBackContextResult,i=t.mediaDataResult,s=a.sources,o=e._filterSourcesByFormats(s,r.formats);n.sources=e._getParsedSources(o);var u=e._getMediaType(i.data,r.mediaType,r.contextType);return n.type=u.type,n.dvrStatus=u.dvrStatus,n.duration=Math.max.apply(Math,s.map((function(e){return e.duration}))),n},e.getEntryList=function(t,r){var n=new G.a;return t.playlistItems.entries.forEach((function(t){var a=new K.a,i=r.find((function(e){return e.entryId===t.mediaDataResult.id}));e._fillBaseData(a,t,i),n.items.push(a)})),n},e.getBumper=function(e){var t=e.playBackContextResult.plugins.find((function(e){return e.streamertype===A.StreamerType.PROGRESSIVE}));if(t)return new J.a(t)},e._fillBaseData=function(t,r,n){var a=r.mediaDataResult,i=e.reconstructMetadata(a);return i.description=a.description,i.name=a.name,a.createDate&&(i.createdAt=a.createDate),a.endDate&&(i.endDate=a.endDate),a.data.entryId&&(i.entryId=a.data.entryId),a.data.epgId&&(i.epgId=a.data.epgId),a.data.recordingId&&(i.recordingId=a.data.recordingId),n&&n.mediaType&&(i.mediaType=n.mediaType),n&&n.contextType&&(i.contextType=n.contextType),t.metadata=i,t.poster=e._getPoster(a.pictures),t.id=a.id,t},e.reconstructMetadata=function(t){return{metas:e.addToMetaObject(t.metas),tags:e.addToMetaObject(t.tags)}},e.addToMetaObject=function(e){var t={};return e&&e.forEach((function(e){t[e.key]=e.value})),t},e._getPoster=function(e){if(e&&e.length>0){var t=e[0].url;return/.*\/thumbnail\/.*(?:width|height)\/\d+\/(?:height|width)\/\d+/.test(t)?t:e.map((function(e){return{url:e.url,width:e.width,height:e.height}}))}return""},e._getMediaType=function(e,t,r){var n={type:K.a.Type.UNKNOWN};return Q[t]&&Q[t][r]&&(n=Q[t][r](e)),n},e._filterSourcesByFormats=function(e,t){return t.length>0&&(e=e.filter((function(e){return t.includes(e.type)}))),e},e._getParsedSources=function(t){var r=new W.a,n=function(t){var n=e._parseAdaptiveSource(t);if(n){var a=X.b.get(t.format);r.map(n,a)}};return t&&t.length>0&&(t.filter((function(e){return!Object(X.c)(e.format)})).forEach(n),t.filter((function(e){return Object(X.c)(e.format)})).forEach(n)),r},e._parseAdaptiveSource=function(t){var r=new Y.a;if(t){var n=t.url,a=X.b.get(t.format);if(a&&(r.mimetype=a.mimeType),!n)return e._logger.error("failed to create play url from source, discarding source: ("+t.fileId+"), "+t.format+"."),null;if(r.url=n,r.id=t.fileId+","+t.format,t.hasDrmData()){var i=[];t.drm.forEach((function(e){i.push(new F.a(e.licenseURL,R.a.Scheme[e.scheme],e.certificate))})),r.drmData=i}}return r},e.hasBlockAction=function(e){return e.playBackContextResult.hasBlockAction()},e.getBlockAction=function(e){return e.playBackContextResult.getBlockAction()},e.getErrorMessages=function(e){return e.playBackContextResult.getErrorMessages()},e}();!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(z,"_logger",Object(a.b)("OTTProviderParser"));var Z=r(0);function $(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var ee=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this)._logger=Object(a.b)("OTTProvider"),o.set(t.env),n._networkRetryConfig=Object.assign(n._networkRetryConfig,t.networkRetryParameters),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var i,s,u,c=n.prototype;return c.getMediaConfig=function(e){var t=this;return e.ks&&(this.ks=e.ks,this._isAnonymous=!1),this._dataLoader=new f(this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var a=e.entryId;if(a){var i=t.ks;i||(i="{1:result:ks}",t._dataLoader.add(g,{partnerId:t.partnerId}));var s=e.contextType||S.Type.PLAYBACK,o=e.mediaType||L.Type.MEDIA,u=e.assetReferenceType||L.AssetReferenceType.MEDIA,c={mediaProtocol:e.protocol,assetFileIds:e.fileIds,context:s};e.streamerType&&(c.streamerType=e.streamerType),e.urlType&&(c.urlType=e.urlType),e.adapterData&&(c.adapterData=e.adapterData),t._dataLoader.add(M,{entryId:a,ks:i,type:o,playbackContext:c,assetReferenceType:u});var p={contextType:s,mediaType:o,formats:e.formats||[]};return t._dataLoader.fetchData().then((function(e){try{r(t._parseDataFromResponse(e,p))}catch(e){n(e)}}),(function(e){n(e)}))}n(new Z.a(Z.a.Severity.CRITICAL,Z.a.Category.PROVIDER,Z.a.Code.MISSING_MANDATORY_PARAMS,{message:"missing entry id"}))}))},c._parseDataFromResponse=function(e,t){this._logger.debug("Data parsing started");var r={session:{isAnonymous:this._isAnonymous,partnerId:this.partnerId},sources:this._getDefaultSourcesObject(),plugins:{}};if(this.uiConfId&&(r.session.uiConfId=this.uiConfId),e){if(e.has(g.id)){var n=e.get(g.id);n&&n.response&&(r.session.ks=n.response)}else r.session.ks=this.ks;if(e.has(M.id)){var a=e.get(M.id);if(a&&a.response&&Object.keys(a.response).length){var i=a.response;if(z.hasBlockAction(i))throw new Z.a(Z.a.Severity.CRITICAL,Z.a.Category.SERVICE,Z.a.Code.BLOCK_ACTION,{action:z.getBlockAction(i),messages:z.getErrorMessages(i)});var s=z.getMediaEntry(i,t);Object.assign(r.sources,this._getSourcesObject(s)),this._verifyHasSources(r.sources);var o=z.getBumper(i);o&&Object.assign(r.plugins,{bumper:o})}}}return this._logger.debug("Data parsing finished",r),r},c.getEntryListConfig=function(e){var t=this;return e.ks&&(this.ks=e.ks,this._isAnonymous=!1),this._dataLoader=new f(this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var a=e.entries;if(a&&a.length){var i=t.ks;i||(i="{1:result:ks}",t._dataLoader.add(g,{partnerId:t.partnerId})),t._dataLoader.add(H,{entries:a,ks:i}),t._dataLoader.fetchData(!1).then((function(e){r(t._parseEntryListDataFromResponse(e,a))}),(function(e){n(e)}))}else n({success:!1,data:"Missing mandatory parameter"})}))},c._parseEntryListDataFromResponse=function(e,t){var r=this;this._logger.debug("Data parsing started");var n={id:"",metadata:{name:"",description:""},poster:"",items:[],playlistLastEntryId:""};if(e&&e.has(H.id)){var a=e.get(H.id);if(a&&a.response)z.getEntryList(a.response,t).items.forEach((function(e){return n.items.push({sources:r._getSourcesObject(e)})}))}return this._logger.debug("Data parsing finished",n),n},c._getDefaultSourcesObject=function(){return{hls:[],dash:[],progressive:[],image:[],id:"",duration:0,type:K.a.Type.UNKNOWN,poster:"",dvr:!1,vr:null,metadata:{name:"",description:"",tags:""}}},c._getSourcesObject=function(e){var t=this._getDefaultSourcesObject(),r=e.sources.toJSON();return t.hls=r.hls,t.dash=r.dash,t.progressive=r.progressive,t.id=e.id,t.duration=e.duration,t.type=e.type,t.dvr=!!e.dvrStatus,t.poster=e.poster,e.metadata&&e.metadata.metas&&"string"==typeof e.metadata.metas.tags&&e.metadata.metas.tags.indexOf("360")>-1&&(t.vr={}),Object.assign(t.metadata,e.metadata),t},i=n,(s=[{key:"env",get:function(){return o.get()}}])&&$(i.prototype,s),u&&$(i,u),n}(n.a),te="@playkit-js/playkit-js-providers-ott",re="2.40.0",ne=S.Type,ae=L.Type}])}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ott=t():(e.playkit=e.playkit||{},e.playkit.providers=e.playkit.providers||{},e.playkit.providers.ott=t())}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=19)}([function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(2);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function e(t,r,n,a){void 0===a&&(a={}),this.severity=t,this.category=r,this.code=n,this.data=a,e._logger.error("Category:"+r+" | Code:"+n+" |",a)};a(i,"Severity",{RECOVERABLE:1,CRITICAL:2}),a(i,"Category",{NETWORK:1,SERVICE:2,PROVIDER:3}),a(i,"Code",{UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,BAD_SERVER_RESPONSE:1005,MULTIREQUEST_API_ERROR:1006,API_RESPONSE_MISMATCH:1007,ERROR:2e3,BLOCK_ACTION:2001,MEDIA_STATUS_NOT_READY:2002,MISSING_MANDATORY_PARAMS:3e3,MISSING_PLAY_SOURCE:3001,METHOD_NOT_IMPLEMENTED:3002}),a(i,"_logger",Object(n.b)("Error"))},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(8);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function(){function e(){this.metadata=new Map,this.sources=new n.a,this.type=e.Type.UNKNOWN}return e.prototype.toJSON=function(){return{id:this.id,name:this.name,sources:this.sources.toJSON(),duration:this.duration,dvrStatus:this.dvrStatus,status:this.status,metadata:this.metadata,type:this.type,poster:this.poster,assetReferenceType:this.assetReferenceType,downloadUrl:this.downloadUrl}},e}();a(i,"Type",{VOD:"Vod",LIVE:"Live",IMAGE:"Image",AUDIO:"Audio",UNKNOWN:"Unknown"}),a(i,"DvrStatus",{ON:1,OFF:0})},function(e,t,r){"use strict";r.d(t,"c",(function(){return o})),r.d(t,"d",(function(){return u})),r.d(t,"e",(function(){return i})),r.d(t,"a",(function(){return a}));var n={get:function(){return{VERSION:"",DEBUG:{value:"",name:""},ERROR:{value:"",name:""},INFO:{value:"",name:""},OFF:{value:"",name:""},TIME:{value:"",name:""},TRACE:{value:"",name:""},WARN:{value:"",name:""},createDefaultHandler:function(){},debug:function(){},enabledFor:function(){},error:function(){},get:function(){},getLevel:function(){},info:function(){},log:function(){},setHandler:function(){},setLevel:function(){},time:function(){},timeEnd:function(){},trace:function(){},useDefaults:function(){},warn:function(){}}}},a={};function i(e){e&&"function"==typeof e.getLogger&&(n.get=e.getLogger),e&&e.LogLevel&&(a=e.LogLevel)}function s(e){return n.get(e)}function o(e){return s(e).getLevel()}function u(e,t){s(t).setLevel(e)}t.b=s},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function(){function e(e){void 0===e&&(e=new Map),a(this,"retryConfig",{async:!0,timeout:0,maxAttempts:4}),a(this,"_attemptCounter",1),this.headers=e}var t=e.prototype;return t.getUrl=function(e){return e+"/service/"+this.service+(this.action?"/action/"+this.action:"")},t.doHttpRequest=function(){var e=this,t=new Promise((function(t,r){e._requestPromise={resolve:t,reject:r}}));return this.url||this._requestPromise.reject(new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,n.a.Code.MALFORMED_DATA_URI,{url:this.url})),this._createXHR(),t},t._createXHR=function(){var e=this,t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===t.readyState&&200===t.status)try{var r=JSON.parse(t.responseText);return e.responseHeaders=e._getResponseHeaders(t),e._requestPromise.resolve(r)}catch(r){e._requestPromise.reject(e._createError(t,n.a.Code.BAD_SERVER_RESPONSE,{text:t.responseText}))}},t.open(this.method,this.url,this.retryConfig.async),this.retryConfig.async&&this.retryConfig.timeout&&(t.timeout=this.retryConfig.timeout);var r=performance.now();t.ontimeout=function(){e._handleError(t,n.a.Code.TIMEOUT,{timeout:(performance.now()-r)/1e3,statusText:t.statusText})},t.onerror=t.onabort=function(){e._handleError(t,n.a.Code.HTTP_ERROR,{text:t.responseText,statusText:t.statusText})},this.headers.forEach((function(e,r){t.setRequestHeader(r,e)})),t.send(this.params)},t._getResponseHeaders=function(e){return e.getAllResponseHeaders().split("\n").filter((function(e){return 0===e.toLowerCase().indexOf("x-")}))},t._handleError=function(e,t,r){var n=this._createError(e,t,r);if(e.onreadystatechange=function(){},e.onerror=function(){},e.ontimeout=function(){},e.onabort=function(){},!(this.retryConfig.maxAttempts&&this._attemptCounter<this.retryConfig.maxAttempts))return this._requestPromise.reject(n);this._attemptCounter++,this._createXHR()},t._createError=function(e,t,r){return Object.assign(r,{url:this.url,headers:this._getResponseHeaders(e),attempt:this._attemptCounter}),new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,t,r)},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){var t,r,n;n=!1,(r="hasError")in(t=this)?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,"KalturaAPIException"===e.objectType?(this.hasError=!0,this.error=new a(e.code,e.message)):e.error&&"KalturaAPIException"===e.error.objectType?(this.hasError=!0,this.error=new a(e.error.code,e.error.message)):this.data=e},a=function(e,t){this.code=e,this.message=t}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return i}));var n={DASH:{name:"dash",mimeType:"application/dash+xml",pathExt:"mpd"},HLS:{name:"hls",mimeType:"application/x-mpegURL",pathExt:"m3u8"},WVM:{name:"wvm",mimeType:"video/wvm",pathExt:"wvm"},MP4:{name:"mp4",mimeType:"video/mp4",pathExt:"mp4"},MP3:{name:"mp3",mimeType:"audio/mpeg",pathExt:"mp3"}},a=new Map([["mpegdash",n.DASH],["applehttp",n.HLS],["url",n.MP4]]);function i(e){var t=a.get(e);return!!t&&t.name===n.MP4.name}},function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n,a,i,s=function(e){this.scheme=e.scheme,this.licenseURL=e.licenseURL,this.certificate=e.certificate};i={"drm.PLAYREADY_CENC":"com.microsoft.playready","drm.WIDEVINE_CENC":"com.widevine.alpha","fairplay.FAIRPLAY":"com.apple.fairplay",WIDEVINE_CENC:"com.widevine.alpha",PLAYREADY_CENC:"com.microsoft.playready",FAIRPLAY:"com.apple.fairplay"},(a="Scheme")in(n=s)?Object.defineProperty(n,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[a]=i},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){this.message=e.message,this.code=e.code}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));r(9);var n=r(5),a=(r(13),function(){function e(){this.progressive=[],this.dash=[],this.hls=[],this.image=[]}var t=e.prototype;return t.map=function(e,t){if(t)switch(t.name){case n.a.MP4.name:this.progressive.push(e);break;case n.a.DASH.name:this.dash.push(e);break;case n.a.HLS.name:this.hls.push(e)}},t.toJSON=function(){var e={progressive:[],dash:[],hls:[],image:[]};return this.progressive.forEach((function(t){return e.progressive.push(t.toJSON())})),this.hls.forEach((function(t){return e.hls.push(t.toJSON())})),this.dash.forEach((function(t){return e.dash.push(t.toJSON())})),e.image=this.image,e},e}())},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));r(12);var n=function(){function e(){}return e.prototype.toJSON=function(){var e={id:this.id,url:this.url,mimetype:this.mimetype};return this.bandwidth&&(e.bandwidth=this.bandwidth),this.width&&(e.width=this.width),this.height&&(e.height=this.height),this.label&&(e.label=this.label),this.drmData&&this.drmData.length>0&&(e.drmData=[],this.drmData.forEach((function(t){Array.isArray(e.drmData)&&e.drmData.push(t.toJSON())}))),e},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));r(11);var n=r(0);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function(){function e(e){a(this,"_loadersResponseMap",new Map),a(this,"_loaders",new Map),this._networkRetryConfig=e}var t=e.prototype;return t.add=function(e,t,r){var n=this,a=new e(t);if(a.isValid()){this._loaders.set(e.id,a);var i=this._multiRequest.requests.length,s=a.requests;this._multiRequest.retryConfig=this._networkRetryConfig,s.forEach((function(e){e.params=e.params||{},e.params.ks=e.params.ks||r,n._multiRequest.add(e)}));var o=Array.from(new Array(s.length),(function(e,t){return t+i}));this._loadersResponseMap.set(e.id,o)}},t.fetchData=function(e){var t=this;return new Promise((function(r,a){t._multiRequest.execute(e).then((function(e){t._multiResponse=e.response,t.prepareData(e.response).success?r(t._loaders):a(new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,n.a.Code.API_RESPONSE_MISMATCH,{headers:e.headers}))}),(function(e){a(e)}))}))},t.prepareData=function(e){var t=this;return this._loaders.forEach((function(r,n){var a=t._loadersResponseMap.get(n);try{a&&a.length>0&&(r.response=e.results.slice(a[0],a[a.length-1]+1))}catch(e){return{success:!1,error:e}}})),{success:!0,data:this._loaders}},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(3),a=r(2),i=r(4),s=r(0);function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var c=function(e){var t,r;function n(){for(var t,r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return u(o(t=e.call.apply(e,[this].concat(n))||this),"requests",[]),t}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var a=n.prototype;return a.add=function(e){var t;this.requests.push(e);var r={},n={service:e.service,action:e.action};return Object.assign(r,((t={})[this.requests.length]=Object.assign(n,e.params),t)),Object.assign(r,this.params),this.params=r,this},a.execute=function(e){var t=this;return new Promise((function(r,a){try{t.params=JSON.stringify(t.params)}catch(e){n._logger.error(""+e.message),a(new s.a(s.a.Severity.CRITICAL,s.a.Category.PROVIDER,s.a.Code.FAILED_PARSING_REQUEST,{error:e,params:t.params}))}t.doHttpRequest().then((function(n){var i=new p(n,e);i.success?r({headers:t.responseHeaders,response:i}):a(new s.a(s.a.Severity.CRITICAL,s.a.Category.NETWORK,s.a.Code.MULTIREQUEST_API_ERROR,{url:t.url,headers:t.responseHeaders,results:i.results}))}),(function(e){a(e)}))}))},n}(n.a);u(c,"_logger",Object(a.b)("MultiRequestBuilder"));var p=function e(t,r){void 0===r&&(r=!0),u(this,"results",[]);var n=t.result?t.result:t,a=(Array.isArray(n)?n:[n]).map((function(e){return new i.a(e)})),s=a.filter((function(e){return e.hasError}));s.forEach((function(t){e._logger.error("Service returned an error with error code: "+t.error.code+" and message: "+t.error.message+".")})),this.results=a,r&&s.length||s.length===this.results.length?this.success=!1:(this.results=this.results.filter((function(e){return!e.hasError})),this.success=!0)};u(p,"_logger",Object(a.b)("MultiRequestResult"))},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){function e(e,t,r){this.licenseUrl=e,this.scheme=t,r&&(this.certificate=r)}return e.prototype.toJSON=function(){var e={licenseUrl:this.licenseUrl,scheme:this.scheme};return this.certificate&&(e.certificate=this.certificate),e},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){function e(t){this.id=t.id,this.url=e.extractBaseThumbnailUrl(t.dataUrl),this.mimetype=""}return e.extractBaseThumbnailUrl=function(e){return e.match(".+entry_id/[a-zA-Z0-9_]+/")[0].slice(0,-1)},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(2),a=(r(10),r(0));function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),e}var o=function(){function e(e,t){var r,a,i;i={async:!0,timeout:0,maxAttempts:4},(a="_networkRetryConfig")in(r=this)?Object.defineProperty(r,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[a]=i,Object(n.e)(e.logger),this._partnerId=e.partnerId,this._widgetId=e.widgetId,this._uiConfId=e.uiConfId,this._isAnonymous=!e.ks,this._ks=e.ks||"",this._playerVersion=t}s(e,[{key:"partnerId",get:function(){return this._partnerId}},{key:"widgetId",get:function(){return this._widgetId||this.defaultWidgetId}},{key:"defaultWidgetId",get:function(){return"_"+this._partnerId}},{key:"uiConfId",get:function(){return this._uiConfId}},{key:"ks",get:function(){return this._ks},set:function(e){this._ks=e}},{key:"playerVersion",get:function(){return this._playerVersion}},{key:"isAnonymous",get:function(){return this._isAnonymous}}]);var t=e.prototype;return t.getMediaConfig=function(e){return Promise.reject(new a.a(a.a.Severity.CRITICAL,a.a.Category.PROVIDER,a.a.Code.METHOD_NOT_IMPLEMENTED,{message:"getMediaConfig method must be implement by the derived class"}))},t.getPlaylistConfig=function(e){return Promise.reject(new a.a(a.a.Severity.CRITICAL,a.a.Category.PROVIDER,a.a.Code.METHOD_NOT_IMPLEMENTED,{message:"The provider does not support loading playlist by id"}))},t.getEntryListConfig=function(e){return Promise.reject(new a.a(a.a.Severity.CRITICAL,a.a.Category.PROVIDER,a.a.Code.METHOD_NOT_IMPLEMENTED,{message:"The provider does not support loading entry list"}))},t._verifyHasSources=function(e){if(0===e.hls.concat(e.dash,e.progressive,e.image).length)throw new a.a(a.a.Severity.CRITICAL,a.a.Category.SERVICE,a.a.Code.MISSING_PLAY_SOURCE,{action:"",messages:"No play source for entry id: "+e.id})},t.getLogLevel=function(e){return Object(n.c)(e)},t.setLogLevel=function(e,t){Object(n.d)(e,t)},s(e,[{key:"LogLevel",get:function(){return n.a}}]),e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function e(t){var r;return Array.isArray(t)?(r=t.length>0?t.slice(0):[]).forEach((function(t,n){("object"==typeof t&&t!=={}||Array.isArray(t)&&t.length>0)&&(r[n]=e(t))})):"object"==typeof t?(r=Object.assign({},t),Object.keys(r).forEach((function(t){("object"==typeof r[t]&&r[t]!=={}||Array.isArray(r[t])&&r[t].length>0)&&(r[t]=e(r[t]))}))):r=t,r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));r(1);var n=function(){this.items=[]}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){this.url=e.url,this.clickThroughUrl=e.clickThroughUrl}},,function(e,t,r){"use strict";r.r(t),r.d(t,"Provider",(function(){return ee})),r.d(t,"ContextType",(function(){return ne})),r.d(t,"MediaType",(function(){return ae})),r.d(t,"NAME",(function(){return te})),r.d(t,"VERSION",(function(){return re}));var n=r(14),a=r(2),i=r(15),s={serviceParams:{apiVersion:"7.8.1"}},o=function(){function e(){}return e.set=function(e){e&&Object.assign(s,e)},e.get=function(){return Object(i.a)(s)},e}(),u=r(10),c=r(11),p=function(){function e(){}return e.getMultiRequest=function(e,t){var r=o.get(),n=r.serviceParams;e&&Object.assign(n,{ks:e}),t&&Object.assign(n,{partnerId:t});var a=new Map;a.set("Content-Type","application/json");var i=new c.a(a);return i.method="POST",i.service="multirequest",i.url=i.getUrl(r.serviceUrl),i.params=n,i},e}();var f=function(e){var t,r;function n(t,r,n){var a;return void 0===r&&(r=""),(a=e.call(this,n)||this)._multiRequest=p.getMultiRequest(r,t),a}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(u.a),d=r(3);var l=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.anonymousLogin=function(e,t,r){var n=new Map;n.set("Content-Type","application/json");var a=new d.a(n);a.service="ottuser",a.action="anonymousLogin",a.method="POST",a.url=a.getUrl(e);var i={partnerId:t};return r&&Object.assign(i,{udid:r}),a.params=i,a},n}(p);function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function y(e,t,r){return t&&h(e.prototype,t),r&&h(e,r),e}var g=function(){function e(e){var t,r,n;n={},(r="_response")in(t=this)?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,this.requests=this.buildRequests(e),this._partnerId=e.partnerId}y(e,null,[{key:"id",get:function(){return"session"}}]);var t=e.prototype;return t.buildRequests=function(e){var t=o.get(),r=[];return r.push(l.anonymousLogin(t.serviceUrl,e.partnerId,e.udid)),r},t.isValid=function(){return!!this._partnerId},y(e,[{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){this._response.ks=e[0].data.ks},get:function(){return this._response.ks}}]),e}();var m=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.getPlaybackContext=function(e,t,r,n,a){var i=new Map;i.set("Content-Type","application/json");var s=new d.a(i);s.service="asset",s.action="getPlaybackContext",s.method="POST",s.url=s.getUrl(e);var o={objectType:"KalturaPlaybackContextOptions"};return Object.assign(o,a),s.params={assetId:r,assetType:n,contextDataParams:o,ks:t},s},n.get=function(e,t,r,n){var a=new Map;a.set("Content-Type","application/json");var i=new d.a(a);return i.service="asset",i.action="get",i.method="POST",i.url=i.getUrl(e),i.params={id:r,assetReferenceType:n,ks:t},i},n}(p),v=r(4),_=r(7);var b,T,E,O=function(e){this.type=e.type};E={BLOCK:"BLOCK",START_DATE_OFFSET:"START_DATE_OFFSET",END_DATE_OFFSET:"END_DATE_OFFSET",USER_BLOCK:"USER_BLOCK",ALLOW_PLAYBACK:"ALLOW_PLAYBACK",BLOCK_PLAYBACK:"BLOCK_PLAYBACK",APPLY_DISCOUNT_MODULE:"APPLY_DISCOUNT_MODULE"},(T="Type")in(b=O)?Object.defineProperty(b,T,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[T]=E;var R=r(6);var I=function(){function e(e){var t=this;!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"drm",[]),this.format=e.format,this.adsPolicy=e.adsPolicy,this.adsParam=e.adsParam,this.duration=e.duration,this.url=e.url,this.type=e.type,this.fileId=e.id,this.protocols=e.protocols,e.drm&&e.drm.map((function(e){return t.drm.push(new R.a(e))}))}var t=e.prototype;return t.hasDrmData=function(){return this.drm&&this.drm.length>0},t.getProtocol=function(e){var t="";if(this.protocols&&this.protocols.length>0)this.protocols.split(",").forEach((function(r){r===e&&(t=r)}));else if("http"===e)return e;return t},e}();var A=function(e){this.streamertype=e.streamertype,this.url=e.url};function C(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(A,"StreamerType",{HLS:"hls",DASH:"dash",PROGRESSIVE:"progressive"});var S=function(e){var t,r;function n(t){var r;if(P(C(r=e.call(this,t)||this),"sources",[]),P(C(r),"actions",[]),P(C(r),"messages",[]),P(C(r),"plugins",[]),!r.hasError){var n=t.messages;n&&n.map((function(e){return r.messages.push(new _.a(e))}));var a=t.actions;a&&a.map((function(e){return r.actions.push(new O(e))}));var i=t.sources;i&&i.map((function(e){return r.sources.push(new I(e))}));var s=t.plugins;s&&s.map((function(e){return r.plugins.push(new A(e))}))}return r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var a=n.prototype;return a.hasBlockAction=function(){return void 0!==this.getBlockAction()},a.getBlockAction=function(){return this.actions.find((function(e){return e.type===O.Type.BLOCK}))},a.getErrorMessages=function(){return this.messages},n}(v.a);function w(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}P(S,"Type",{DOWNLOAD:"DOWNLOAD",TRAILER:"TRAILER",CATCHUP:"CATCHUP",START_OVER:"START_OVER",PLAYBACK:"PLAYBACK"});var L=function(e){var t,r;function n(t){var r;return D(w(r=e.call(this,t)||this),"name",""),D(w(r),"description",""),D(w(r),"tags",[]),D(w(r),"metas",[]),D(w(r),"pictures",[]),r.hasError||(r.id=t.id,r.name=t.name,r.description=t.description,r.createDate=t.createDate,r.endDate=t.endDate,r.plays=t.plays,r.views=t.views,r.metas=r._formatTagsMetas(t.metas),r.tags=r._formatTagsMetas(t.tags),r.pictures=t.images),r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.prototype._formatTagsMetas=function(e){var t=[];return Object.keys(e).forEach((function(r){if(e[r].objects){var n="";e[r].objects.forEach((function(e){n+=e.value+"|"})),t.push({key:r,value:n})}else t.push({key:r,value:e[r].value})})),t},n}(v.a);function k(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function j(e,t,r){return t&&k(e.prototype,t),r&&k(e,r),e}D(L,"Type",{MEDIA:"media",RECORDING:"recording",EPG:"epg"}),D(L,"AssetReferenceType",{MEDIA:"media",EPG_INTERNAL:"epg_internal",EPG_EXTERNAL:"epg_external",NPVR:"nPVR"});var M=function(){function e(e){!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"_response",{}),this.requests=this.buildRequests(e),this._entryId=e.entryId}j(e,null,[{key:"id",get:function(){return"asset"}}]);var t=e.prototype;return t.buildRequests=function(e){var t=o.get(),r=[];return r.push(m.get(t.serviceUrl,e.ks,e.entryId,e.assetReferenceType)),r.push(m.getPlaybackContext(t.serviceUrl,e.ks,e.entryId,e.type,e.playbackContext)),r},t.isValid=function(){return!!this._entryId},j(e,[{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){this._response.mediaDataResult=new L(e[0].data),this._response.playBackContextResult=new S(e[1].data)},get:function(){return this._response}}]),e}();function N(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function x(e,t,r){return t&&N(e.prototype,t),r&&N(e,r),e}var U,B,q,V,H=function(){function e(e){!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"_response",{playlistItems:{entries:[]}}),this.requests=this.buildRequests(e),this._entries=e.entries}x(e,null,[{key:"id",get:function(){return"asset_list"}}]);var t=e.prototype;return t.buildRequests=function(e){var t=o.get(),r=[];return e.entries.forEach((function(n){var a=n.assetReferenceType||L.AssetReferenceType.MEDIA;r.push(m.get(t.serviceUrl,e.ks,n.entryId||n,a))})),r},t.isValid=function(){return!(!this._entries||!this._entries.length)},x(e,[{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){var t=this;e.forEach((function(e){t._response.playlistItems.entries.push({mediaDataResult:new L(e.data)})}))},get:function(){return this._response}}]),e}(),K=r(1),F=r(12),Y=r(9),W=r(8),G=r(16),J=r(17),X=r(5);var Q=((V={})[L.Type.MEDIA]=((U={})[S.Type.TRAILER]=function(){return{type:K.a.Type.VOD}},U[S.Type.PLAYBACK]=function(e){return"KalturaLiveAsset"===e.objectType?{type:K.a.Type.LIVE,dvrStatus:e.enableTrickPlay?K.a.DvrStatus.ON:K.a.DvrStatus.OFF}:parseInt(e.externalIds)>0?{type:K.a.Type.LIVE,dvrStatus:K.a.DvrStatus.OFF}:{type:K.a.Type.VOD}},U),V[L.Type.EPG]=((B={})[S.Type.CATCHUP]=function(){return{type:K.a.Type.VOD}},B[S.Type.START_OVER]=function(){return{type:K.a.Type.LIVE,dvrStatus:K.a.DvrStatus.ON}},B),V[L.Type.RECORDING]=((q={})[S.Type.PLAYBACK]=function(){return{type:K.a.Type.VOD}},q),V),z=function(){function e(){}return e.getMediaEntry=function(t,r){var n=new K.a;e._fillBaseData(n,t,r);var a=t.playBackContextResult,i=t.mediaDataResult,s=a.sources,o=e._filterSourcesByFormats(s,r.formats);n.sources=e._getParsedSources(o);var u=e._getMediaType(i.data,r.mediaType,r.contextType);return n.type=u.type,n.dvrStatus=u.dvrStatus,n.duration=Math.max.apply(Math,s.map((function(e){return e.duration}))),n},e.getEntryList=function(t,r){var n=new G.a;return t.playlistItems.entries.forEach((function(t){var a=new K.a,i=r.find((function(e){return e.entryId===t.mediaDataResult.id}));e._fillBaseData(a,t,i),n.items.push(a)})),n},e.getBumper=function(e){var t=e.playBackContextResult.plugins.find((function(e){return e.streamertype===A.StreamerType.PROGRESSIVE}));if(t)return new J.a(t)},e._fillBaseData=function(t,r,n){var a=r.mediaDataResult,i=e.reconstructMetadata(a);return i.description=a.description,i.name=a.name,a.createDate&&(i.createdAt=a.createDate),a.endDate&&(i.endDate=a.endDate),a.data.entryId&&(i.entryId=a.data.entryId),a.data.epgId&&(i.epgId=a.data.epgId),a.data.recordingId&&(i.recordingId=a.data.recordingId),n&&n.mediaType&&(i.mediaType=n.mediaType),n&&n.contextType&&(i.contextType=n.contextType),t.metadata=i,t.poster=e._getPoster(a.pictures),t.id=a.id,t},e.reconstructMetadata=function(t){return{metas:e.addToMetaObject(t.metas),tags:e.addToMetaObject(t.tags)}},e.addToMetaObject=function(e){var t={};return e&&e.forEach((function(e){t[e.key]=e.value})),t},e._getPoster=function(e){if(e&&e.length>0){var t=e[0].url;return/.*\/thumbnail\/.*(?:width|height)\/\d+\/(?:height|width)\/\d+/.test(t)?t:e.map((function(e){return{url:e.url,width:e.width,height:e.height}}))}return""},e._getMediaType=function(e,t,r){var n={type:K.a.Type.UNKNOWN};return Q[t]&&Q[t][r]&&(n=Q[t][r](e)),n},e._filterSourcesByFormats=function(e,t){return t.length>0&&(e=e.filter((function(e){return t.includes(e.type)}))),e},e._getParsedSources=function(t){var r=new W.a,n=function(t){var n=e._parseAdaptiveSource(t);if(n){var a=X.b.get(t.format);r.map(n,a)}};return t&&t.length>0&&(t.filter((function(e){return!Object(X.c)(e.format)})).forEach(n),t.filter((function(e){return Object(X.c)(e.format)})).forEach(n)),r},e._parseAdaptiveSource=function(t){var r=new Y.a;if(t){var n=t.url,a=X.b.get(t.format);if(a&&(r.mimetype=a.mimeType),!n)return e._logger.error("failed to create play url from source, discarding source: ("+t.fileId+"), "+t.format+"."),null;if(r.url=n,r.id=t.fileId+","+t.format,t.hasDrmData()){var i=[];t.drm.forEach((function(e){i.push(new F.a(e.licenseURL,R.a.Scheme[e.scheme],e.certificate))})),r.drmData=i}}return r},e.hasBlockAction=function(e){return e.playBackContextResult.hasBlockAction()},e.getBlockAction=function(e){return e.playBackContextResult.getBlockAction()},e.getErrorMessages=function(e){return e.playBackContextResult.getErrorMessages()},e}();!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(z,"_logger",Object(a.b)("OTTProviderParser"));var Z=r(0);function $(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var ee=function(e){var t,r;function n(t,r){var n;return(n=e.call(this,t,r)||this)._logger=Object(a.b)("OTTProvider"),o.set(t.env),n._networkRetryConfig=Object.assign(n._networkRetryConfig,t.networkRetryParameters),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var i,s,u,c=n.prototype;return c.getMediaConfig=function(e){var t=this;return e.ks&&(this.ks=e.ks,this._isAnonymous=!1),this._dataLoader=new f(this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var a=e.entryId;if(a){var i=t.ks;i||(i="{1:result:ks}",t._dataLoader.add(g,{partnerId:t.partnerId}));var s=e.contextType||S.Type.PLAYBACK,o=e.mediaType||L.Type.MEDIA,u=e.assetReferenceType||L.AssetReferenceType.MEDIA,c={mediaProtocol:e.protocol,assetFileIds:e.fileIds,context:s};e.streamerType&&(c.streamerType=e.streamerType),e.urlType&&(c.urlType=e.urlType),e.adapterData&&(c.adapterData=e.adapterData),t._dataLoader.add(M,{entryId:a,ks:i,type:o,playbackContext:c,assetReferenceType:u});var p={contextType:s,mediaType:o,formats:e.formats||[]};return t._dataLoader.fetchData().then((function(e){try{r(t._parseDataFromResponse(e,p))}catch(e){n(e)}}),(function(e){n(e)}))}n(new Z.a(Z.a.Severity.CRITICAL,Z.a.Category.PROVIDER,Z.a.Code.MISSING_MANDATORY_PARAMS,{message:"missing entry id"}))}))},c._parseDataFromResponse=function(e,t){this._logger.debug("Data parsing started");var r={session:{isAnonymous:this._isAnonymous,partnerId:this.partnerId},sources:this._getDefaultSourcesObject(),plugins:{}};if(this.uiConfId&&(r.session.uiConfId=this.uiConfId),e){if(e.has(g.id)){var n=e.get(g.id);n&&n.response&&(r.session.ks=n.response)}else r.session.ks=this.ks;if(e.has(M.id)){var a=e.get(M.id);if(a&&a.response&&Object.keys(a.response).length){var i=a.response;if(z.hasBlockAction(i))throw new Z.a(Z.a.Severity.CRITICAL,Z.a.Category.SERVICE,Z.a.Code.BLOCK_ACTION,{action:z.getBlockAction(i),messages:z.getErrorMessages(i)});var s=z.getMediaEntry(i,t);Object.assign(r.sources,this._getSourcesObject(s)),this._verifyHasSources(r.sources);var o=z.getBumper(i);o&&Object.assign(r.plugins,{bumper:o})}}}return this._logger.debug("Data parsing finished",r),r},c.getEntryListConfig=function(e){var t=this;return e.ks&&(this.ks=e.ks,this._isAnonymous=!1),this._dataLoader=new f(this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var a=e.entries;if(a&&a.length){var i=t.ks;i||(i="{1:result:ks}",t._dataLoader.add(g,{partnerId:t.partnerId})),t._dataLoader.add(H,{entries:a,ks:i}),t._dataLoader.fetchData(!1).then((function(e){r(t._parseEntryListDataFromResponse(e,a))}),(function(e){n(e)}))}else n({success:!1,data:"Missing mandatory parameter"})}))},c._parseEntryListDataFromResponse=function(e,t){var r=this;this._logger.debug("Data parsing started");var n={id:"",metadata:{name:"",description:""},poster:"",items:[],playlistLastEntryId:""};if(e&&e.has(H.id)){var a=e.get(H.id);if(a&&a.response)z.getEntryList(a.response,t).items.forEach((function(e){return n.items.push({sources:r._getSourcesObject(e)})}))}return this._logger.debug("Data parsing finished",n),n},c._getDefaultSourcesObject=function(){return{hls:[],dash:[],progressive:[],image:[],id:"",duration:0,type:K.a.Type.UNKNOWN,poster:"",dvr:!1,vr:null,metadata:{name:"",description:"",tags:""}}},c._getSourcesObject=function(e){var t=this._getDefaultSourcesObject(),r=e.sources.toJSON();return t.hls=r.hls,t.dash=r.dash,t.progressive=r.progressive,t.id=e.id,t.duration=e.duration,t.type=e.type,t.dvr=!!e.dvrStatus,t.poster=e.poster,e.metadata&&e.metadata.metas&&"string"==typeof e.metadata.metas.tags&&e.metadata.metas.tags.indexOf("360")>-1&&(t.vr={}),Object.assign(t.metadata,e.metadata),t},i=n,(s=[{key:"env",get:function(){return o.get()}}])&&$(i.prototype,s),u&&$(i,u),n}(n.a),te="@playkit-js/playkit-js-providers-ott",re="2.40.1",ne=S.Type,ae=L.Type}])}));
|
|
2
2
|
//# sourceMappingURL=playkit-ott-provider.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ovp=t():(e.playkit=e.playkit||{},e.playkit.providers=e.playkit.providers||{},e.playkit.providers.ovp=t())}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=18)}([function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(2);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function e(t,r,n,a){void 0===a&&(a={}),this.severity=t,this.category=r,this.code=n,this.data=a,e._logger.error("Category:"+r+" | Code:"+n+" |",a)};a(i,"Severity",{RECOVERABLE:1,CRITICAL:2}),a(i,"Category",{NETWORK:1,SERVICE:2,PROVIDER:3}),a(i,"Code",{UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,BAD_SERVER_RESPONSE:1005,MULTIREQUEST_API_ERROR:1006,API_RESPONSE_MISMATCH:1007,ERROR:2e3,BLOCK_ACTION:2001,MEDIA_STATUS_NOT_READY:2002,MISSING_MANDATORY_PARAMS:3e3,MISSING_PLAY_SOURCE:3001,METHOD_NOT_IMPLEMENTED:3002}),a(i,"_logger",Object(n.b)("Error"))},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(8);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function(){function e(){this.metadata=new Map,this.sources=new n.a,this.type=e.Type.UNKNOWN}return e.prototype.toJSON=function(){return{id:this.id,name:this.name,sources:this.sources.toJSON(),duration:this.duration,dvrStatus:this.dvrStatus,status:this.status,metadata:this.metadata,type:this.type,poster:this.poster,assetReferenceType:this.assetReferenceType,downloadUrl:this.downloadUrl}},e}();a(i,"Type",{VOD:"Vod",LIVE:"Live",IMAGE:"Image",AUDIO:"Audio",UNKNOWN:"Unknown"}),a(i,"DvrStatus",{ON:1,OFF:0})},function(e,t,r){"use strict";r.d(t,"c",(function(){return o})),r.d(t,"d",(function(){return u})),r.d(t,"e",(function(){return i})),r.d(t,"a",(function(){return a}));var n={get:function(){return{VERSION:"",DEBUG:{value:"",name:""},ERROR:{value:"",name:""},INFO:{value:"",name:""},OFF:{value:"",name:""},TIME:{value:"",name:""},TRACE:{value:"",name:""},WARN:{value:"",name:""},createDefaultHandler:function(){},debug:function(){},enabledFor:function(){},error:function(){},get:function(){},getLevel:function(){},info:function(){},log:function(){},setHandler:function(){},setLevel:function(){},time:function(){},timeEnd:function(){},trace:function(){},useDefaults:function(){},warn:function(){}}}},a={};function i(e){e&&"function"==typeof e.getLogger&&(n.get=e.getLogger),e&&e.LogLevel&&(a=e.LogLevel)}function s(e){return n.get(e)}function o(e){return s(e).getLevel()}function u(e,t){s(t).setLevel(e)}t.b=s},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function(){function e(e){void 0===e&&(e=new Map),a(this,"retryConfig",{async:!0,timeout:0,maxAttempts:4}),a(this,"_attemptCounter",1),this.headers=e}var t=e.prototype;return t.getUrl=function(e){return e+"/service/"+this.service+(this.action?"/action/"+this.action:"")},t.doHttpRequest=function(){var e=this,t=new Promise((function(t,r){e._requestPromise={resolve:t,reject:r}}));return this.url||this._requestPromise.reject(new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,n.a.Code.MALFORMED_DATA_URI,{url:this.url})),this._createXHR(),t},t._createXHR=function(){var e=this,t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===t.readyState&&200===t.status)try{var r=JSON.parse(t.responseText);return e.responseHeaders=e._getResponseHeaders(t),e._requestPromise.resolve(r)}catch(r){e._requestPromise.reject(e._createError(t,n.a.Code.BAD_SERVER_RESPONSE,{text:t.responseText}))}},t.open(this.method,this.url,this.retryConfig.async),this.retryConfig.async&&this.retryConfig.timeout&&(t.timeout=this.retryConfig.timeout);var r=performance.now();t.ontimeout=function(){e._handleError(t,n.a.Code.TIMEOUT,{timeout:(performance.now()-r)/1e3,statusText:t.statusText})},t.onerror=t.onabort=function(){e._handleError(t,n.a.Code.HTTP_ERROR,{text:t.responseText,statusText:t.statusText})},this.headers.forEach((function(e,r){t.setRequestHeader(r,e)})),t.send(this.params)},t._getResponseHeaders=function(e){return e.getAllResponseHeaders().split("\n").filter((function(e){return 0===e.toLowerCase().indexOf("x-")}))},t._handleError=function(e,t,r){var n=this._createError(e,t,r);if(e.onreadystatechange=function(){},e.onerror=function(){},e.ontimeout=function(){},e.onabort=function(){},!(this.retryConfig.maxAttempts&&this._attemptCounter<this.retryConfig.maxAttempts))return this._requestPromise.reject(n);this._attemptCounter++,this._createXHR()},t._createError=function(e,t,r){return Object.assign(r,{url:this.url,headers:this._getResponseHeaders(e),attempt:this._attemptCounter}),new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,t,r)},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){var t,r,n;n=!1,(r="hasError")in(t=this)?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,"KalturaAPIException"===e.objectType?(this.hasError=!0,this.error=new a(e.code,e.message)):e.error&&"KalturaAPIException"===e.error.objectType?(this.hasError=!0,this.error=new a(e.error.code,e.error.message)):this.data=e},a=function(e,t){this.code=e,this.message=t}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return i}));var n={DASH:{name:"dash",mimeType:"application/dash+xml",pathExt:"mpd"},HLS:{name:"hls",mimeType:"application/x-mpegURL",pathExt:"m3u8"},WVM:{name:"wvm",mimeType:"video/wvm",pathExt:"wvm"},MP4:{name:"mp4",mimeType:"video/mp4",pathExt:"mp4"},MP3:{name:"mp3",mimeType:"audio/mpeg",pathExt:"mp3"}},a=new Map([["mpegdash",n.DASH],["applehttp",n.HLS],["url",n.MP4]]);function i(e){var t=a.get(e);return!!t&&t.name===n.MP4.name}},function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n,a,i,s=function(e){this.scheme=e.scheme,this.licenseURL=e.licenseURL,this.certificate=e.certificate};i={"drm.PLAYREADY_CENC":"com.microsoft.playready","drm.WIDEVINE_CENC":"com.widevine.alpha","fairplay.FAIRPLAY":"com.apple.fairplay",WIDEVINE_CENC:"com.widevine.alpha",PLAYREADY_CENC:"com.microsoft.playready",FAIRPLAY:"com.apple.fairplay"},(a="Scheme")in(n=s)?Object.defineProperty(n,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[a]=i},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){this.message=e.message,this.code=e.code}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));r(9);var n=r(5),a=(r(13),function(){function e(){this.progressive=[],this.dash=[],this.hls=[],this.image=[]}var t=e.prototype;return t.map=function(e,t){if(t)switch(t.name){case n.a.MP4.name:this.progressive.push(e);break;case n.a.DASH.name:this.dash.push(e);break;case n.a.HLS.name:this.hls.push(e)}},t.toJSON=function(){var e={progressive:[],dash:[],hls:[],image:[]};return this.progressive.forEach((function(t){return e.progressive.push(t.toJSON())})),this.hls.forEach((function(t){return e.hls.push(t.toJSON())})),this.dash.forEach((function(t){return e.dash.push(t.toJSON())})),e.image=this.image,e},e}())},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));r(12);var n=function(){function e(){}return e.prototype.toJSON=function(){var e={id:this.id,url:this.url,mimetype:this.mimetype};return this.bandwidth&&(e.bandwidth=this.bandwidth),this.width&&(e.width=this.width),this.height&&(e.height=this.height),this.label&&(e.label=this.label),this.drmData&&this.drmData.length>0&&(e.drmData=[],this.drmData.forEach((function(t){Array.isArray(e.drmData)&&e.drmData.push(t.toJSON())}))),e},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));r(11);var n=r(0);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function(){function e(e){a(this,"_loadersResponseMap",new Map),a(this,"_loaders",new Map),this._networkRetryConfig=e}var t=e.prototype;return t.add=function(e,t,r){var n=this,a=new e(t);if(a.isValid()){this._loaders.set(e.id,a);var i=this._multiRequest.requests.length,s=a.requests;this._multiRequest.retryConfig=this._networkRetryConfig,s.forEach((function(e){e.params=e.params||{},e.params.ks=e.params.ks||r,n._multiRequest.add(e)}));var o=Array.from(new Array(s.length),(function(e,t){return t+i}));this._loadersResponseMap.set(e.id,o)}},t.fetchData=function(e){var t=this;return new Promise((function(r,a){t._multiRequest.execute(e).then((function(e){t._multiResponse=e.response,t.prepareData(e.response).success?r(t._loaders):a(new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,n.a.Code.API_RESPONSE_MISMATCH,{headers:e.headers}))}),(function(e){a(e)}))}))},t.prepareData=function(e){var t=this;return this._loaders.forEach((function(r,n){var a=t._loadersResponseMap.get(n);try{a&&a.length>0&&(r.response=e.results.slice(a[0],a[a.length-1]+1))}catch(e){return{success:!1,error:e}}})),{success:!0,data:this._loaders}},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(3),a=r(2),i=r(4),s=r(0);function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var c=function(e){var t,r;function n(){for(var t,r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return u(o(t=e.call.apply(e,[this].concat(n))||this),"requests",[]),t}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var a=n.prototype;return a.add=function(e){var t;this.requests.push(e);var r={},n={service:e.service,action:e.action};return Object.assign(r,((t={})[this.requests.length]=Object.assign(n,e.params),t)),Object.assign(r,this.params),this.params=r,this},a.execute=function(e){var t=this;return new Promise((function(r,a){try{t.params=JSON.stringify(t.params)}catch(e){n._logger.error(""+e.message),a(new s.a(s.a.Severity.CRITICAL,s.a.Category.PROVIDER,s.a.Code.FAILED_PARSING_REQUEST,{error:e,params:t.params}))}t.doHttpRequest().then((function(n){var i=new l(n,e);i.success?r({headers:t.responseHeaders,response:i}):a(new s.a(s.a.Severity.CRITICAL,s.a.Category.NETWORK,s.a.Code.MULTIREQUEST_API_ERROR,{url:t.url,headers:t.responseHeaders,results:i.results}))}),(function(e){a(e)}))}))},n}(n.a);u(c,"_logger",Object(a.b)("MultiRequestBuilder"));var l=function e(t,r){void 0===r&&(r=!0),u(this,"results",[]);var n=t.result?t.result:t,a=(Array.isArray(n)?n:[n]).map((function(e){return new i.a(e)})),s=a.filter((function(e){return e.hasError}));s.forEach((function(t){e._logger.error("Service returned an error with error code: "+t.error.code+" and message: "+t.error.message+".")})),this.results=a,r&&s.length||s.length===this.results.length?this.success=!1:(this.results=this.results.filter((function(e){return!e.hasError})),this.success=!0)};u(l,"_logger",Object(a.b)("MultiRequestResult"))},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){function e(e,t,r){this.licenseUrl=e,this.scheme=t,r&&(this.certificate=r)}return e.prototype.toJSON=function(){var e={licenseUrl:this.licenseUrl,scheme:this.scheme};return this.certificate&&(e.certificate=this.certificate),e},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){function e(t){this.id=t.id,this.url=e.extractBaseThumbnailUrl(t.dataUrl),this.mimetype=""}return e.extractBaseThumbnailUrl=function(e){return e.match(".+entry_id/[a-zA-Z0-9_]+/")[0].slice(0,-1)},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(2),a=(r(10),r(0));function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),e}var o=function(){function e(e,t){var r,a,i;i={async:!0,timeout:0,maxAttempts:4},(a="_networkRetryConfig")in(r=this)?Object.defineProperty(r,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[a]=i,Object(n.e)(e.logger),this._partnerId=e.partnerId,this._widgetId=e.widgetId,this._uiConfId=e.uiConfId,this._isAnonymous=!e.ks,this._ks=e.ks||"",this._playerVersion=t}s(e,[{key:"partnerId",get:function(){return this._partnerId}},{key:"widgetId",get:function(){return this._widgetId||this.defaultWidgetId}},{key:"defaultWidgetId",get:function(){return"_"+this._partnerId}},{key:"uiConfId",get:function(){return this._uiConfId}},{key:"ks",get:function(){return this._ks},set:function(e){this._ks=e}},{key:"playerVersion",get:function(){return this._playerVersion}},{key:"isAnonymous",get:function(){return this._isAnonymous}}]);var t=e.prototype;return t.getMediaConfig=function(e){return Promise.reject(new a.a(a.a.Severity.CRITICAL,a.a.Category.PROVIDER,a.a.Code.METHOD_NOT_IMPLEMENTED,{message:"getMediaConfig method must be implement by the derived class"}))},t.getPlaylistConfig=function(e){return Promise.reject(new a.a(a.a.Severity.CRITICAL,a.a.Category.PROVIDER,a.a.Code.METHOD_NOT_IMPLEMENTED,{message:"The provider does not support loading playlist by id"}))},t.getEntryListConfig=function(e){return Promise.reject(new a.a(a.a.Severity.CRITICAL,a.a.Category.PROVIDER,a.a.Code.METHOD_NOT_IMPLEMENTED,{message:"The provider does not support loading entry list"}))},t._verifyHasSources=function(e){if(0===e.hls.concat(e.dash,e.progressive,e.image).length)throw new a.a(a.a.Severity.CRITICAL,a.a.Category.SERVICE,a.a.Code.MISSING_PLAY_SOURCE,{action:"",messages:"No play source for entry id: "+e.id})},t.getLogLevel=function(e){return Object(n.c)(e)},t.setLogLevel=function(e,t){Object(n.d)(e,t)},s(e,[{key:"LogLevel",get:function(){return n.a}}]),e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function e(t){var r;return Array.isArray(t)?(r=t.length>0?t.slice(0):[]).forEach((function(t,n){("object"==typeof t&&t!=={}||Array.isArray(t)&&t.length>0)&&(r[n]=e(t))})):"object"==typeof t?(r=Object.assign({},t),Object.keys(r).forEach((function(t){("object"==typeof r[t]&&r[t]!=={}||Array.isArray(r[t])&&r[t].length>0)&&(r[t]=e(r[t]))}))):r=t,r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));r(1);var n=function(){this.items=[]}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){this.url=e.url,this.clickThroughUrl=e.clickThroughUrl}},function(e,t,r){"use strict";r.r(t),r.d(t,"Provider",(function(){return Te})),r.d(t,"ProviderParser",(function(){return K})),r.d(t,"NAME",(function(){return Oe})),r.d(t,"VERSION",(function(){return Ae})),r.d(t,"RequestBuilder",(function(){return W.a})),r.d(t,"ResponseTypes",(function(){return n}));var n={};r.r(n),r.d(n,"KalturaBaseEntryListResponse",(function(){return Z})),r.d(n,"KalturaMediaEntry",(function(){return A})),r.d(n,"KalturaAccessControlModifyRequestHostRegexAction",(function(){return g})),r.d(n,"KalturaBumper",(function(){return v})),r.d(n,"KalturaFlavorAsset",(function(){return m})),r.d(n,"KalturaMediaEntries",(function(){return oe})),r.d(n,"KalturaMetadata",(function(){return R})),r.d(n,"KalturaMetadataListResponse",(function(){return T})),r.d(n,"KalturaPlaybackContext",(function(){return I})),r.d(n,"KalturaPlaybackSource",(function(){return d})),r.d(n,"KalturaPlaylist",(function(){return se})),r.d(n,"KalturaRuleAction",(function(){return y})),r.d(n,"KalturaUIConfResponse",(function(){return ve})),r.d(n,"KalturaDrmPlaybackPluginData",(function(){return l.a})),r.d(n,"KalturaAccessControlMessage",(function(){return c.a})),r.d(n,"BaseServiceResult",(function(){return u.a}));var a=r(2),i=r(15),s={serviceUrl:"https://cdnapisec.kaltura.com/api_v3",cdnUrl:"https://cdnapisec.kaltura.com",serviceParams:{apiVersion:"3.3.0",format:1},useApiCaptions:!0,loadThumbnailWithKs:!1,replaceHostOnlyManifestUrls:!1},o=function(){function e(){}return e.set=function(e){e&&Object.assign(s,e)},e.get=function(){return Object(i.a)(s)},e}(),u=r(4),c=r(7),l=r(6);var d=function(){function e(e){var t,r,n,a=this;n=[],(r="drm")in(t=this)?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,this.format=e.format,this.deliveryProfileId=e.deliveryProfileId,this.url=e.url,this.protocols=e.protocols,this.flavorIds=e.flavorIds,e.drm&&e.drm.map((function(e){return a.drm.push(new l.a(e))}))}var t=e.prototype;return t.hasDrmData=function(){return this.drm&&this.drm.length>0},t.hasFlavorIds=function(){return!!this.flavorIds&&this.flavorIds.length>0},t.getProtocol=function(e){var t="";if(this.protocols&&this.protocols.length>0)this.protocols.split(",").forEach((function(r){r===e&&(t=r)}));else if("http"===e)return e;return t},e}();var p,f,h,y=function(e){this.type=e.type};h={DRM_POLICY:"drm.DRM_POLICY",BLOCK:1,PREVIEW:2,LIMIT_FLAVORS:3,ADD_TO_STORAGE:4,LIMIT_DELIVERY_PROFILES:5,SERVE_FROM_REMOTE_SERVER:6,REQUEST_HOST_REGEX:7,LIMIT_THUMBNAIL_CAPTURE:8},(f="Type")in(p=y)?Object.defineProperty(p,f,{value:h,enumerable:!0,configurable:!0,writable:!0}):p[f]=h;var g=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).pattern=t.pattern,r.replacement=t.replacement,r.replacmenServerNodeId=t.replacmenServerNodeId,r.checkAliveTimeoutMs=t.checkAliveTimeoutMs,r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(y);var m=function(e){this.id=e.id,this.flavorParamsId=e.flavorParamsId,this.fileExt=e.fileExt,this.bitrate=e.bitrate,this.width=e.width,this.height=e.height,this.id=e.id,this.frameRate=e.frameRate,this.isOriginal=e.isOriginal,this.isWeb=e.isWeb,this.containerFormat=e.containerFormat,this.videoCodecId=e.videoCodecId,this.status=e.status,this.language=e.language,this.label=e.label};!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(m,"Status",{ERROR:-1,QUEUED:0,CONVERTING:1,READY:2,DELETED:3,NOT_APPLICABLE:4,TEMP:5,WAIT_FOR_CONVERT:6,IMPORTING:7,VALIDATING:8,EXPORTING:9});var v=function(e){this.entryId=e.entryId,this.clickThroughUrl=e.url,this.sources=e.sources?e.sources.map((function(e){return new d(e)})):[]};function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var I=function(e){var t,r;function n(t){var r;if(E(_(r=e.call(this,t)||this),"sources",[]),E(_(r),"actions",[]),E(_(r),"messages",[]),E(_(r),"flavorAssets",[]),E(_(r),"bumperData",[]),!r.hasError){var n=t.messages;n&&n.map((function(e){return r.messages.push(new c.a(e))}));var a=t.actions;a&&a.map((function(e){e.type===y.Type.REQUEST_HOST_REGEX?r.actions.push(new g(e)):r.actions.push(new y(e))}));var i=t.sources;i&&i.map((function(e){return r.sources.push(new d(e))}));var s=t.flavorAssets;s&&s.map((function(e){return r.flavorAssets.push(new m(e))}));var o=t.bumperData;o&&o.map((function(e){return r.bumperData.push(new v(e))}))}return r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var a=n.prototype;return a.hasBlockAction=function(){return void 0!==this.getBlockAction()},a.getBlockAction=function(){return this.actions.find((function(e){return e.type===y.Type.BLOCK}))},a.getErrorMessages=function(){return this.messages},a.getRequestHostRegexAction=function(){var e=this.actions.find((function(e){return e.type===y.Type.REQUEST_HOST_REGEX}));if(e instanceof g)return e},n}(u.a);function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var R=function(e){this.id=e.id,this.metadataProfileId=e.metadataProfileId,this.metadataProfileVersion=e.metadataProfileVersion,this.metadataProfileId=e.metadataProfileId,this.metadataObjectType=e.metadataObjectType,this.objectId=e.objectId,this.version=e.version,this.created=new Date(0),this.created.setUTCSeconds(e.createdAt),this.updated=new Date(0),this.updated.setUTCSeconds(e.updatedAt),this.status=e.status,this.xml=e.xml};b(R,"ObjectType",{AD_CUE_POINT:"adCuePointMetadata.AdCuePoint",ANNOTATION:"annotationMetadata.Annotation",CODE_CUE_POINT:"codeCuePointMetadata.CodeCuePoint",THUMB_CUE_POINT:"thumbCuePointMetadata.thumbCuePoint",ENTRY:1,CATEGORY:2,USER:3,PARTNER:4,DYNAMIC_OBJECT:5}),b(R,"Status",{VALID:1,INVALID:2,DELETED:3});var T=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).hasError||(r.totalCount=t.totalCount,r.totalCount>0&&(r.metas=[],t.objects.map((function(e){return r.metas.push(new R(e))})))),r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(u.a);function O(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var A=function(e){this.id=e.id,this.referenceId=e.referenceId,this.externalSourceType=e.externalSourceType,this.name=e.name,this.description=e.description,this.dataUrl=e.dataUrl,this.type=e.type,this.entryType=e.mediaType,this.flavorParamsIds=e.flavorParamsIds,this.duration=e.duration,this.poster=e.thumbnailUrl,this.status=e.status,this.dvrStatus=e.dvrStatus,this.tags=e.tags,this.createdAt=e.createdAt,this.updatedAt=e.updatedAt,this.creatorId=e.creatorId,this.endDate=e.endDate,this.plays=e.plays,this.views=e.views,this.downloadUrl=e.downloadUrl};O(A,"EntryType",{AUTOMATIC:{value:-1},EXTERNAL_MEDIA:{value:"externalMedia.externalMedia"},MEDIA_CLIP:{value:1},MIX:{value:2},PLAYLIST:{value:5},DATA:{value:6},LIVE_STREAM:{value:7},LIVE_CHANNEL:{value:8},DOCUMENT:{value:10}}),O(A,"MediaType",{VIDEO:{value:1},IMAGE:{value:2},AUDIO:{value:5},LIVE_STREAM_FLASH:{value:201},LIVE_STREAM_WINDOWS_MEDIA:{value:202},LIVE_STREAM_REAL_MEDIA:{value:203},LIVE_STREAM_QUICK_TIME:{value:204}}),O(A,"EntryStatus",{ERROR_IMPORTING:-2,ERROR_CONVERTING:-1,SCAN_FAILURE:"virusScan.ScanFailure",IMPORT:0,INFECTED:"virusScan.Infected",PRECONVERT:1,READY:2,DELETED:3,PENDING:4,MODERATE:5,BLOCKED:6,NO_CONTENT:7}),O(A,"EntryModerationStatus",{PENDING_MODERATION:1,APPROVED:2,REJECTED:3,FLAGGED_FOR_REVIEW:4,MODERATE:5,AUTO_APPROVED:6});var C=function(e){this.playlistLastEntryId=e.playlistLastEntryId,this.entryId=e.entryId,this.id=e.id,this.userId=e.userId,this.partnerId=e.partnerId,this.status=e.status,this.createdAt=e.createdAt,this.updatedAt=e.updatedAt},w=function(){function e(){}return e.build=function(e){var t=o.get(),r=t.serviceUrl.substr(0,t.serviceUrl.lastIndexOf("/")),n=e.partnerId,a=e.entryId,i=e.ks,s=e.uiConfId,u=e.format,c=e.protocol,l=e.extension,d=e.flavorIds;if(!r||isNaN(Number.parseInt(n))||!a||!u||!c)return"";var p=r;return r.endsWith("/")||(p+="/"),p+="p/"+n+"/sp/"+n+"00/playManifest/entryId/"+a+"/protocol/"+c+"/format/"+u,d?p+="/flavorIds/"+d:s&&(p+="/uiConfId/"+s),""!==i&&(p+="/ks/"+i),""!==l&&(p+="/a."+l),s&&""!==d&&(p+="?uiConfId="+s),p},e}(),P=function(){function e(){}return e.xmlToJson=function(e){var t={};if(1===e.nodeType){if(e.attributes.length>0){t["@attributes"]={};for(var r=0;r<e.attributes.length;r++){var n=e.attributes.item(r);t["@attributes"][n.nodeName]=n.nodeValue}}}else 3===e.nodeType&&(t=e.nodeValue);if(e.hasChildNodes())for(var a=0;a<e.childNodes.length;a++){var i=e.childNodes.item(a),s=i.nodeName;if(void 0===t[s])t[s]=this.xmlToJson(i);else{if(void 0===t[s].push){var o=t[s];t[s]=[],t[s].push(o)}t[s].push(this.xmlToJson(i))}}return t},e}(),S=r(1),D=r(12),M=r(9),k=r(8),L=r(5),N=function(){this.items=[]},j=r(16),U=r(17),x={SRT:"1",DFXP:"2",WEBVTT:"3",CAP:"4"},V={3:"vtt",1:"srt"},F=function(){function e(){}return e.createConfig=function(e,t){return e.map((function(e){var r=e.url,n=V[e.format];return[x.DFXP,x.CAP].includes(e.format)&&(r=e.webVttUrl,n=V[x.WEBVTT]),r=B(r,t),{default:!!e.isDefault,type:n,language:e.languageCode,label:e.label,url:r}}))},e}(),q=r(13);var H=function(){function e(){}return e.getMediaEntry=function(t,r,n,a){var i=new S.a,s=a.entry,u=a.playBackContextResult,c=a.metadataListResult,l=u.sources;return i.sources=e._getParsedSources(l,t,r,n,s,u),e._fillBaseData(i,s,c),i.type!==S.a.Type.LIVE&&o.get().useApiCaptions&&u.data.playbackCaptions&&(i.sources.captions=F.createConfig(u.data.playbackCaptions,t)),i},e.addKsToUrl=function(e,t){var r;return t?(r=-1!==e.split("?")[0].replace(/^.*[\\/]/,"").indexOf(".")?-1===e.indexOf("?")?"?ks=":"&ks=":"/ks/",e+r+t):e},e.getPlaylist=function(t){var r=new N,n=t.playlistData,a=t.playlistItems.entries,i=t.playlistUserEntries.entries;return r.id=n.id,r.name=n.name,r.description=n.description,r.poster=n.poster,r.playlistLastEntryId=i.map((function(e){return e.playlistLastEntryId}))[0],a.forEach((function(t){var n=new S.a;e._fillBaseData(n,t),r.items.push(n)})),r},e.getEntryList=function(t){var r=new j.a;return t.playlistItems.entries.forEach((function(t){var n=new S.a;e._fillBaseData(n,t),r.items.push(n)})),r},e.getBumper=function(t,r,n){var a=t.playBackContextResult,i=a.bumperData[0];if(i){var s=(i&&i.sources).find((function(e){return Object(L.c)(e.format)}));if(s){var o=e._parseProgressiveSources(s,a,r,n,0,i.entryId);if(o[0])return new U.a({url:o[0].url,clickThroughUrl:i.clickThroughUrl})}}},e._fillBaseData=function(t,r,n){return t.poster=r.poster,t.id=r.id,t.duration=r.duration,t.downloadUrl=r.downloadUrl||"",t.metadata=e._parseMetadata(n),t.metadata.description=r.description||"",t.metadata.entryId=r.id||"",t.metadata.name=r.name||"",r.createdAt&&(t.metadata.createdAt=r.createdAt),r.updatedAt&&(t.metadata.updatedAt=r.updatedAt),r.creatorId&&(t.metadata.creatorId=r.creatorId),r.endDate&&(t.metadata.endDate=r.endDate),r.views&&(t.metadata.views=r.views),r.plays&&(t.metadata.plays=r.plays),t.metadata.tags=r.tags||"",t.status=r.status,t.type=e._getEntryType(r.entryType,r.type),t.type===S.a.Type.LIVE&&(t.dvrStatus=r.dvrStatus),t},e._getEntryType=function(e,t){var r=S.a.Type.UNKNOWN;switch(e){case A.MediaType.IMAGE.value:r=S.a.Type.IMAGE;break;case A.MediaType.AUDIO.value:r=S.a.Type.AUDIO;break;default:switch(t){case A.EntryType.MEDIA_CLIP.value:r=S.a.Type.VOD;break;case A.EntryType.LIVE_STREAM.value:case A.EntryType.LIVE_CHANNEL.value:r=S.a.Type.LIVE;break;default:r=S.a.Type.UNKNOWN}}return r},e._getParsedSources=function(t,r,n,a,i,s){var o,u,c=new k.a,l=function(t){var o=e._parseAdaptiveSource(t,s,r,n,a,i.id);if(o){var u=L.b.get(t.format);c.map(o,u)}};return i.type===A.EntryType.EXTERNAL_MEDIA.value?((u=new M.a).mimetype="video/youtube",u.url=i.referenceId,u.id=i.id+"_youtube",c.progressive.push(u)):i.entryType===A.MediaType.IMAGE.value?c.image.push(new q.a(i)):t&&t.length>0&&(t.filter((function(e){return!Object(L.c)(e.format)})).forEach(l),o=t.find((function(t){return Object(L.c)(t.format)&&""!==t.getProtocol(e._getBaseProtocol())})),c.progressive=e._parseProgressiveSources(o,s,r,n,a,i.id)),c},e._parseAdaptiveSource=function(t,r,n,a,i,s){var o=new M.a;if(t){var u="",c=L.b.get(t.format),d=t.getProtocol(e._getBaseProtocol()),p=t.deliveryProfileId,f=t.format,h="";if(c&&(h=c.pathExt,o.mimetype=c.mimeType),t.hasFlavorIds()?(!h&&r.flavorAssets&&r.flavorAssets.length>0&&(h=r.flavorAssets[0].fileExt),u=w.build({entryId:s,flavorIds:t.flavorIds,format:f,ks:n,partnerId:a,uiConfId:i,extension:h,protocol:d})):u=e.addKsToUrl(t.url,n),!u){var y="failed to create play url from source, discarding source: ("+s+"_"+p+"), "+f;return e._logger.warn(y),null}if(o.url=u,o.id=s+"_"+p+","+f,t.hasDrmData()){var g=[];t.drm.forEach((function(e){g.push(new D.a(e.licenseURL,l.a.Scheme[e.scheme],e.certificate))})),o.drmData=g}}return o},e._parseProgressiveSources=function(t,r,n,a,i,s){var o=[],u=[];if(t){var c=t.getProtocol(e._getBaseProtocol()),l=t.format,d=t.deliveryProfileId,p=d+","+l;r.flavorAssets.map((function(t){var r=new M.a;r.id=t.id+p,r.mimetype="mp3"===t.fileExt?"audio/mp3":"video/mp4",r.height=t.height,r.width=t.width,r.bandwidth=1024*t.bitrate,r.label=t.label||t.language;var f=w.build({entryId:s,flavorIds:t.id,format:l,ks:n,partnerId:a,uiConfId:i,extension:t.fileExt,protocol:c});if(""===f)return e._logger.warn("failed to create play url from source, discarding source: ("+s+"_"+d+"), "+l+"."),null;r.url=f,t.height&&t.width?o.push(r):u.push(r)}))}return u.length&&!o.length?u:o},e._parseMetadata=function(e){var t={};return e&&e.metas&&e.metas.length>0&&e.metas.forEach((function(e){if(e.xml){var r,n=new DOMParser;e.xml=e.xml.replace(/\r?\n|\r/g,""),e.xml=e.xml.replace(/>\s*/g,">"),e.xml=e.xml.replace(/>\s*/g,">"),r=n.parseFromString(e.xml,"text/xml");var a=P.xmlToJson(r);Object.keys(a.metadata).forEach((function(e){t[e]=a.metadata[e]["#text"]}))}})),t},e._getBaseProtocol=function(){var e=o.get(),t=/^https?:/.exec(e.cdnUrl),r=t?t[0]:document.location.protocol;return"string"==typeof r?r.slice(0,-1):"https"},e.hasBlockAction=function(e){return e.playBackContextResult.hasBlockAction()},e.getBlockAction=function(e){return e.playBackContextResult.getBlockAction()},e.getErrorMessages=function(e){return e.playBackContextResult.getErrorMessages()},e}();!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(H,"_logger",Object(a.b)("OVPProviderParser"));var B=H.addKsToUrl,K=H,W=r(3),G=r(11),Y=function(){function e(){}return e.getMultiRequest=function(e,t,r){var n=o.get(),a=n.serviceParams;Object.assign(a,{ks:t,clientTag:"html5:v"+e}),r&&Object.assign(a,{partnerId:r});var i=new Map;i.set("Content-Type","application/json");var s=new G.a(i);return s.method="POST",s.service="multirequest",s.url=s.getUrl(n.serviceUrl),s.params=a,s},e}();var J=function e(t){void 0===t&&(t={}),this.type=t.type||e.Type.INCLUDE_FIELDS,this.fields=t.fields||"id,referenceId,name,description,thumbnailUrl,dataUrl,duration,msDuration,flavorParamsIds,mediaType,type,tags,dvrStatus,externalSourceType,status,createdAt,updatedAt,endDate,plays,views,downloadUrl,creatorId"};!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(J,"Type",{INCLUDE_FIELDS:1,EXCLUDE_FIELDS:2});var X=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.getPlaybackContext=function(e,t,r){var n=new Map;n.set("Content-Type","application/json");var a=new W.a(n);a.service="baseEntry",a.action="getPlaybackContext",a.method="POST",a.url=a.getUrl(e),a.tag="baseEntry-getPlaybackContext";return a.params={entryId:r,ks:t,contextDataParams:{objectType:"KalturaContextDataParams",flavorTags:"all"}},a},n.list=function(e,t,r,a,i){var s=new Map;s.set("Content-Type","application/json");var o=new W.a(s);return o.service="baseEntry",o.action="list",o.method="POST",o.url=o.getUrl(e),o.tag="list",o.params=n.getEntryListReqParams(r,t,a,i),o},n.getEntryListReqParams=function(e,t,r,n){var a={};return e?a=r?{redirectFromEntryId:e}:{idEqual:e}:n&&(a={objectType:"KalturaBaseEntryFilter",referenceIdEqual:n}),{ks:t,filter:a,responseProfile:new J}},n}(Y);var Q=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.list=function(e,t,r){var n=new Map;n.set("Content-Type","application/json");var a=new W.a(n);a.service="metadata_metadata",a.action="list",a.method="POST",a.url=a.getUrl(e),a.tag="metadata_metadata-list";var i={objectType:"KalturaMetadataFilter",objectIdEqual:r,metadataObjectTypeEqual:"1"};return a.params={filter:i,ks:t},a},n}(Y);var Z=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).hasError||(r.totalCount=t.totalCount,r.totalCount>0&&(r.entries=[],t.objects.map((function(e){return r.entries.push(new A(e))})))),r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(u.a);function z(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $(e,t,r){return t&&z(e.prototype,t),r&&z(e,r),e}var ee=function(){function e(e){!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"_response",{}),this.requests=this.buildRequests(e),this._entryId=e.entryId,this._referenceId=e.referenceId}$(e,null,[{key:"id",get:function(){return"media"}}]);var t=e.prototype;return t.buildRequests=function(e){var t=o.get(),r=[];r.push(X.list(t.serviceUrl,e.ks,e.entryId,e.redirectFromEntryId,e.referenceId));var n="{1:result:ks}"===e.ks?"{2:result:objects:0:id}":"{1:result:objects:0:id}";return r.push(X.getPlaybackContext(t.serviceUrl,e.ks,n)),r.push(Q.list(t.serviceUrl,e.ks,n)),r},t.isValid=function(){return!(!this._entryId&&!this._referenceId)},$(e,[{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){var t=new Z(e[0].data);this._response.entry=t.entries[0],this._response.playBackContextResult=new I(e[1].data),this._response.metadataListResult=new T(e[2].data)},get:function(){return this._response}}]),e}();var te=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.anonymousSession=function(e,t){var r=new Map;r.set("Content-Type","application/json");var n=new W.a(r);return n.service="session",n.action="startWidgetSession",n.method="POST",n.url=n.getUrl(e),n.tag="session-startWidget",n.params={widgetId:t},n},n}(Y);function re(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var ne=function(){var e,t,r;function n(e){!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"_response",{}),this.requests=this.buildRequests(e),this._widgetId=e.widgetId}e=n,r=[{key:"id",get:function(){return"session"}}],(t=[{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){this._response.ks=e[0].data.ks},get:function(){return this._response.ks}}])&&re(e.prototype,t),r&&re(e,r);var a=n.prototype;return a.buildRequests=function(e){var t=o.get(),r=[];return r.push(te.anonymousSession(t.serviceUrl,e.widgetId)),r},a.isValid=function(){return!!this._widgetId},n}();var ae=function(e){var t,r;function n(t,r,n,a){var i;return void 0===n&&(n=""),(i=e.call(this,a)||this)._multiRequest=Y.getMultiRequest(t,n,r),i}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(r(10).a);var ie=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.execute=function(e,t,r){var n=new Map;n.set("Content-Type","application/json");var a=new W.a(n);return a.service="playlist",a.action="execute",a.method="POST",a.url=a.getUrl(e),a.tag="playlist-execute",a.params={ks:t,id:r,responseProfile:new J},a},n.get=function(e,t,r){var n=new Map;n.set("Content-Type","application/json");var a=new W.a(n);return a.service="playlist",a.action="get",a.method="POST",a.url=a.getUrl(e),a.tag="playlist-get",a.params={ks:t,id:r,responseProfile:{fields:"id,name,description,thumbnailUrl",type:1}},a},n.getLastEntryId=function(e,t,r){var n=new Map;n.set("Content-Type","application/json");var a=new W.a(n);return a.service="userEntry",a.action="list",a.method="POST",a.url=a.getUrl(e),a.tag="userEntry-list",a.params={ks:t,filter:{objectType:"KalturaViewHistoryUserEntry",entryIdEqual:r,userIdEqualCurrent:1},responseProfile:{fields:"playlistLastEntryId",type:1}},a},n}(Y),se=function(e){this.id=e.id,this.name=e.name,this.description=e.description,this.poster=e.thumbnailUrl};var oe=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).hasError||(r.entries=[],t.map((function(e){return r.entries.push(new A(e))}))),r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(u.a);var ue=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).hasError||(r.totalCount=t.totalCount,r.entries=[],r.totalCount>0&&t.objects.map((function(e){return r.entries.push(new C(e))}))),r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(u.a);function ce(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function le(e,t,r){return t&&ce(e.prototype,t),r&&ce(e,r),e}var de=function(){function e(e){!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"_response",{}),this.requests=this.buildRequests(e),this._playlistId=e.playlistId}le(e,null,[{key:"id",get:function(){return"playlist"}}]);var t=e.prototype;return t.buildRequests=function(e){var t=o.get(),r=[];return r.push(ie.get(t.serviceUrl,e.ks,e.playlistId)),r.push(ie.execute(t.serviceUrl,e.ks,e.playlistId)),r.push(ie.getLastEntryId(t.serviceUrl,e.ks,e.playlistId)),r},t.isValid=function(){return!!this._playlistId},le(e,[{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){this._response.playlistData=new se(e[0].data),this._response.playlistItems=new oe(e[1].data),this._response.playlistUserEntries=new ue(e[2].data)},get:function(){return this._response}}]),e}(),pe=r(14);function fe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function he(e,t,r){return t&&fe(e.prototype,t),r&&fe(e,r),e}var ye=function(){function e(e){!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"_response",{playlistItems:{entries:[]}}),this.requests=this.buildRequests(e),this._entries=e.entries}he(e,null,[{key:"id",get:function(){return"entry_list"}}]);var t=e.prototype;return t.buildRequests=function(e){var t=o.get(),r=[];return e.entries.forEach((function(n){r.push(X.list(t.serviceUrl,e.ks,n.entryId||n,e.redirectFromEntryId,n.referenceId))})),r},t.isValid=function(){return!(!this._entries||!this._entries.length)},he(e,[{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){var t,r=this;e.forEach((function(e){t=new Z(e.data),r._response.playlistItems.entries.push(t.entries[0])}))},get:function(){return this._response}}]),e}(),ge=r(0);function me(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ve=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).hasError||(r.name=t.name,r.description=t.description,r.objTypeAsString=t.objTypeAsString,r.width=t.width,r.height=t.height,r.htmlParams=t.htmlParams,r.swfUrl=t.swfUrl,r.confFilePath=t.confFilePath,r.confFile=t.confFile,r.confFileFeatures=t.confFileFeatures,r.config=t.config,r.confVars=t.confVars,r.useCdn=t.useCdn,r.tags=t.tags,r.swfUrlVersion=t.swfUrlVersion,r.created=new Date(0),r.created.setUTCSeconds(t.createdAt),r.updated=new Date(0),r.updated.setUTCSeconds(t.updatedAt),r.html5Url=t.description,r.version=t.description,r.partnerTags=t.description,r.objType=t.description,r.creationMode=t.description),r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(u.a);function _e(e,t,r,n,a,i,s){try{var o=e[i](s),u=o.value}catch(e){return void r(e)}o.done?t(u):Promise.resolve(u).then(n,a)}function Ee(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function s(e){_e(i,n,a,s,o,"next",e)}function o(e){_e(i,n,a,s,o,"throw",e)}s(void 0)}))}}me(ve,"Type",{PLAYER:1,CONTRIBUTION_WIZARD:2,SIMPLE_EDITOR:3,ADVANCED_EDITOR:4,PLAYLIST:5,APP_STUDIO:6,KRECORD:7,PLAYER_V3:8,KMC_ACCOUNT:9,KMC_ANALYTICS:10,KMC_CONTENT:11,KMC_DASHBOARD:12,KMC_LOGIN:13,PLAYER_SL:14,CLIENTSIDE_ENCODER:15,KMC_GENERAL:16,KMC_ROLES_AND_PERMISSIONS:17,CLIPPER:18,KSR:19,KUPLOAD:20,WEBCASTING:21}),me(ve,"CreationMode",{WIZARD:2,ADVANCED:3});var Ie=function(){function e(){}return e._applyRegexAction=function(e,t){if(e){var r=new RegExp(e.pattern,"i");if(t.match(r))return t.replace(r,e.replacement+"/")}return t},e._isECDNUrlAlive=function(){var t=Ee(regeneratorRuntime.mark((function t(r,n){var a,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=n+"/api_v3/service/system/action/ping/format/1",(i=new XMLHttpRequest).open("GET",a),i.timeout=r.checkAliveTimeoutMs,i.onreadystatechange=function(){if(4===i.readyState)return 200===i.status},i.ontimeout=function(){return e._logger.warn("Got timeout while pinging the ECDN url. the ping url: "+a),!1},i.send();case 7:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),e.handleRegexAction=function(){var t=Ee(regeneratorRuntime.mark((function t(r,n){var a,i,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=o.get().cdnUrl,i=e._extractRegexActionFromData(n),s=e._getRegExp(i),t.t0=a&&i&&s&&a.match(s),!t.t0){t.next=11;break}if(t.t1=i.checkAliveTimeoutMs>0,!t.t1){t.next=10;break}return t.next=9,e._isECDNUrlAlive(i,a.replace(s,i.replacement));case 9:t.t1=!t.sent;case 10:t.t0=!t.t1;case 11:if(!t.t0){t.next=14;break}return e._replaceHostUrls(r,i),t.abrupt("return",r);case 14:return e._logger.debug("exiting handleRegexAction - not applying regex action."),t.abrupt("return",r);case 16:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),e._replaceHostUrls=function(t,r){e._logger.debug("Starting to modify urls...");var n=t.sources,a=n.hls,i=n.dash,s=n.progressive,u=n.image;[].concat(a,i,s,u).forEach((function(t){return t.url=e._applyRegexAction(r,t.url)})),o.get().replaceHostOnlyManifestUrls||(e._logger.debug("replaceHostOnlyManifestUrls flag is off - modifying captions and poster URLs"),n.captions&&n.captions.forEach((function(t){return t.url=e._applyRegexAction(r,t.url)})),"string"==typeof n.poster&&(n.poster=e._applyRegexAction(r,n.poster))),e._logger.debug("Finished modifying urls")},e._extractRegexActionFromData=function(e){var t,r;return null==(t=e.get(ee.id))||null==(r=t.response)?void 0:r.playBackContextResult.getRequestHostRegexAction()},e._getRegExp=function(e){if(e&&e.pattern&&e.replacement)return new RegExp(e.pattern,"i")},e}();!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(Ie,"_logger",Object(a.b)("RegexActionHandler"));var be=Ie;function Re(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Te=function(e){var t,r;function n(t,r){var n;return function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n=e.call(this,t,r)||this),"_filterOptionsConfig",{redirectFromEntryId:!0}),n._logger=Object(a.b)("OVPProvider"),o.set(t.env),n._setFilterOptionsConfig(t.filterOptions),n._networkRetryConfig=Object.assign(n._networkRetryConfig,t.networkRetryParameters),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var i,s,u,c=n.prototype;return c.getMediaConfig=function(e){var t=this;return e.ks&&(this.ks=e.ks,this._isAnonymous=!1),this.widgetId!==this.defaultWidgetId&&(this._isAnonymous=!1),this._dataLoader=new ae(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var a=e.entryId,i=e.referenceId;if(a||i){var s=t.ks;s||(s="{1:result:ks}",t._dataLoader.add(ne,{widgetId:t.widgetId}));var o=t._getEntryRedirectFilter(e);return t._dataLoader.add(ee,{entryId:a,ks:s,redirectFromEntryId:o,referenceId:i}),t._dataLoader.fetchData().then((function(e){try{var a=t._parseDataFromResponse(e);be.handleRegexAction(a,e).then(r)}catch(e){n(e)}}),(function(e){n(e)}))}n(new ge.a(ge.a.Severity.CRITICAL,ge.a.Category.PROVIDER,ge.a.Code.MISSING_MANDATORY_PARAMS,{message:"missing entry id"}))}))},c.doRequest=function(e,t){var r=this,n=t||this.ks,a=new ae(this.playerVersion,this.partnerId,n,this._networkRetryConfig);return new Promise((function(t,i){return n||a.add(ne,{widgetId:r.widgetId}),e.forEach((function(e){a.add(e.loader,e.params,n||"{1:result:ks}")})),a.fetchData().then((function(e){try{t(e)}catch(e){i(e)}}),(function(e){i(e)}))}))},c._getEntryRedirectFilter=function(e){return"boolean"==typeof e.redirectFromEntryId?e.redirectFromEntryId:"boolean"!=typeof this._filterOptionsConfig.redirectFromEntryId||this._filterOptionsConfig.redirectFromEntryId},c._setFilterOptionsConfig=function(e){e&&"boolean"==typeof e.redirectFromEntryId&&(this._filterOptionsConfig.redirectFromEntryId=e.redirectFromEntryId)},c._parseDataFromResponse=function(e){this._logger.debug("Data parsing started");var t={session:{isAnonymous:this._isAnonymous,partnerId:this.partnerId},sources:this._getDefaultSourcesObject(),plugins:{}};if(this.uiConfId&&(t.session.uiConfId=this.uiConfId),e){if(e.has(ne.id)){var r=e.get(ne.id);r&&r.response&&(t.session.ks=r.response,this.widgetId!==this.defaultWidgetId&&(this.ks=t.session.ks))}else t.session.ks=this.ks;if(e.has(ee.id)){var n=e.get(ee.id);if(n&&n.response){var a=n.response;if(K.hasBlockAction(a))throw new ge.a(ge.a.Severity.CRITICAL,ge.a.Category.SERVICE,ge.a.Code.BLOCK_ACTION,{action:K.getBlockAction(a),messages:K.getErrorMessages(a)});var i=K.getMediaEntry(this.isAnonymous?"":this.ks,this.partnerId,this.uiConfId,a);Object.assign(t.sources,this._getSourcesObject(i)),this._verifyMediaStatus(i),this._verifyHasSources(t.sources);var s=K.getBumper(a,this.isAnonymous?"":this.ks,this.partnerId);s&&Object.assign(t.plugins,{bumper:s})}}}return this._logger.debug("Data parsing finished",t),t},c._verifyMediaStatus=function(e){if([A.EntryStatus.IMPORT,A.EntryStatus.PRECONVERT].includes(e.status))throw new ge.a(ge.a.Severity.CRITICAL,ge.a.Category.SERVICE,ge.a.Code.MEDIA_STATUS_NOT_READY,{messages:"Status of entry id "+e.id+" is "+e.status+" and is still being imported or converted",data:{status:status}})},c.getPlaylistConfig=function(e){var t=this;return e.ks&&(this.ks=e.ks,this._isAnonymous=!1),this.widgetId!==this.defaultWidgetId&&(this._isAnonymous=!1),this._dataLoader=new ae(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var a=e.playlistId;if(a){var i=t.ks;i||(i="{1:result:ks}",t._dataLoader.add(ne,{widgetId:t.widgetId})),t._dataLoader.add(de,{playlistId:a,ks:i}),t._dataLoader.fetchData().then((function(e){r(t._parsePlaylistDataFromResponse(e))}),(function(e){n(e)}))}else n({success:!1,data:"Missing mandatory parameter"})}))},c._parsePlaylistDataFromResponse=function(e){var t=this;this._logger.debug("Data parsing started");var r=this._getPlaylistObject();if(e&&e.has(de.id)){var n=e.get(de.id);if(n&&n.response){var a=K.getPlaylist(n.response);r.id=a.id,r.poster=a.poster,r.metadata.name=a.name,r.metadata.description=a.description,r.playlistLastEntryId=a.playlistLastEntryId,a.items.forEach((function(e){return r.items.push({sources:t._getSourcesObject(e)})}))}}return this._logger.debug("Data parsing finished",r),r},c.getEntryListConfig=function(e){var t=this;return e.ks&&(this.ks=e.ks,this._isAnonymous=!1),this.widgetId!==this.defaultWidgetId&&(this._isAnonymous=!1),this._dataLoader=new ae(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var a=e.entries;if(a&&a.length){var i=t.ks;i||(i="{1:result:ks}",t._dataLoader.add(ne,{widgetId:t.widgetId}));var s=t._getEntryRedirectFilter(e);t._dataLoader.add(ye,{entries:a,ks:i,redirectFromEntryId:s}),t._dataLoader.fetchData(!1).then((function(e){r(t._parseEntryListDataFromResponse(e))}),(function(e){n(e)}))}else n({success:!1,data:"Missing mandatory parameter"})}))},c._parseEntryListDataFromResponse=function(e){var t=this;this._logger.debug("Data parsing started");var r=this._getPlaylistObject();if(e&&e.has(ye.id)){var n=e.get(ye.id);if(n&&n.response)K.getEntryList(n.response).items.forEach((function(e){return r.items.push({sources:t._getSourcesObject(e)})}))}return this._logger.debug("Data parsing finished",r),r},c._getPlaylistObject=function(){return{id:"",metadata:{name:"",description:""},poster:"",playlistLastEntryId:"",items:[]}},c._getDefaultSourcesObject=function(){return{hls:[],dash:[],progressive:[],image:[],id:"",duration:0,type:S.a.Type.UNKNOWN,poster:"",dvr:!1,vr:null,metadata:{name:"",description:"",tags:""}}},c._getSourcesObject=function(e){var t=this._getDefaultSourcesObject(),r=e.sources.toJSON();return t.hls=r.hls,t.dash=r.dash,t.progressive=r.progressive,t.image=r.image,t.id=e.id,t.duration=e.duration,t.type=e.type,t.dvr=!!e.dvrStatus,t.poster=e.poster,t.downloadUrl=e.downloadUrl,e.sources.captions&&(t.captions=e.sources.captions),e.metadata&&"string"==typeof e.metadata.tags&&e.metadata.tags.split(", ").includes("360")&&(t.vr={}),Object.assign(t.metadata,e.metadata),t},i=n,(s=[{key:"env",get:function(){return o.get()}}])&&Re(i.prototype,s),u&&Re(i,u),n}(pe.a),Oe="@playkit-js/playkit-js-providers-ovp",Ae="2.40.0"}])}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ovp=t():(e.playkit=e.playkit||{},e.playkit.providers=e.playkit.providers||{},e.playkit.providers.ovp=t())}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=18)}([function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(2);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function e(t,r,n,a){void 0===a&&(a={}),this.severity=t,this.category=r,this.code=n,this.data=a,e._logger.error("Category:"+r+" | Code:"+n+" |",a)};a(i,"Severity",{RECOVERABLE:1,CRITICAL:2}),a(i,"Category",{NETWORK:1,SERVICE:2,PROVIDER:3}),a(i,"Code",{UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,BAD_SERVER_RESPONSE:1005,MULTIREQUEST_API_ERROR:1006,API_RESPONSE_MISMATCH:1007,ERROR:2e3,BLOCK_ACTION:2001,MEDIA_STATUS_NOT_READY:2002,MISSING_MANDATORY_PARAMS:3e3,MISSING_PLAY_SOURCE:3001,METHOD_NOT_IMPLEMENTED:3002}),a(i,"_logger",Object(n.b)("Error"))},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(8);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function(){function e(){this.metadata=new Map,this.sources=new n.a,this.type=e.Type.UNKNOWN}return e.prototype.toJSON=function(){return{id:this.id,name:this.name,sources:this.sources.toJSON(),duration:this.duration,dvrStatus:this.dvrStatus,status:this.status,metadata:this.metadata,type:this.type,poster:this.poster,assetReferenceType:this.assetReferenceType,downloadUrl:this.downloadUrl}},e}();a(i,"Type",{VOD:"Vod",LIVE:"Live",IMAGE:"Image",AUDIO:"Audio",UNKNOWN:"Unknown"}),a(i,"DvrStatus",{ON:1,OFF:0})},function(e,t,r){"use strict";r.d(t,"c",(function(){return o})),r.d(t,"d",(function(){return u})),r.d(t,"e",(function(){return i})),r.d(t,"a",(function(){return a}));var n={get:function(){return{VERSION:"",DEBUG:{value:"",name:""},ERROR:{value:"",name:""},INFO:{value:"",name:""},OFF:{value:"",name:""},TIME:{value:"",name:""},TRACE:{value:"",name:""},WARN:{value:"",name:""},createDefaultHandler:function(){},debug:function(){},enabledFor:function(){},error:function(){},get:function(){},getLevel:function(){},info:function(){},log:function(){},setHandler:function(){},setLevel:function(){},time:function(){},timeEnd:function(){},trace:function(){},useDefaults:function(){},warn:function(){}}}},a={};function i(e){e&&"function"==typeof e.getLogger&&(n.get=e.getLogger),e&&e.LogLevel&&(a=e.LogLevel)}function s(e){return n.get(e)}function o(e){return s(e).getLevel()}function u(e,t){s(t).setLevel(e)}t.b=s},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function(){function e(e){void 0===e&&(e=new Map),a(this,"retryConfig",{async:!0,timeout:0,maxAttempts:4}),a(this,"_attemptCounter",1),this.headers=e}var t=e.prototype;return t.getUrl=function(e){return e+"/service/"+this.service+(this.action?"/action/"+this.action:"")},t.doHttpRequest=function(){var e=this,t=new Promise((function(t,r){e._requestPromise={resolve:t,reject:r}}));return this.url||this._requestPromise.reject(new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,n.a.Code.MALFORMED_DATA_URI,{url:this.url})),this._createXHR(),t},t._createXHR=function(){var e=this,t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===t.readyState&&200===t.status)try{var r=JSON.parse(t.responseText);return e.responseHeaders=e._getResponseHeaders(t),e._requestPromise.resolve(r)}catch(r){e._requestPromise.reject(e._createError(t,n.a.Code.BAD_SERVER_RESPONSE,{text:t.responseText}))}},t.open(this.method,this.url,this.retryConfig.async),this.retryConfig.async&&this.retryConfig.timeout&&(t.timeout=this.retryConfig.timeout);var r=performance.now();t.ontimeout=function(){e._handleError(t,n.a.Code.TIMEOUT,{timeout:(performance.now()-r)/1e3,statusText:t.statusText})},t.onerror=t.onabort=function(){e._handleError(t,n.a.Code.HTTP_ERROR,{text:t.responseText,statusText:t.statusText})},this.headers.forEach((function(e,r){t.setRequestHeader(r,e)})),t.send(this.params)},t._getResponseHeaders=function(e){return e.getAllResponseHeaders().split("\n").filter((function(e){return 0===e.toLowerCase().indexOf("x-")}))},t._handleError=function(e,t,r){var n=this._createError(e,t,r);if(e.onreadystatechange=function(){},e.onerror=function(){},e.ontimeout=function(){},e.onabort=function(){},!(this.retryConfig.maxAttempts&&this._attemptCounter<this.retryConfig.maxAttempts))return this._requestPromise.reject(n);this._attemptCounter++,this._createXHR()},t._createError=function(e,t,r){return Object.assign(r,{url:this.url,headers:this._getResponseHeaders(e),attempt:this._attemptCounter}),new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,t,r)},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){var t,r,n;n=!1,(r="hasError")in(t=this)?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,"KalturaAPIException"===e.objectType?(this.hasError=!0,this.error=new a(e.code,e.message)):e.error&&"KalturaAPIException"===e.error.objectType?(this.hasError=!0,this.error=new a(e.error.code,e.error.message)):this.data=e},a=function(e,t){this.code=e,this.message=t}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return i}));var n={DASH:{name:"dash",mimeType:"application/dash+xml",pathExt:"mpd"},HLS:{name:"hls",mimeType:"application/x-mpegURL",pathExt:"m3u8"},WVM:{name:"wvm",mimeType:"video/wvm",pathExt:"wvm"},MP4:{name:"mp4",mimeType:"video/mp4",pathExt:"mp4"},MP3:{name:"mp3",mimeType:"audio/mpeg",pathExt:"mp3"}},a=new Map([["mpegdash",n.DASH],["applehttp",n.HLS],["url",n.MP4]]);function i(e){var t=a.get(e);return!!t&&t.name===n.MP4.name}},function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n,a,i,s=function(e){this.scheme=e.scheme,this.licenseURL=e.licenseURL,this.certificate=e.certificate};i={"drm.PLAYREADY_CENC":"com.microsoft.playready","drm.WIDEVINE_CENC":"com.widevine.alpha","fairplay.FAIRPLAY":"com.apple.fairplay",WIDEVINE_CENC:"com.widevine.alpha",PLAYREADY_CENC:"com.microsoft.playready",FAIRPLAY:"com.apple.fairplay"},(a="Scheme")in(n=s)?Object.defineProperty(n,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[a]=i},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){this.message=e.message,this.code=e.code}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));r(9);var n=r(5),a=(r(13),function(){function e(){this.progressive=[],this.dash=[],this.hls=[],this.image=[]}var t=e.prototype;return t.map=function(e,t){if(t)switch(t.name){case n.a.MP4.name:this.progressive.push(e);break;case n.a.DASH.name:this.dash.push(e);break;case n.a.HLS.name:this.hls.push(e)}},t.toJSON=function(){var e={progressive:[],dash:[],hls:[],image:[]};return this.progressive.forEach((function(t){return e.progressive.push(t.toJSON())})),this.hls.forEach((function(t){return e.hls.push(t.toJSON())})),this.dash.forEach((function(t){return e.dash.push(t.toJSON())})),e.image=this.image,e},e}())},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));r(12);var n=function(){function e(){}return e.prototype.toJSON=function(){var e={id:this.id,url:this.url,mimetype:this.mimetype};return this.bandwidth&&(e.bandwidth=this.bandwidth),this.width&&(e.width=this.width),this.height&&(e.height=this.height),this.label&&(e.label=this.label),this.drmData&&this.drmData.length>0&&(e.drmData=[],this.drmData.forEach((function(t){Array.isArray(e.drmData)&&e.drmData.push(t.toJSON())}))),e},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));r(11);var n=r(0);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function(){function e(e){a(this,"_loadersResponseMap",new Map),a(this,"_loaders",new Map),this._networkRetryConfig=e}var t=e.prototype;return t.add=function(e,t,r){var n=this,a=new e(t);if(a.isValid()){this._loaders.set(e.id,a);var i=this._multiRequest.requests.length,s=a.requests;this._multiRequest.retryConfig=this._networkRetryConfig,s.forEach((function(e){e.params=e.params||{},e.params.ks=e.params.ks||r,n._multiRequest.add(e)}));var o=Array.from(new Array(s.length),(function(e,t){return t+i}));this._loadersResponseMap.set(e.id,o)}},t.fetchData=function(e){var t=this;return new Promise((function(r,a){t._multiRequest.execute(e).then((function(e){t._multiResponse=e.response,t.prepareData(e.response).success?r(t._loaders):a(new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,n.a.Code.API_RESPONSE_MISMATCH,{headers:e.headers}))}),(function(e){a(e)}))}))},t.prepareData=function(e){var t=this;return this._loaders.forEach((function(r,n){var a=t._loadersResponseMap.get(n);try{a&&a.length>0&&(r.response=e.results.slice(a[0],a[a.length-1]+1))}catch(e){return{success:!1,error:e}}})),{success:!0,data:this._loaders}},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(3),a=r(2),i=r(4),s=r(0);function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var c=function(e){var t,r;function n(){for(var t,r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return u(o(t=e.call.apply(e,[this].concat(n))||this),"requests",[]),t}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var a=n.prototype;return a.add=function(e){var t;this.requests.push(e);var r={},n={service:e.service,action:e.action};return Object.assign(r,((t={})[this.requests.length]=Object.assign(n,e.params),t)),Object.assign(r,this.params),this.params=r,this},a.execute=function(e){var t=this;return new Promise((function(r,a){try{t.params=JSON.stringify(t.params)}catch(e){n._logger.error(""+e.message),a(new s.a(s.a.Severity.CRITICAL,s.a.Category.PROVIDER,s.a.Code.FAILED_PARSING_REQUEST,{error:e,params:t.params}))}t.doHttpRequest().then((function(n){var i=new l(n,e);i.success?r({headers:t.responseHeaders,response:i}):a(new s.a(s.a.Severity.CRITICAL,s.a.Category.NETWORK,s.a.Code.MULTIREQUEST_API_ERROR,{url:t.url,headers:t.responseHeaders,results:i.results}))}),(function(e){a(e)}))}))},n}(n.a);u(c,"_logger",Object(a.b)("MultiRequestBuilder"));var l=function e(t,r){void 0===r&&(r=!0),u(this,"results",[]);var n=t.result?t.result:t,a=(Array.isArray(n)?n:[n]).map((function(e){return new i.a(e)})),s=a.filter((function(e){return e.hasError}));s.forEach((function(t){e._logger.error("Service returned an error with error code: "+t.error.code+" and message: "+t.error.message+".")})),this.results=a,r&&s.length||s.length===this.results.length?this.success=!1:(this.results=this.results.filter((function(e){return!e.hasError})),this.success=!0)};u(l,"_logger",Object(a.b)("MultiRequestResult"))},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){function e(e,t,r){this.licenseUrl=e,this.scheme=t,r&&(this.certificate=r)}return e.prototype.toJSON=function(){var e={licenseUrl:this.licenseUrl,scheme:this.scheme};return this.certificate&&(e.certificate=this.certificate),e},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){function e(t){this.id=t.id,this.url=e.extractBaseThumbnailUrl(t.dataUrl),this.mimetype=""}return e.extractBaseThumbnailUrl=function(e){return e.match(".+entry_id/[a-zA-Z0-9_]+/")[0].slice(0,-1)},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(2),a=(r(10),r(0));function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),e}var o=function(){function e(e,t){var r,a,i;i={async:!0,timeout:0,maxAttempts:4},(a="_networkRetryConfig")in(r=this)?Object.defineProperty(r,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[a]=i,Object(n.e)(e.logger),this._partnerId=e.partnerId,this._widgetId=e.widgetId,this._uiConfId=e.uiConfId,this._isAnonymous=!e.ks,this._ks=e.ks||"",this._playerVersion=t}s(e,[{key:"partnerId",get:function(){return this._partnerId}},{key:"widgetId",get:function(){return this._widgetId||this.defaultWidgetId}},{key:"defaultWidgetId",get:function(){return"_"+this._partnerId}},{key:"uiConfId",get:function(){return this._uiConfId}},{key:"ks",get:function(){return this._ks},set:function(e){this._ks=e}},{key:"playerVersion",get:function(){return this._playerVersion}},{key:"isAnonymous",get:function(){return this._isAnonymous}}]);var t=e.prototype;return t.getMediaConfig=function(e){return Promise.reject(new a.a(a.a.Severity.CRITICAL,a.a.Category.PROVIDER,a.a.Code.METHOD_NOT_IMPLEMENTED,{message:"getMediaConfig method must be implement by the derived class"}))},t.getPlaylistConfig=function(e){return Promise.reject(new a.a(a.a.Severity.CRITICAL,a.a.Category.PROVIDER,a.a.Code.METHOD_NOT_IMPLEMENTED,{message:"The provider does not support loading playlist by id"}))},t.getEntryListConfig=function(e){return Promise.reject(new a.a(a.a.Severity.CRITICAL,a.a.Category.PROVIDER,a.a.Code.METHOD_NOT_IMPLEMENTED,{message:"The provider does not support loading entry list"}))},t._verifyHasSources=function(e){if(0===e.hls.concat(e.dash,e.progressive,e.image).length)throw new a.a(a.a.Severity.CRITICAL,a.a.Category.SERVICE,a.a.Code.MISSING_PLAY_SOURCE,{action:"",messages:"No play source for entry id: "+e.id})},t.getLogLevel=function(e){return Object(n.c)(e)},t.setLogLevel=function(e,t){Object(n.d)(e,t)},s(e,[{key:"LogLevel",get:function(){return n.a}}]),e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function e(t){var r;return Array.isArray(t)?(r=t.length>0?t.slice(0):[]).forEach((function(t,n){("object"==typeof t&&t!=={}||Array.isArray(t)&&t.length>0)&&(r[n]=e(t))})):"object"==typeof t?(r=Object.assign({},t),Object.keys(r).forEach((function(t){("object"==typeof r[t]&&r[t]!=={}||Array.isArray(r[t])&&r[t].length>0)&&(r[t]=e(r[t]))}))):r=t,r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));r(1);var n=function(){this.items=[]}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){this.url=e.url,this.clickThroughUrl=e.clickThroughUrl}},function(e,t,r){"use strict";r.r(t),r.d(t,"Provider",(function(){return Te})),r.d(t,"ProviderParser",(function(){return K})),r.d(t,"NAME",(function(){return Oe})),r.d(t,"VERSION",(function(){return Ae})),r.d(t,"RequestBuilder",(function(){return W.a})),r.d(t,"ResponseTypes",(function(){return n}));var n={};r.r(n),r.d(n,"KalturaBaseEntryListResponse",(function(){return Z})),r.d(n,"KalturaMediaEntry",(function(){return A})),r.d(n,"KalturaAccessControlModifyRequestHostRegexAction",(function(){return g})),r.d(n,"KalturaBumper",(function(){return v})),r.d(n,"KalturaFlavorAsset",(function(){return m})),r.d(n,"KalturaMediaEntries",(function(){return oe})),r.d(n,"KalturaMetadata",(function(){return R})),r.d(n,"KalturaMetadataListResponse",(function(){return T})),r.d(n,"KalturaPlaybackContext",(function(){return I})),r.d(n,"KalturaPlaybackSource",(function(){return d})),r.d(n,"KalturaPlaylist",(function(){return se})),r.d(n,"KalturaRuleAction",(function(){return y})),r.d(n,"KalturaUIConfResponse",(function(){return ve})),r.d(n,"KalturaDrmPlaybackPluginData",(function(){return l.a})),r.d(n,"KalturaAccessControlMessage",(function(){return c.a})),r.d(n,"BaseServiceResult",(function(){return u.a}));var a=r(2),i=r(15),s={serviceUrl:"https://cdnapisec.kaltura.com/api_v3",cdnUrl:"https://cdnapisec.kaltura.com",serviceParams:{apiVersion:"3.3.0",format:1},useApiCaptions:!0,loadThumbnailWithKs:!1,replaceHostOnlyManifestUrls:!1},o=function(){function e(){}return e.set=function(e){e&&Object.assign(s,e)},e.get=function(){return Object(i.a)(s)},e}(),u=r(4),c=r(7),l=r(6);var d=function(){function e(e){var t,r,n,a=this;n=[],(r="drm")in(t=this)?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,this.format=e.format,this.deliveryProfileId=e.deliveryProfileId,this.url=e.url,this.protocols=e.protocols,this.flavorIds=e.flavorIds,e.drm&&e.drm.map((function(e){return a.drm.push(new l.a(e))}))}var t=e.prototype;return t.hasDrmData=function(){return this.drm&&this.drm.length>0},t.hasFlavorIds=function(){return!!this.flavorIds&&this.flavorIds.length>0},t.getProtocol=function(e){var t="";if(this.protocols&&this.protocols.length>0)this.protocols.split(",").forEach((function(r){r===e&&(t=r)}));else if("http"===e)return e;return t},e}();var p,f,h,y=function(e){this.type=e.type};h={DRM_POLICY:"drm.DRM_POLICY",BLOCK:1,PREVIEW:2,LIMIT_FLAVORS:3,ADD_TO_STORAGE:4,LIMIT_DELIVERY_PROFILES:5,SERVE_FROM_REMOTE_SERVER:6,REQUEST_HOST_REGEX:7,LIMIT_THUMBNAIL_CAPTURE:8},(f="Type")in(p=y)?Object.defineProperty(p,f,{value:h,enumerable:!0,configurable:!0,writable:!0}):p[f]=h;var g=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).pattern=t.pattern,r.replacement=t.replacement,r.replacmenServerNodeId=t.replacmenServerNodeId,r.checkAliveTimeoutMs=t.checkAliveTimeoutMs,r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(y);var m=function(e){this.id=e.id,this.flavorParamsId=e.flavorParamsId,this.fileExt=e.fileExt,this.bitrate=e.bitrate,this.width=e.width,this.height=e.height,this.id=e.id,this.frameRate=e.frameRate,this.isOriginal=e.isOriginal,this.isWeb=e.isWeb,this.containerFormat=e.containerFormat,this.videoCodecId=e.videoCodecId,this.status=e.status,this.language=e.language,this.label=e.label};!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(m,"Status",{ERROR:-1,QUEUED:0,CONVERTING:1,READY:2,DELETED:3,NOT_APPLICABLE:4,TEMP:5,WAIT_FOR_CONVERT:6,IMPORTING:7,VALIDATING:8,EXPORTING:9});var v=function(e){this.entryId=e.entryId,this.clickThroughUrl=e.url,this.sources=e.sources?e.sources.map((function(e){return new d(e)})):[]};function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var I=function(e){var t,r;function n(t){var r;if(E(_(r=e.call(this,t)||this),"sources",[]),E(_(r),"actions",[]),E(_(r),"messages",[]),E(_(r),"flavorAssets",[]),E(_(r),"bumperData",[]),!r.hasError){var n=t.messages;n&&n.map((function(e){return r.messages.push(new c.a(e))}));var a=t.actions;a&&a.map((function(e){e.type===y.Type.REQUEST_HOST_REGEX?r.actions.push(new g(e)):r.actions.push(new y(e))}));var i=t.sources;i&&i.map((function(e){return r.sources.push(new d(e))}));var s=t.flavorAssets;s&&s.map((function(e){return r.flavorAssets.push(new m(e))}));var o=t.bumperData;o&&o.map((function(e){return r.bumperData.push(new v(e))}))}return r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var a=n.prototype;return a.hasBlockAction=function(){return void 0!==this.getBlockAction()},a.getBlockAction=function(){return this.actions.find((function(e){return e.type===y.Type.BLOCK}))},a.getErrorMessages=function(){return this.messages},a.getRequestHostRegexAction=function(){var e=this.actions.find((function(e){return e.type===y.Type.REQUEST_HOST_REGEX}));if(e instanceof g)return e},n}(u.a);function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var R=function(e){this.id=e.id,this.metadataProfileId=e.metadataProfileId,this.metadataProfileVersion=e.metadataProfileVersion,this.metadataProfileId=e.metadataProfileId,this.metadataObjectType=e.metadataObjectType,this.objectId=e.objectId,this.version=e.version,this.created=new Date(0),this.created.setUTCSeconds(e.createdAt),this.updated=new Date(0),this.updated.setUTCSeconds(e.updatedAt),this.status=e.status,this.xml=e.xml};b(R,"ObjectType",{AD_CUE_POINT:"adCuePointMetadata.AdCuePoint",ANNOTATION:"annotationMetadata.Annotation",CODE_CUE_POINT:"codeCuePointMetadata.CodeCuePoint",THUMB_CUE_POINT:"thumbCuePointMetadata.thumbCuePoint",ENTRY:1,CATEGORY:2,USER:3,PARTNER:4,DYNAMIC_OBJECT:5}),b(R,"Status",{VALID:1,INVALID:2,DELETED:3});var T=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).hasError||(r.totalCount=t.totalCount,r.totalCount>0&&(r.metas=[],t.objects.map((function(e){return r.metas.push(new R(e))})))),r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(u.a);function O(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var A=function(e){this.id=e.id,this.referenceId=e.referenceId,this.externalSourceType=e.externalSourceType,this.name=e.name,this.description=e.description,this.dataUrl=e.dataUrl,this.type=e.type,this.entryType=e.mediaType,this.flavorParamsIds=e.flavorParamsIds,this.duration=e.duration,this.poster=e.thumbnailUrl,this.status=e.status,this.dvrStatus=e.dvrStatus,this.tags=e.tags,this.createdAt=e.createdAt,this.updatedAt=e.updatedAt,this.creatorId=e.creatorId,this.endDate=e.endDate,this.plays=e.plays,this.views=e.views,this.downloadUrl=e.downloadUrl};O(A,"EntryType",{AUTOMATIC:{value:-1},EXTERNAL_MEDIA:{value:"externalMedia.externalMedia"},MEDIA_CLIP:{value:1},MIX:{value:2},PLAYLIST:{value:5},DATA:{value:6},LIVE_STREAM:{value:7},LIVE_CHANNEL:{value:8},DOCUMENT:{value:10}}),O(A,"MediaType",{VIDEO:{value:1},IMAGE:{value:2},AUDIO:{value:5},LIVE_STREAM_FLASH:{value:201},LIVE_STREAM_WINDOWS_MEDIA:{value:202},LIVE_STREAM_REAL_MEDIA:{value:203},LIVE_STREAM_QUICK_TIME:{value:204}}),O(A,"EntryStatus",{ERROR_IMPORTING:-2,ERROR_CONVERTING:-1,SCAN_FAILURE:"virusScan.ScanFailure",IMPORT:0,INFECTED:"virusScan.Infected",PRECONVERT:1,READY:2,DELETED:3,PENDING:4,MODERATE:5,BLOCKED:6,NO_CONTENT:7}),O(A,"EntryModerationStatus",{PENDING_MODERATION:1,APPROVED:2,REJECTED:3,FLAGGED_FOR_REVIEW:4,MODERATE:5,AUTO_APPROVED:6});var C=function(e){this.playlistLastEntryId=e.playlistLastEntryId,this.entryId=e.entryId,this.id=e.id,this.userId=e.userId,this.partnerId=e.partnerId,this.status=e.status,this.createdAt=e.createdAt,this.updatedAt=e.updatedAt},w=function(){function e(){}return e.build=function(e){var t=o.get(),r=t.serviceUrl.substr(0,t.serviceUrl.lastIndexOf("/")),n=e.partnerId,a=e.entryId,i=e.ks,s=e.uiConfId,u=e.format,c=e.protocol,l=e.extension,d=e.flavorIds;if(!r||isNaN(Number.parseInt(n))||!a||!u||!c)return"";var p=r;return r.endsWith("/")||(p+="/"),p+="p/"+n+"/sp/"+n+"00/playManifest/entryId/"+a+"/protocol/"+c+"/format/"+u,d?p+="/flavorIds/"+d:s&&(p+="/uiConfId/"+s),""!==i&&(p+="/ks/"+i),""!==l&&(p+="/a."+l),s&&""!==d&&(p+="?uiConfId="+s),p},e}(),P=function(){function e(){}return e.xmlToJson=function(e){var t={};if(1===e.nodeType){if(e.attributes.length>0){t["@attributes"]={};for(var r=0;r<e.attributes.length;r++){var n=e.attributes.item(r);t["@attributes"][n.nodeName]=n.nodeValue}}}else 3===e.nodeType&&(t=e.nodeValue);if(e.hasChildNodes())for(var a=0;a<e.childNodes.length;a++){var i=e.childNodes.item(a),s=i.nodeName;if(void 0===t[s])t[s]=this.xmlToJson(i);else{if(void 0===t[s].push){var o=t[s];t[s]=[],t[s].push(o)}t[s].push(this.xmlToJson(i))}}return t},e}(),S=r(1),D=r(12),M=r(9),k=r(8),L=r(5),N=function(){this.items=[]},U=r(16),j=r(17),x={SRT:"1",DFXP:"2",WEBVTT:"3",CAP:"4"},V={3:"vtt",1:"srt"},F=function(){function e(){}return e.createConfig=function(e,t){return e.map((function(e){var r=e.url,n=V[e.format];return[x.DFXP,x.CAP].includes(e.format)&&(r=e.webVttUrl,n=V[x.WEBVTT]),r=B(r,t),{default:!!e.isDefault,type:n,language:e.languageCode,label:e.label,url:r}}))},e}(),q=r(13);var H=function(){function e(){}return e.getMediaEntry=function(t,r,n,a){var i=new S.a,s=a.entry,u=a.playBackContextResult,c=a.metadataListResult,l=u.sources;return i.sources=e._getParsedSources(l,t,r,n,s,u),e._fillBaseData(i,s,c),i.type!==S.a.Type.LIVE&&o.get().useApiCaptions&&u.data.playbackCaptions&&(i.sources.captions=F.createConfig(u.data.playbackCaptions,t)),i},e.addKsToUrl=function(e,t){var r;return t?(r=-1!==e.split("?")[0].replace(/^.*[\\/]/,"").indexOf(".")?-1===e.indexOf("?")?"?ks=":"&ks=":"/ks/",e+r+t):e},e.getPlaylist=function(t){var r=new N,n=t.playlistData,a=t.playlistItems.entries,i=t.playlistUserEntries.entries;return r.id=n.id,r.name=n.name,r.description=n.description,r.poster=n.poster,r.playlistLastEntryId=i.map((function(e){return e.playlistLastEntryId}))[0],a.forEach((function(t){var n=new S.a;e._fillBaseData(n,t),r.items.push(n)})),r},e.getEntryList=function(t){var r=new U.a;return t.playlistItems.entries.forEach((function(t){var n=new S.a;e._fillBaseData(n,t),r.items.push(n)})),r},e.getBumper=function(t,r,n){var a=t.playBackContextResult,i=a.bumperData[0];if(i){var s=(i&&i.sources).find((function(e){return Object(L.c)(e.format)}));if(s){var o=e._parseProgressiveSources(s,a,r,n,0,i.entryId);if(o[0])return new j.a({url:o[0].url,clickThroughUrl:i.clickThroughUrl})}}},e._fillBaseData=function(t,r,n){return t.poster=r.poster,t.id=r.id,t.duration=r.duration,t.downloadUrl=r.downloadUrl||"",t.metadata=e._parseMetadata(n),t.metadata.description=r.description||"",t.metadata.entryId=r.id||"",t.metadata.name=r.name||"",r.createdAt&&(t.metadata.createdAt=r.createdAt),r.updatedAt&&(t.metadata.updatedAt=r.updatedAt),r.creatorId&&(t.metadata.creatorId=r.creatorId),r.endDate&&(t.metadata.endDate=r.endDate),r.views&&(t.metadata.views=r.views),r.plays&&(t.metadata.plays=r.plays),t.metadata.tags=r.tags||"",t.status=r.status,t.type=e._getEntryType(r.entryType,r.type),t.type===S.a.Type.LIVE&&(t.dvrStatus=r.dvrStatus),t},e._getEntryType=function(e,t){var r=S.a.Type.UNKNOWN;switch(e){case A.MediaType.IMAGE.value:r=S.a.Type.IMAGE;break;case A.MediaType.AUDIO.value:r=S.a.Type.AUDIO;break;default:switch(t){case A.EntryType.MEDIA_CLIP.value:r=S.a.Type.VOD;break;case A.EntryType.LIVE_STREAM.value:case A.EntryType.LIVE_CHANNEL.value:r=S.a.Type.LIVE;break;default:r=S.a.Type.UNKNOWN}}return r},e._getParsedSources=function(t,r,n,a,i,s){var o,u,c=new k.a,l=function(t){var o=e._parseAdaptiveSource(t,s,r,n,a,i.id);if(o){var u=L.b.get(t.format);c.map(o,u)}};return i.type===A.EntryType.EXTERNAL_MEDIA.value?((u=new M.a).mimetype="video/youtube",u.url=i.referenceId,u.id=i.id+"_youtube",c.progressive.push(u)):i.entryType===A.MediaType.IMAGE.value?c.image.push(new q.a(i)):t&&t.length>0&&(t.filter((function(e){return!Object(L.c)(e.format)})).forEach(l),o=t.find((function(t){return Object(L.c)(t.format)&&""!==t.getProtocol(e._getBaseProtocol())})),c.progressive=e._parseProgressiveSources(o,s,r,n,a,i.id)),c},e._parseAdaptiveSource=function(t,r,n,a,i,s){var o=new M.a;if(t){var u="",c=L.b.get(t.format),d=t.getProtocol(e._getBaseProtocol()),p=t.deliveryProfileId,f=t.format,h="";if(c&&(h=c.pathExt,o.mimetype=c.mimeType),t.hasFlavorIds()?(!h&&r.flavorAssets&&r.flavorAssets.length>0&&(h=r.flavorAssets[0].fileExt),u=w.build({entryId:s,flavorIds:t.flavorIds,format:f,ks:n,partnerId:a,uiConfId:i,extension:h,protocol:d})):u=e.addKsToUrl(t.url,n),!u){var y="failed to create play url from source, discarding source: ("+s+"_"+p+"), "+f;return e._logger.warn(y),null}if(o.url=u,o.id=s+"_"+p+","+f,t.hasDrmData()){var g=[];t.drm.forEach((function(e){g.push(new D.a(e.licenseURL,l.a.Scheme[e.scheme],e.certificate))})),o.drmData=g}}return o},e._parseProgressiveSources=function(t,r,n,a,i,s){var o=[],u=[];if(t){var c=t.getProtocol(e._getBaseProtocol()),l=t.format,d=t.deliveryProfileId,p=d+","+l;r.flavorAssets.map((function(t){var r=new M.a;r.id=t.id+p,r.mimetype="mp3"===t.fileExt?"audio/mp3":"video/mp4",r.height=t.height,r.width=t.width,r.bandwidth=1024*t.bitrate,r.label=t.label||t.language;var f=w.build({entryId:s,flavorIds:t.id,format:l,ks:n,partnerId:a,uiConfId:i,extension:t.fileExt,protocol:c});if(""===f)return e._logger.warn("failed to create play url from source, discarding source: ("+s+"_"+d+"), "+l+"."),null;r.url=f,t.height&&t.width?o.push(r):u.push(r)}))}return u.length&&!o.length?u:o},e._parseMetadata=function(e){var t={};return e&&e.metas&&e.metas.length>0&&e.metas.forEach((function(e){if(e.xml){var r,n=new DOMParser;e.xml=e.xml.replace(/\r?\n|\r/g,""),e.xml=e.xml.replace(/>\s*/g,">"),e.xml=e.xml.replace(/>\s*/g,">"),r=n.parseFromString(e.xml,"text/xml");var a=P.xmlToJson(r);Object.keys(a.metadata).forEach((function(e){t[e]=a.metadata[e]["#text"]}))}})),t},e._getBaseProtocol=function(){var e=o.get(),t=/^https?:/.exec(e.cdnUrl),r=t?t[0]:document.location.protocol;return"string"==typeof r?r.slice(0,-1):"https"},e.hasBlockAction=function(e){return e.playBackContextResult.hasBlockAction()},e.getBlockAction=function(e){return e.playBackContextResult.getBlockAction()},e.getErrorMessages=function(e){return e.playBackContextResult.getErrorMessages()},e}();!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(H,"_logger",Object(a.b)("OVPProviderParser"));var B=H.addKsToUrl,K=H,W=r(3),G=r(11),Y=function(){function e(){}return e.getMultiRequest=function(e,t,r){var n=o.get(),a=n.serviceParams;Object.assign(a,{ks:t,clientTag:"html5:v"+e}),r&&Object.assign(a,{partnerId:r});var i=new Map;i.set("Content-Type","application/json");var s=new G.a(i);return s.method="POST",s.service="multirequest",s.url=s.getUrl(n.serviceUrl),s.params=a,s},e}();var J=function e(t){void 0===t&&(t={}),this.type=t.type||e.Type.INCLUDE_FIELDS,this.fields=t.fields||"id,referenceId,name,description,thumbnailUrl,dataUrl,duration,msDuration,flavorParamsIds,mediaType,type,tags,dvrStatus,externalSourceType,status,createdAt,updatedAt,endDate,plays,views,downloadUrl,creatorId"};!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(J,"Type",{INCLUDE_FIELDS:1,EXCLUDE_FIELDS:2});var X=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.getPlaybackContext=function(e,t,r){var n=new Map;n.set("Content-Type","application/json");var a=new W.a(n);a.service="baseEntry",a.action="getPlaybackContext",a.method="POST",a.url=a.getUrl(e),a.tag="baseEntry-getPlaybackContext";return a.params={entryId:r,ks:t,contextDataParams:{objectType:"KalturaContextDataParams",flavorTags:"all"}},a},n.list=function(e,t,r,a,i){var s=new Map;s.set("Content-Type","application/json");var o=new W.a(s);return o.service="baseEntry",o.action="list",o.method="POST",o.url=o.getUrl(e),o.tag="list",o.params=n.getEntryListReqParams(r,t,a,i),o},n.getEntryListReqParams=function(e,t,r,n){var a={};return e?a=r?{redirectFromEntryId:e}:{idEqual:e}:n&&(a={objectType:"KalturaBaseEntryFilter",referenceIdEqual:n}),{ks:t,filter:a,responseProfile:new J}},n}(Y);var Q=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.list=function(e,t,r){var n=new Map;n.set("Content-Type","application/json");var a=new W.a(n);a.service="metadata_metadata",a.action="list",a.method="POST",a.url=a.getUrl(e),a.tag="metadata_metadata-list";var i={objectType:"KalturaMetadataFilter",objectIdEqual:r,metadataObjectTypeEqual:"1"};return a.params={filter:i,ks:t},a},n}(Y);var Z=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).hasError||(r.totalCount=t.totalCount,r.totalCount>0&&(r.entries=[],t.objects.map((function(e){return r.entries.push(new A(e))})))),r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(u.a);function z(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $(e,t,r){return t&&z(e.prototype,t),r&&z(e,r),e}var ee=function(){function e(e){!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"_response",{}),this.requests=this.buildRequests(e),this._entryId=e.entryId,this._referenceId=e.referenceId}$(e,null,[{key:"id",get:function(){return"media"}}]);var t=e.prototype;return t.buildRequests=function(e){var t=o.get(),r=[];r.push(X.list(t.serviceUrl,e.ks,e.entryId,e.redirectFromEntryId,e.referenceId));var n="{1:result:ks}"===e.ks?"{2:result:objects:0:id}":"{1:result:objects:0:id}";return r.push(X.getPlaybackContext(t.serviceUrl,e.ks,n)),r.push(Q.list(t.serviceUrl,e.ks,n)),r},t.isValid=function(){return!(!this._entryId&&!this._referenceId)},$(e,[{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){var t=new Z(e[0].data);this._response.entry=t.entries[0],this._response.playBackContextResult=new I(e[1].data),this._response.metadataListResult=new T(e[2].data)},get:function(){return this._response}}]),e}();var te=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.anonymousSession=function(e,t){var r=new Map;r.set("Content-Type","application/json");var n=new W.a(r);return n.service="session",n.action="startWidgetSession",n.method="POST",n.url=n.getUrl(e),n.tag="session-startWidget",n.params={widgetId:t},n},n}(Y);function re(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var ne=function(){var e,t,r;function n(e){!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"_response",{}),this.requests=this.buildRequests(e),this._widgetId=e.widgetId}e=n,r=[{key:"id",get:function(){return"session"}}],(t=[{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){this._response.ks=e[0].data.ks},get:function(){return this._response.ks}}])&&re(e.prototype,t),r&&re(e,r);var a=n.prototype;return a.buildRequests=function(e){var t=o.get(),r=[];return r.push(te.anonymousSession(t.serviceUrl,e.widgetId)),r},a.isValid=function(){return!!this._widgetId},n}();var ae=function(e){var t,r;function n(t,r,n,a){var i;return void 0===n&&(n=""),(i=e.call(this,a)||this)._multiRequest=Y.getMultiRequest(t,n,r),i}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(r(10).a);var ie=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.execute=function(e,t,r){var n=new Map;n.set("Content-Type","application/json");var a=new W.a(n);return a.service="playlist",a.action="execute",a.method="POST",a.url=a.getUrl(e),a.tag="playlist-execute",a.params={ks:t,id:r,responseProfile:new J},a},n.get=function(e,t,r){var n=new Map;n.set("Content-Type","application/json");var a=new W.a(n);return a.service="playlist",a.action="get",a.method="POST",a.url=a.getUrl(e),a.tag="playlist-get",a.params={ks:t,id:r,responseProfile:{fields:"id,name,description,thumbnailUrl",type:1}},a},n.getLastEntryId=function(e,t,r){var n=new Map;n.set("Content-Type","application/json");var a=new W.a(n);return a.service="userEntry",a.action="list",a.method="POST",a.url=a.getUrl(e),a.tag="userEntry-list",a.params={ks:t,filter:{objectType:"KalturaViewHistoryUserEntry",entryIdEqual:r,userIdEqualCurrent:1},responseProfile:{fields:"playlistLastEntryId",type:1}},a},n}(Y),se=function(e){this.id=e.id,this.name=e.name,this.description=e.description,this.poster=e.thumbnailUrl};var oe=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).hasError||(r.entries=[],t.map((function(e){var t=new A(e);t.type!==A.EntryType.DOCUMENT.value&&r.entries.push(t)}))),r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(u.a);var ue=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).hasError||(r.totalCount=t.totalCount,r.entries=[],r.totalCount>0&&t.objects.map((function(e){return r.entries.push(new C(e))}))),r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(u.a);function ce(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function le(e,t,r){return t&&ce(e.prototype,t),r&&ce(e,r),e}var de=function(){function e(e){!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"_response",{}),this.requests=this.buildRequests(e),this._playlistId=e.playlistId}le(e,null,[{key:"id",get:function(){return"playlist"}}]);var t=e.prototype;return t.buildRequests=function(e){var t=o.get(),r=[];return r.push(ie.get(t.serviceUrl,e.ks,e.playlistId)),r.push(ie.execute(t.serviceUrl,e.ks,e.playlistId)),r.push(ie.getLastEntryId(t.serviceUrl,e.ks,e.playlistId)),r},t.isValid=function(){return!!this._playlistId},le(e,[{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){this._response.playlistData=new se(e[0].data),this._response.playlistItems=new oe(e[1].data),this._response.playlistUserEntries=new ue(e[2].data)},get:function(){return this._response}}]),e}(),pe=r(14);function fe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function he(e,t,r){return t&&fe(e.prototype,t),r&&fe(e,r),e}var ye=function(){function e(e){!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"_response",{playlistItems:{entries:[]}}),this.requests=this.buildRequests(e),this._entries=e.entries}he(e,null,[{key:"id",get:function(){return"entry_list"}}]);var t=e.prototype;return t.buildRequests=function(e){var t=o.get(),r=[];return e.entries.forEach((function(n){r.push(X.list(t.serviceUrl,e.ks,n.entryId||n,e.redirectFromEntryId,n.referenceId))})),r},t.isValid=function(){return!(!this._entries||!this._entries.length)},he(e,[{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){var t,r=this;e.forEach((function(e){t=new Z(e.data),r._response.playlistItems.entries.push(t.entries[0])}))},get:function(){return this._response}}]),e}(),ge=r(0);function me(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ve=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).hasError||(r.name=t.name,r.description=t.description,r.objTypeAsString=t.objTypeAsString,r.width=t.width,r.height=t.height,r.htmlParams=t.htmlParams,r.swfUrl=t.swfUrl,r.confFilePath=t.confFilePath,r.confFile=t.confFile,r.confFileFeatures=t.confFileFeatures,r.config=t.config,r.confVars=t.confVars,r.useCdn=t.useCdn,r.tags=t.tags,r.swfUrlVersion=t.swfUrlVersion,r.created=new Date(0),r.created.setUTCSeconds(t.createdAt),r.updated=new Date(0),r.updated.setUTCSeconds(t.updatedAt),r.html5Url=t.description,r.version=t.description,r.partnerTags=t.description,r.objType=t.description,r.creationMode=t.description),r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(u.a);function _e(e,t,r,n,a,i,s){try{var o=e[i](s),u=o.value}catch(e){return void r(e)}o.done?t(u):Promise.resolve(u).then(n,a)}function Ee(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function s(e){_e(i,n,a,s,o,"next",e)}function o(e){_e(i,n,a,s,o,"throw",e)}s(void 0)}))}}me(ve,"Type",{PLAYER:1,CONTRIBUTION_WIZARD:2,SIMPLE_EDITOR:3,ADVANCED_EDITOR:4,PLAYLIST:5,APP_STUDIO:6,KRECORD:7,PLAYER_V3:8,KMC_ACCOUNT:9,KMC_ANALYTICS:10,KMC_CONTENT:11,KMC_DASHBOARD:12,KMC_LOGIN:13,PLAYER_SL:14,CLIENTSIDE_ENCODER:15,KMC_GENERAL:16,KMC_ROLES_AND_PERMISSIONS:17,CLIPPER:18,KSR:19,KUPLOAD:20,WEBCASTING:21}),me(ve,"CreationMode",{WIZARD:2,ADVANCED:3});var Ie=function(){function e(){}return e._applyRegexAction=function(e,t){if(e){var r=new RegExp(e.pattern,"i");if(t.match(r))return t.replace(r,e.replacement+"/")}return t},e._isECDNUrlAlive=function(){var t=Ee(regeneratorRuntime.mark((function t(r,n){var a,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=n+"/api_v3/service/system/action/ping/format/1",(i=new XMLHttpRequest).open("GET",a),i.timeout=r.checkAliveTimeoutMs,i.onreadystatechange=function(){if(4===i.readyState)return 200===i.status},i.ontimeout=function(){return e._logger.warn("Got timeout while pinging the ECDN url. the ping url: "+a),!1},i.send();case 7:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),e.handleRegexAction=function(){var t=Ee(regeneratorRuntime.mark((function t(r,n){var a,i,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=o.get().cdnUrl,i=e._extractRegexActionFromData(n),s=e._getRegExp(i),t.t0=a&&i&&s&&a.match(s),!t.t0){t.next=11;break}if(t.t1=i.checkAliveTimeoutMs>0,!t.t1){t.next=10;break}return t.next=9,e._isECDNUrlAlive(i,a.replace(s,i.replacement));case 9:t.t1=!t.sent;case 10:t.t0=!t.t1;case 11:if(!t.t0){t.next=14;break}return e._replaceHostUrls(r,i),t.abrupt("return",r);case 14:return e._logger.debug("exiting handleRegexAction - not applying regex action."),t.abrupt("return",r);case 16:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),e._replaceHostUrls=function(t,r){e._logger.debug("Starting to modify urls...");var n=t.sources,a=n.hls,i=n.dash,s=n.progressive,u=n.image;[].concat(a,i,s,u).forEach((function(t){return t.url=e._applyRegexAction(r,t.url)})),o.get().replaceHostOnlyManifestUrls||(e._logger.debug("replaceHostOnlyManifestUrls flag is off - modifying captions and poster URLs"),n.captions&&n.captions.forEach((function(t){return t.url=e._applyRegexAction(r,t.url)})),"string"==typeof n.poster&&(n.poster=e._applyRegexAction(r,n.poster))),e._logger.debug("Finished modifying urls")},e._extractRegexActionFromData=function(e){var t,r;return null==(t=e.get(ee.id))||null==(r=t.response)?void 0:r.playBackContextResult.getRequestHostRegexAction()},e._getRegExp=function(e){if(e&&e.pattern&&e.replacement)return new RegExp(e.pattern,"i")},e}();!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(Ie,"_logger",Object(a.b)("RegexActionHandler"));var be=Ie;function Re(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Te=function(e){var t,r;function n(t,r){var n;return function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n=e.call(this,t,r)||this),"_filterOptionsConfig",{redirectFromEntryId:!0}),n._logger=Object(a.b)("OVPProvider"),o.set(t.env),n._setFilterOptionsConfig(t.filterOptions),n._networkRetryConfig=Object.assign(n._networkRetryConfig,t.networkRetryParameters),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var i,s,u,c=n.prototype;return c.getMediaConfig=function(e){var t=this;return e.ks&&(this.ks=e.ks,this._isAnonymous=!1),this.widgetId!==this.defaultWidgetId&&(this._isAnonymous=!1),this._dataLoader=new ae(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var a=e.entryId,i=e.referenceId;if(a||i){var s=t.ks;s||(s="{1:result:ks}",t._dataLoader.add(ne,{widgetId:t.widgetId}));var o=t._getEntryRedirectFilter(e);return t._dataLoader.add(ee,{entryId:a,ks:s,redirectFromEntryId:o,referenceId:i}),t._dataLoader.fetchData().then((function(e){try{var a=t._parseDataFromResponse(e);be.handleRegexAction(a,e).then(r)}catch(e){n(e)}}),(function(e){n(e)}))}n(new ge.a(ge.a.Severity.CRITICAL,ge.a.Category.PROVIDER,ge.a.Code.MISSING_MANDATORY_PARAMS,{message:"missing entry id"}))}))},c.doRequest=function(e,t){var r=this,n=t||this.ks,a=new ae(this.playerVersion,this.partnerId,n,this._networkRetryConfig);return new Promise((function(t,i){return n||a.add(ne,{widgetId:r.widgetId}),e.forEach((function(e){a.add(e.loader,e.params,n||"{1:result:ks}")})),a.fetchData().then((function(e){try{t(e)}catch(e){i(e)}}),(function(e){i(e)}))}))},c._getEntryRedirectFilter=function(e){return"boolean"==typeof e.redirectFromEntryId?e.redirectFromEntryId:"boolean"!=typeof this._filterOptionsConfig.redirectFromEntryId||this._filterOptionsConfig.redirectFromEntryId},c._setFilterOptionsConfig=function(e){e&&"boolean"==typeof e.redirectFromEntryId&&(this._filterOptionsConfig.redirectFromEntryId=e.redirectFromEntryId)},c._parseDataFromResponse=function(e){this._logger.debug("Data parsing started");var t={session:{isAnonymous:this._isAnonymous,partnerId:this.partnerId},sources:this._getDefaultSourcesObject(),plugins:{}};if(this.uiConfId&&(t.session.uiConfId=this.uiConfId),e){if(e.has(ne.id)){var r=e.get(ne.id);r&&r.response&&(t.session.ks=r.response,this.widgetId!==this.defaultWidgetId&&(this.ks=t.session.ks))}else t.session.ks=this.ks;if(e.has(ee.id)){var n=e.get(ee.id);if(n&&n.response){var a=n.response;if(K.hasBlockAction(a))throw new ge.a(ge.a.Severity.CRITICAL,ge.a.Category.SERVICE,ge.a.Code.BLOCK_ACTION,{action:K.getBlockAction(a),messages:K.getErrorMessages(a)});var i=K.getMediaEntry(this.isAnonymous?"":this.ks,this.partnerId,this.uiConfId,a);Object.assign(t.sources,this._getSourcesObject(i)),this._verifyMediaStatus(i),this._verifyHasSources(t.sources);var s=K.getBumper(a,this.isAnonymous?"":this.ks,this.partnerId);s&&Object.assign(t.plugins,{bumper:s})}}}return this._logger.debug("Data parsing finished",t),t},c._verifyMediaStatus=function(e){if([A.EntryStatus.IMPORT,A.EntryStatus.PRECONVERT].includes(e.status))throw new ge.a(ge.a.Severity.CRITICAL,ge.a.Category.SERVICE,ge.a.Code.MEDIA_STATUS_NOT_READY,{messages:"Status of entry id "+e.id+" is "+e.status+" and is still being imported or converted",data:{status:status}})},c.getPlaylistConfig=function(e){var t=this;return e.ks&&(this.ks=e.ks,this._isAnonymous=!1),this.widgetId!==this.defaultWidgetId&&(this._isAnonymous=!1),this._dataLoader=new ae(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var a=e.playlistId;if(a){var i=t.ks;i||(i="{1:result:ks}",t._dataLoader.add(ne,{widgetId:t.widgetId})),t._dataLoader.add(de,{playlistId:a,ks:i}),t._dataLoader.fetchData().then((function(e){r(t._parsePlaylistDataFromResponse(e))}),(function(e){n(e)}))}else n({success:!1,data:"Missing mandatory parameter"})}))},c._parsePlaylistDataFromResponse=function(e){var t=this;this._logger.debug("Data parsing started");var r=this._getPlaylistObject();if(e&&e.has(de.id)){var n=e.get(de.id);if(n&&n.response){var a=K.getPlaylist(n.response);r.id=a.id,r.poster=a.poster,r.metadata.name=a.name,r.metadata.description=a.description,r.playlistLastEntryId=a.playlistLastEntryId,a.items.forEach((function(e){return r.items.push({sources:t._getSourcesObject(e)})}))}}return this._logger.debug("Data parsing finished",r),r},c.getEntryListConfig=function(e){var t=this;return e.ks&&(this.ks=e.ks,this._isAnonymous=!1),this.widgetId!==this.defaultWidgetId&&(this._isAnonymous=!1),this._dataLoader=new ae(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var a=e.entries;if(a&&a.length){var i=t.ks;i||(i="{1:result:ks}",t._dataLoader.add(ne,{widgetId:t.widgetId}));var s=t._getEntryRedirectFilter(e);t._dataLoader.add(ye,{entries:a,ks:i,redirectFromEntryId:s}),t._dataLoader.fetchData(!1).then((function(e){r(t._parseEntryListDataFromResponse(e))}),(function(e){n(e)}))}else n({success:!1,data:"Missing mandatory parameter"})}))},c._parseEntryListDataFromResponse=function(e){var t=this;this._logger.debug("Data parsing started");var r=this._getPlaylistObject();if(e&&e.has(ye.id)){var n=e.get(ye.id);if(n&&n.response)K.getEntryList(n.response).items.forEach((function(e){return r.items.push({sources:t._getSourcesObject(e)})}))}return this._logger.debug("Data parsing finished",r),r},c._getPlaylistObject=function(){return{id:"",metadata:{name:"",description:""},poster:"",playlistLastEntryId:"",items:[]}},c._getDefaultSourcesObject=function(){return{hls:[],dash:[],progressive:[],image:[],id:"",duration:0,type:S.a.Type.UNKNOWN,poster:"",dvr:!1,vr:null,metadata:{name:"",description:"",tags:""}}},c._getSourcesObject=function(e){var t=this._getDefaultSourcesObject(),r=e.sources.toJSON();return t.hls=r.hls,t.dash=r.dash,t.progressive=r.progressive,t.image=r.image,t.id=e.id,t.duration=e.duration,t.type=e.type,t.dvr=!!e.dvrStatus,t.poster=e.poster,t.downloadUrl=e.downloadUrl,e.sources.captions&&(t.captions=e.sources.captions),e.metadata&&"string"==typeof e.metadata.tags&&e.metadata.tags.split(", ").includes("360")&&(t.vr={}),Object.assign(t.metadata,e.metadata),t},i=n,(s=[{key:"env",get:function(){return o.get()}}])&&Re(i.prototype,s),u&&Re(i,u),n}(pe.a),Oe="@playkit-js/playkit-js-providers-ovp",Ae="2.40.1"}])}));
|
|
2
2
|
//# sourceMappingURL=playkit-ovp-provider.js.map
|