@playkit-js/playkit-js-providers 2.41.0-canary.0-3d6d02a → 2.41.0-canary.0-fadaac0
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/dist/ott-provider.d.ts +1 -0
- package/dist/ovp-provider.d.ts +24 -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-ott-provider.js.map +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/dist/types.d.ts +2 -0
- package/package.json +1 -1
- package/src/entities/media-entry.ts +8 -1
- package/src/k-provider/ovp/provider-parser.ts +5 -3
- package/src/k-provider/ovp/provider.ts +2 -0
- package/src/k-provider/ovp/response-types/kaltura-flavor-asset.ts +17 -0
- package/src/k-provider/ovp/response-types/kaltura-media-entry.ts +7 -0
- package/src/k-provider/ovp/services/base-entry-service.ts +4 -1
- package/src/types/media-config-sources.ts +1 -0
- package/src/types/media-entry.ts +1 -0
- package/src/util/object.ts +10 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,(function(){return function(){"use strict";var e={d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===n(t)?t:String(t)}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,o(n.key),n)}}function s(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}e.r(t),e.d(t,{NAME:function(){return S},OVPConfiguration:function(){return y},OVPStatsService:function(){return T},RequestBuilder:function(){return l},VERSION:function(){return A}});var u=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(){}}};var c=function(e){return u(e)},f=s((function e(t,n,o){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};r(this,e),this.severity=t,this.category=n,this.code=o,this.data=i,e._logger.error("Category:".concat(n," | Code:").concat(o," |"),i)}));a(f,"Severity",{RECOVERABLE:1,CRITICAL:2}),a(f,"Category",{NETWORK:1,SERVICE:2,PROVIDER:3}),a(f,"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(f,"_logger",c("Error"));var l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map;r(this,e),a(this,"retryConfig",{async:!0,timeout:0,maxAttempts:4}),a(this,"_attemptCounter",1),this.headers=t}return s(e,[{key:"getUrl",value:function(e){return e+"/service/"+this.service+(this.action?"/action/"+this.action:"")}},{key:"doHttpRequest",value:function(){var e=this,t=new Promise((function(t,r){e._requestPromise={resolve:t,reject:r}}));return this.url||this._requestPromise.reject(new f(f.Severity.CRITICAL,f.Category.NETWORK,f.Code.MALFORMED_DATA_URI,{url:this.url})),this._createXHR(),t}},{key:"_createXHR",value: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,f.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,f.Code.TIMEOUT,{timeout:(performance.now()-r)/1e3,statusText:t.statusText})},t.onerror=t.onabort=function(){e._handleError(t,f.Code.HTTP_ERROR,{text:t.responseText,statusText:t.statusText})},this.headers.forEach((function(e,r){t.setRequestHeader(r,e)})),t.send(this.params)}},{key:"_getResponseHeaders",value:function(e){return e.getAllResponseHeaders().split("\n").filter((function(e){return 0===e.toLowerCase().indexOf("x-")}))}},{key:"_handleError",value: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()}},{key:"_createError",value:function(e,t,r){return Object.assign(r,{url:this.url,headers:this._getResponseHeaders(e),attempt:this._attemptCounter}),new f(f.Severity.CRITICAL,f.Category.NETWORK,t,r)}}]),e}(),p=function e(t){var r;return Array.isArray(t)?(r=t.length>0?t.slice(0):[]).forEach((function(t,o){("object"===n(t)||Array.isArray(t)&&t.length>0)&&(r[o]=e(t))})):"object"===n(t)?(r=Object.assign({},t),Object.keys(r).forEach((function(t){("object"===n(r[t])||Array.isArray(r[t])&&r[t].length>0)&&(r[t]=e(r[t]))}))):r=t,r},h={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},y=function(){function e(){r(this,e)}return s(e,null,[{key:"set",value:function(e){e&&Object.assign(h,e)}},{key:"get",value:function(){return p(h)}}]),e}();function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return m(e)}function R(e){return R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},R(e)}var E=s((function e(t){r(this,e),a(this,"hasError",!1),"KalturaAPIException"===t.objectType?(this.hasError=!0,this.error=new b(t.code,t.message)):t.error&&"KalturaAPIException"===t.error.objectType?(this.hasError=!0,this.error=new b(t.error.code,t.error.message)):this.data=t})),b=s((function e(t,n){r(this,e),this.code=t,this.message=n}));var O=function(e){d(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=R(t);if(n){var o=R(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return g(this,e)});function i(){var e;r(this,i);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return a(m(e=o.call.apply(o,[this].concat(n))),"requests",[]),e}return s(i,[{key:"add",value:function(e){this.requests.push(e);var t={},r={service:e.service,action:e.action};return Object.assign(t,a({},this.requests.length,Object.assign(r,e.params))),Object.assign(t,this.params),this.params=t,this}},{key:"execute",value:function(e){var t=this;return new Promise((function(r,n){try{t.params=JSON.stringify(t.params)}catch(e){i._logger.error("".concat(e.message)),n(new f(f.Severity.CRITICAL,f.Category.PROVIDER,f.Code.FAILED_PARSING_REQUEST,{error:e,params:t.params}))}t.doHttpRequest().then((function(o){var i=new _(o,e);i.success?r({headers:t.responseHeaders,response:i}):n(new f(f.Severity.CRITICAL,f.Category.NETWORK,f.Code.MULTIREQUEST_API_ERROR,{url:t.url,headers:t.responseHeaders,results:i.results}))}),(function(e){n(e)}))}))}}]),i}(l);a(O,"_logger",c("MultiRequestBuilder"));var _=s((function e(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];r(this,e),a(this,"results",[]);var o=t.result?t.result:t,i=(Array.isArray(o)?o:[o]).map((function(e){return new E(e)})),s=i.filter((function(e){return e.hasError}));s.forEach((function(t){e._logger.error("Service returned an error with error code: ".concat(t.error.code," and message: ").concat(t.error.message,"."))})),this.results=i,n&&s.length||s.length===this.results.length?this.success=!1:(this.results=this.results.filter((function(e){return!e.hasError})),this.success=!0)}));a(_,"_logger",c("MultiRequestResult"));var T=function(e){d(a,e);var t,o,i=(t=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=R(t);if(o){var n=R(this).constructor;e=Reflect.construct(r,arguments,n)}else e=r.apply(this,arguments);return g(this,e)});function a(){return r(this,a),i.apply(this,arguments)}return s(a,null,[{key:"collect",value:function(e,t,r,o){var i=y.get(),s={};Object.assign(s,i.serviceParams,{ks:t,clientTag:"html5:v"+r},o);var a,u,c,f,p,h=new l;return h.service="stats",h.action="collect",h.method="GET",h.tag="stats-collect",h.params=s,h.url=e+"?service="+h.service+"&action="+h.action+"&"+(a=h.params,u=[],c=/\[\]$/,f=function(e){return"[object Array]"===Object.prototype.toString.call(e)},p=function(e,t){t="function"==typeof t?t():null==t?"":t,u[u.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)},function e(t,r){var o,i,s;if(t)if(f(r))for(o=0,i=r.length;o<i;o++)c.test(t)?p(t,r[o]):e(t+":"+("object"===n(r[o])?o:""),r[o]);else if(r&&"[object Object]"===String(r))for(s in r)e(t+":"+s,r[s]);else p(t,r);else if(f(r))for(o=0,i=r.length;o<i;o++)p(r[o].name,r[o].value);else for(s in r)e(s,r[s]);return u}("",a).join("&").replace(/%20/g,"+")),h}}]),a}(function(){function e(){r(this,e)}return s(e,null,[{key:"getMultiRequest",value:function(e,t,r){var n=y.get(),o=n.serviceParams;Object.assign(o,{ks:t,clientTag:"html5:v"+e}),r&&Object.assign(o,{partnerId:r});var i=new Map;i.set("Content-Type","application/json");var s=new O(i);return s.method="POST",s.service="multirequest",s.url=s.getUrl(n.serviceUrl),s.params=o,s}}]),e}()),S="@playkit-js/playkit-js-providers-stats-service",A="2.41.0-canary.0-3d6d02a";return t}()}));
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,(function(){return function(){"use strict";var e={d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===n(t)?t:String(t)}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,o(n.key),n)}}function s(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}e.r(t),e.d(t,{NAME:function(){return S},OVPConfiguration:function(){return y},OVPStatsService:function(){return T},RequestBuilder:function(){return l},VERSION:function(){return A}});var u=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(){}}};var c=function(e){return u(e)},f=s((function e(t,n,o){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};r(this,e),this.severity=t,this.category=n,this.code=o,this.data=i,e._logger.error("Category:".concat(n," | Code:").concat(o," |"),i)}));a(f,"Severity",{RECOVERABLE:1,CRITICAL:2}),a(f,"Category",{NETWORK:1,SERVICE:2,PROVIDER:3}),a(f,"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(f,"_logger",c("Error"));var l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map;r(this,e),a(this,"retryConfig",{async:!0,timeout:0,maxAttempts:4}),a(this,"_attemptCounter",1),this.headers=t}return s(e,[{key:"getUrl",value:function(e){return e+"/service/"+this.service+(this.action?"/action/"+this.action:"")}},{key:"doHttpRequest",value:function(){var e=this,t=new Promise((function(t,r){e._requestPromise={resolve:t,reject:r}}));return this.url||this._requestPromise.reject(new f(f.Severity.CRITICAL,f.Category.NETWORK,f.Code.MALFORMED_DATA_URI,{url:this.url})),this._createXHR(),t}},{key:"_createXHR",value: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,f.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,f.Code.TIMEOUT,{timeout:(performance.now()-r)/1e3,statusText:t.statusText})},t.onerror=t.onabort=function(){e._handleError(t,f.Code.HTTP_ERROR,{text:t.responseText,statusText:t.statusText})},this.headers.forEach((function(e,r){t.setRequestHeader(r,e)})),t.send(this.params)}},{key:"_getResponseHeaders",value:function(e){return e.getAllResponseHeaders().split("\n").filter((function(e){return 0===e.toLowerCase().indexOf("x-")}))}},{key:"_handleError",value: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()}},{key:"_createError",value:function(e,t,r){return Object.assign(r,{url:this.url,headers:this._getResponseHeaders(e),attempt:this._attemptCounter}),new f(f.Severity.CRITICAL,f.Category.NETWORK,t,r)}}]),e}(),p=function e(t){var r;return Array.isArray(t)?(r=t.length>0?t.slice(0):[]).forEach((function(t,o){("object"===n(t)||Array.isArray(t)&&t.length>0)&&(r[o]=e(t))})):"object"===n(t)?(r=Object.assign({},t),Object.keys(r).forEach((function(t){("object"===n(r[t])||Array.isArray(r[t])&&r[t].length>0)&&(r[t]=e(r[t]))}))):r=t,r},h={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},y=function(){function e(){r(this,e)}return s(e,null,[{key:"set",value:function(e){e&&Object.assign(h,e)}},{key:"get",value:function(){return p(h)}}]),e}();function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return m(e)}function R(e){return R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},R(e)}var E=s((function e(t){r(this,e),a(this,"hasError",!1),"KalturaAPIException"===t.objectType?(this.hasError=!0,this.error=new b(t.code,t.message)):t.error&&"KalturaAPIException"===t.error.objectType?(this.hasError=!0,this.error=new b(t.error.code,t.error.message)):this.data=t})),b=s((function e(t,n){r(this,e),this.code=t,this.message=n}));var O=function(e){d(i,e);var t,n,o=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=R(t);if(n){var o=R(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return g(this,e)});function i(){var e;r(this,i);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return a(m(e=o.call.apply(o,[this].concat(n))),"requests",[]),e}return s(i,[{key:"add",value:function(e){this.requests.push(e);var t={},r={service:e.service,action:e.action};return Object.assign(t,a({},this.requests.length,Object.assign(r,e.params))),Object.assign(t,this.params),this.params=t,this}},{key:"execute",value:function(e){var t=this;return new Promise((function(r,n){try{t.params=JSON.stringify(t.params)}catch(e){i._logger.error("".concat(e.message)),n(new f(f.Severity.CRITICAL,f.Category.PROVIDER,f.Code.FAILED_PARSING_REQUEST,{error:e,params:t.params}))}t.doHttpRequest().then((function(o){var i=new _(o,e);i.success?r({headers:t.responseHeaders,response:i}):n(new f(f.Severity.CRITICAL,f.Category.NETWORK,f.Code.MULTIREQUEST_API_ERROR,{url:t.url,headers:t.responseHeaders,results:i.results}))}),(function(e){n(e)}))}))}}]),i}(l);a(O,"_logger",c("MultiRequestBuilder"));var _=s((function e(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];r(this,e),a(this,"results",[]);var o=t.result?t.result:t,i=(Array.isArray(o)?o:[o]).map((function(e){return new E(e)})),s=i.filter((function(e){return e.hasError}));s.forEach((function(t){e._logger.error("Service returned an error with error code: ".concat(t.error.code," and message: ").concat(t.error.message,"."))})),this.results=i,n&&s.length||s.length===this.results.length?this.success=!1:(this.results=this.results.filter((function(e){return!e.hasError})),this.success=!0)}));a(_,"_logger",c("MultiRequestResult"));var T=function(e){d(a,e);var t,o,i=(t=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=R(t);if(o){var n=R(this).constructor;e=Reflect.construct(r,arguments,n)}else e=r.apply(this,arguments);return g(this,e)});function a(){return r(this,a),i.apply(this,arguments)}return s(a,null,[{key:"collect",value:function(e,t,r,o){var i=y.get(),s={};Object.assign(s,i.serviceParams,{ks:t,clientTag:"html5:v"+r},o);var a,u,c,f,p,h=new l;return h.service="stats",h.action="collect",h.method="GET",h.tag="stats-collect",h.params=s,h.url=e+"?service="+h.service+"&action="+h.action+"&"+(a=h.params,u=[],c=/\[\]$/,f=function(e){return"[object Array]"===Object.prototype.toString.call(e)},p=function(e,t){t="function"==typeof t?t():null==t?"":t,u[u.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)},function e(t,r){var o,i,s;if(t)if(f(r))for(o=0,i=r.length;o<i;o++)c.test(t)?p(t,r[o]):e(t+":"+("object"===n(r[o])?o:""),r[o]);else if(r&&"[object Object]"===String(r))for(s in r)e(t+":"+s,r[s]);else p(t,r);else if(f(r))for(o=0,i=r.length;o<i;o++)p(r[o].name,r[o].value);else for(s in r)e(s,r[s]);return u}("",a).join("&").replace(/%20/g,"+")),h}}]),a}(function(){function e(){r(this,e)}return s(e,null,[{key:"getMultiRequest",value:function(e,t,r){var n=y.get(),o=n.serviceParams;Object.assign(o,{ks:t,clientTag:"html5:v"+e}),r&&Object.assign(o,{partnerId:r});var i=new Map;i.set("Content-Type","application/json");var s=new O(i);return s.method="POST",s.service="multirequest",s.url=s.getUrl(n.serviceUrl),s.params=o,s}}]),e}()),S="@playkit-js/playkit-js-providers-stats-service",A="2.41.0-canary.0-fadaac0";return t}()}));
|
|
2
2
|
//# sourceMappingURL=playkit-stats-service.js.map
|
package/dist/types.d.ts
CHANGED
|
@@ -203,6 +203,7 @@ export declare type ProviderMediaConfigSourcesObject = {
|
|
|
203
203
|
metadata: ProviderMediaConfigMetadataObject;
|
|
204
204
|
captions?: Array<PKExternalCaptionObject>;
|
|
205
205
|
downloadUrl?: string;
|
|
206
|
+
rawThumbnailUrl?: string;
|
|
206
207
|
};
|
|
207
208
|
|
|
208
209
|
export declare type ProviderMediaEntryObject = {
|
|
@@ -217,6 +218,7 @@ export declare type ProviderMediaEntryObject = {
|
|
|
217
218
|
poster?: string | Poster[];
|
|
218
219
|
downloadUrl?: string;
|
|
219
220
|
assetReferenceType?: string;
|
|
221
|
+
rawThumbnailUrl?: string;
|
|
220
222
|
};
|
|
221
223
|
|
|
222
224
|
export declare type ProviderMediaFormatType = {
|
package/package.json
CHANGED
|
@@ -74,6 +74,12 @@ export default class MediaEntry {
|
|
|
74
74
|
*/
|
|
75
75
|
public downloadUrl?: string;
|
|
76
76
|
|
|
77
|
+
/**
|
|
78
|
+
* @member - The raw thumbnail URL
|
|
79
|
+
* @type {string}
|
|
80
|
+
*/
|
|
81
|
+
public rawThumbnailUrl?: string;
|
|
82
|
+
|
|
77
83
|
/**
|
|
78
84
|
* @constructor
|
|
79
85
|
*/
|
|
@@ -99,7 +105,8 @@ export default class MediaEntry {
|
|
|
99
105
|
type: this.type,
|
|
100
106
|
poster: this.poster,
|
|
101
107
|
assetReferenceType: this.assetReferenceType,
|
|
102
|
-
downloadUrl: this.downloadUrl
|
|
108
|
+
downloadUrl: this.downloadUrl,
|
|
109
|
+
rawThumbnailUrl: this.rawThumbnailUrl
|
|
103
110
|
};
|
|
104
111
|
}
|
|
105
112
|
}
|
|
@@ -153,6 +153,7 @@ class OVPProviderParser {
|
|
|
153
153
|
|
|
154
154
|
private static _fillBaseData(mediaEntry: MediaEntry, entry: KalturaMediaEntry, metadataList?: KalturaMetadataListResponse, playbackContext?: any): MediaEntry {
|
|
155
155
|
mediaEntry.poster = entry.poster;
|
|
156
|
+
mediaEntry.rawThumbnailUrl = entry.rawThumbnailUrl;
|
|
156
157
|
mediaEntry.id = entry.id;
|
|
157
158
|
mediaEntry.duration = entry.duration;
|
|
158
159
|
mediaEntry.downloadUrl = entry.downloadUrl || '';
|
|
@@ -179,11 +180,12 @@ class OVPProviderParser {
|
|
|
179
180
|
playbackContext.flavorAssets[0].width && playbackContext.flavorAssets[0].height) {
|
|
180
181
|
|
|
181
182
|
const {height, width} = playbackContext.flavorAssets[0];
|
|
182
|
-
mediaEntry.metadata.
|
|
183
|
-
} else {
|
|
184
|
-
mediaEntry.metadata.heightRatio = 1.78;
|
|
183
|
+
mediaEntry.metadata.aspectRatio = +Number(width / height).toFixed(2);
|
|
185
184
|
}
|
|
186
185
|
|
|
186
|
+
if (playbackContext && Array.isArray(playbackContext.flavorAssets)) {
|
|
187
|
+
mediaEntry.metadata.audioFlavors = playbackContext.flavorAssets.filter(flavor => flavor.bitrate && !flavor.width && !flavor.height);
|
|
188
|
+
}
|
|
187
189
|
return mediaEntry;
|
|
188
190
|
}
|
|
189
191
|
|
|
@@ -326,6 +326,7 @@ export default class OVPProvider extends BaseProvider<OVPProviderMediaInfoObject
|
|
|
326
326
|
duration: 0,
|
|
327
327
|
type: MediaEntry.Type.UNKNOWN,
|
|
328
328
|
poster: '',
|
|
329
|
+
rawThumbnailUrl: '',
|
|
329
330
|
dvr: false,
|
|
330
331
|
vr: null,
|
|
331
332
|
metadata: {
|
|
@@ -349,6 +350,7 @@ export default class OVPProvider extends BaseProvider<OVPProviderMediaInfoObject
|
|
|
349
350
|
sourcesObject.type = mediaEntry.type;
|
|
350
351
|
sourcesObject.dvr = !!mediaEntry.dvrStatus;
|
|
351
352
|
sourcesObject.poster = mediaEntry.poster;
|
|
353
|
+
sourcesObject.rawThumbnailUrl = mediaEntry.rawThumbnailUrl;
|
|
352
354
|
sourcesObject.downloadUrl = mediaEntry.downloadUrl;
|
|
353
355
|
if (mediaEntry.sources.captions) {
|
|
354
356
|
sourcesObject.captions = mediaEntry.sources.captions;
|
|
@@ -84,6 +84,22 @@ export class KalturaFlavorAsset {
|
|
|
84
84
|
*/
|
|
85
85
|
public label: string;
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* @member - tags
|
|
89
|
+
* @type {Array<string>}
|
|
90
|
+
*/
|
|
91
|
+
public tags: Array<string>;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @function
|
|
95
|
+
* @param {string} tags The tags
|
|
96
|
+
* @returns {Array<string>} tags array
|
|
97
|
+
* @static
|
|
98
|
+
*/
|
|
99
|
+
public static parseTags(tags = ''): Array<string> {
|
|
100
|
+
return tags.split(',');
|
|
101
|
+
}
|
|
102
|
+
|
|
87
103
|
/**
|
|
88
104
|
* @constructor
|
|
89
105
|
* @param {Object} data The json response
|
|
@@ -104,5 +120,6 @@ export class KalturaFlavorAsset {
|
|
|
104
120
|
this.status = data.status;
|
|
105
121
|
this.language = data.language;
|
|
106
122
|
this.label = data.label;
|
|
123
|
+
this.tags = KalturaFlavorAsset.parseTags(data.tags);
|
|
107
124
|
}
|
|
108
125
|
}
|
|
@@ -159,6 +159,12 @@ export class KalturaMediaEntry {
|
|
|
159
159
|
*/
|
|
160
160
|
public creatorId: string;
|
|
161
161
|
|
|
162
|
+
/**
|
|
163
|
+
* @member - The raw thumbnail URL
|
|
164
|
+
* @type {string}
|
|
165
|
+
*/
|
|
166
|
+
public rawThumbnailUrl: string;
|
|
167
|
+
|
|
162
168
|
/**
|
|
163
169
|
* @constructor
|
|
164
170
|
* @param {Object} entry The json response
|
|
@@ -175,6 +181,7 @@ export class KalturaMediaEntry {
|
|
|
175
181
|
this.flavorParamsIds = entry.flavorParamsIds;
|
|
176
182
|
this.duration = entry.duration;
|
|
177
183
|
this.poster = entry.thumbnailUrl;
|
|
184
|
+
this.rawThumbnailUrl = entry.thumbnailUrl;
|
|
178
185
|
this.status = entry.status;
|
|
179
186
|
this.dvrStatus = entry.dvrStatus;
|
|
180
187
|
this.tags = entry.tags;
|
|
@@ -23,7 +23,10 @@ export default class OVPBaseEntryService extends OVPService {
|
|
|
23
23
|
request.method = 'POST';
|
|
24
24
|
request.url = request.getUrl(serviceUrl);
|
|
25
25
|
request.tag = 'baseEntry-getPlaybackContext';
|
|
26
|
-
const contextDataParams = {objectType: 'KalturaContextDataParams', flavorTags: 'all'
|
|
26
|
+
const contextDataParams = {objectType: 'KalturaContextDataParams', flavorTags: 'all'};
|
|
27
|
+
if (referrer) {
|
|
28
|
+
contextDataParams['referrer'] = referrer;
|
|
29
|
+
}
|
|
27
30
|
request.params = {entryId: serviceEntryId, ks: ks, contextDataParams: contextDataParams};
|
|
28
31
|
return request;
|
|
29
32
|
}
|
package/src/types/media-entry.ts
CHANGED