@playkit-js/playkit-js-providers 2.43.2-canary.0-f89d96e → 2.43.3-canary.0-c82994b
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 +7 -0
- package/dist/ovp-provider.d.ts +15 -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 +7 -0
- package/package.json +1 -1
- package/src/entities/media-entry.ts +2 -0
- package/src/k-provider/ovp/loaders/playlist-loader.ts +1 -1
- package/src/k-provider/ovp/provider-parser.ts +27 -25
- package/src/k-provider/ovp/provider.ts +103 -11
- package/src/k-provider/ovp/response-types/kaltura-active-live-stream-time.ts +5 -0
- package/src/k-provider/ovp/response-types/kaltura-playback-context.ts +10 -0
- package/src/k-provider/ovp/services/playlist-service.ts +9 -2
- package/src/types/media-config-sources.ts +2 -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 u(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 C}});var a=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 a(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)}));u(f,"Severity",{RECOVERABLE:1,CRITICAL:2}),u(f,"Category",{NETWORK:1,SERVICE:2,PROVIDER:3}),u(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,SCHEDULED_RESTRICTED:2003,MISSING_MANDATORY_PARAMS:3e3,MISSING_PLAY_SOURCE:3001,METHOD_NOT_IMPLEMENTED:3002}),u(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),u(this,"retryConfig",{async:!0,timeout:0,maxAttempts:4}),u(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){null!=e&&e.overrideServiceUrl&&(e.serviceUrl=e.overrideServiceUrl),e&&Object.assign(h,e)}},{key:"get",value:function(){return p(h)}},{key:"serviceUrl",get:function(){return h.serviceUrl}}]),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),u(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 u(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,u({},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);u(O,"_logger",c("MultiRequestBuilder"));var _=s((function e(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];r(this,e),u(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)}));u(_,"_logger",c("MultiRequestResult"));var T=function(e){d(u,e);var t,o,i=(t=u,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 u(){return r(this,u),i.apply(this,arguments)}return s(u,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 u,a,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+"&"+(u=h.params,a=[],c=/\[\]$/,f=function(e){return"[object Array]"===Object.prototype.toString.call(e)},p=function(e,t){t="function"==typeof t?t():null==t?"":t,a[a.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 a}("",u).join("&").replace(/%20/g,"+")),h}}]),u}(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",C="2.43.2-canary.0-f89d96e";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 u(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 C}});var a=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 a(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)}));u(f,"Severity",{RECOVERABLE:1,CRITICAL:2}),u(f,"Category",{NETWORK:1,SERVICE:2,PROVIDER:3}),u(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,SCHEDULED_RESTRICTED:2003,MISSING_MANDATORY_PARAMS:3e3,MISSING_PLAY_SOURCE:3001,METHOD_NOT_IMPLEMENTED:3002}),u(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),u(this,"retryConfig",{async:!0,timeout:0,maxAttempts:4}),u(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){null!=e&&e.overrideServiceUrl&&(e.serviceUrl=e.overrideServiceUrl),e&&Object.assign(h,e)}},{key:"get",value:function(){return p(h)}},{key:"serviceUrl",get:function(){return h.serviceUrl}}]),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),u(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 u(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,u({},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);u(O,"_logger",c("MultiRequestBuilder"));var _=s((function e(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];r(this,e),u(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)}));u(_,"_logger",c("MultiRequestResult"));var T=function(e){d(u,e);var t,o,i=(t=u,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 u(){return r(this,u),i.apply(this,arguments)}return s(u,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 u,a,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+"&"+(u=h.params,a=[],c=/\[\]$/,f=function(e){return"[object Array]"===Object.prototype.toString.call(e)},p=function(e,t){t="function"==typeof t?t():null==t?"":t,a[a.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 a}("",u).join("&").replace(/%20/g,"+")),h}}]),u}(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",C="2.43.3-canary.0-c82994b";return t}()}));
|
|
2
2
|
//# sourceMappingURL=playkit-stats-service.js.map
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/** @internal */
|
|
2
|
+
declare interface ActiveLiveStreamTime {
|
|
3
|
+
startTime: number;
|
|
4
|
+
endTime: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
1
7
|
export declare type AdapterDataConfig = {
|
|
2
8
|
[key: string]: {
|
|
3
9
|
value: string;
|
|
@@ -191,6 +197,7 @@ export declare type ProviderMediaConfigSessionObject = {
|
|
|
191
197
|
};
|
|
192
198
|
|
|
193
199
|
export declare type ProviderMediaConfigSourcesObject = {
|
|
200
|
+
activeLiveStreamTime?: ActiveLiveStreamTime;
|
|
194
201
|
dash: Array<ProviderMediaSourceObject>;
|
|
195
202
|
hls: Array<ProviderMediaSourceObject>;
|
|
196
203
|
progressive: Array<ProviderMediaSourceObject>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import MediaSources from './media-sources';
|
|
2
2
|
import {ProviderMediaEntryObject} from '../types';
|
|
3
3
|
import {Poster} from '../types/poster';
|
|
4
|
+
import {ActiveLiveStreamTime} from '../k-provider/ovp/response-types/kaltura-active-live-stream-time';
|
|
4
5
|
|
|
5
6
|
export default class MediaEntry {
|
|
6
7
|
public static Type: {[type: string]: string} = {
|
|
@@ -91,6 +92,7 @@ export default class MediaEntry {
|
|
|
91
92
|
* @type {Array<string>}
|
|
92
93
|
*/
|
|
93
94
|
public capabilities?: Array<string>;
|
|
95
|
+
public activeLiveStreamTime?: ActiveLiveStreamTime;
|
|
94
96
|
|
|
95
97
|
/**
|
|
96
98
|
* @constructor
|
|
@@ -53,7 +53,7 @@ export default class OVPPlaylistLoader implements ILoader {
|
|
|
53
53
|
const config = OVPConfiguration.get();
|
|
54
54
|
const requests: Array<RequestBuilder> = [];
|
|
55
55
|
requests.push(OVPPlaylistService.get(config.serviceUrl, params.ks, params.playlistId));
|
|
56
|
-
requests.push(OVPPlaylistService.execute(config.serviceUrl, params.ks, params.playlistId));
|
|
56
|
+
requests.push(OVPPlaylistService.execute(config.serviceUrl, params.ks, params.playlistId, params.cacheToken));
|
|
57
57
|
requests.push(OVPPlaylistService.getLastEntryId(config.serviceUrl, params.ks, params.playlistId));
|
|
58
58
|
return requests;
|
|
59
59
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {KalturaPlaybackContext, KalturaUserEntry} from './response-types';
|
|
2
2
|
import {KalturaMetadataListResponse} from './response-types';
|
|
3
3
|
import {KalturaMediaEntry} from './response-types';
|
|
4
4
|
import {KalturaPlaybackSource} from './response-types';
|
|
@@ -43,7 +43,7 @@ class OVPProviderParser {
|
|
|
43
43
|
const playbackContext = mediaEntryResponse.playBackContextResult;
|
|
44
44
|
const metadataList = mediaEntryResponse.metadataListResult;
|
|
45
45
|
const kalturaSources = playbackContext.sources;
|
|
46
|
-
|
|
46
|
+
mediaEntry.activeLiveStreamTime = playbackContext.activeLiveStreamTime;
|
|
47
47
|
mediaEntry.sources = OVPProviderParser._getParsedSources(kalturaSources, ks, partnerId, uiConfId, entry, playbackContext);
|
|
48
48
|
OVPProviderParser._fillBaseData(mediaEntry, entry, metadataList, playbackContext);
|
|
49
49
|
if (mediaEntry.type !== MediaEntry.Type.LIVE && OVPConfiguration.get().useApiCaptions && playbackContext.data.playbackCaptions) {
|
|
@@ -151,7 +151,12 @@ class OVPProviderParser {
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
private static _fillBaseData(
|
|
154
|
+
private static _fillBaseData(
|
|
155
|
+
mediaEntry: MediaEntry,
|
|
156
|
+
entry: KalturaMediaEntry,
|
|
157
|
+
metadataList?: KalturaMetadataListResponse,
|
|
158
|
+
playbackContext?: any
|
|
159
|
+
): MediaEntry {
|
|
155
160
|
mediaEntry.poster = entry.poster;
|
|
156
161
|
mediaEntry.rawThumbnailUrl = entry.rawThumbnailUrl;
|
|
157
162
|
mediaEntry.id = entry.id;
|
|
@@ -177,10 +182,7 @@ class OVPProviderParser {
|
|
|
177
182
|
mediaEntry.dvrStatus = entry.dvrStatus;
|
|
178
183
|
}
|
|
179
184
|
|
|
180
|
-
if (playbackContext &&
|
|
181
|
-
playbackContext.flavorAssets[0] &&
|
|
182
|
-
playbackContext.flavorAssets[0].width && playbackContext.flavorAssets[0].height) {
|
|
183
|
-
|
|
185
|
+
if (playbackContext && playbackContext.flavorAssets[0] && playbackContext.flavorAssets[0].width && playbackContext.flavorAssets[0].height) {
|
|
184
186
|
const {height, width} = playbackContext.flavorAssets[0];
|
|
185
187
|
mediaEntry.metadata.aspectRatio = +Number(width / height).toFixed(2);
|
|
186
188
|
}
|
|
@@ -194,27 +196,27 @@ class OVPProviderParser {
|
|
|
194
196
|
private static _getEntryType(entryTypeEnum: number, typeEnum: number | string): string {
|
|
195
197
|
let type = MediaEntry.Type.UNKNOWN;
|
|
196
198
|
switch (entryTypeEnum) {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
break;
|
|
200
|
-
case KalturaMediaEntry.MediaType.AUDIO.value:
|
|
201
|
-
type = MediaEntry.Type.AUDIO;
|
|
202
|
-
break;
|
|
203
|
-
default:
|
|
204
|
-
switch (typeEnum) {
|
|
205
|
-
case KalturaMediaEntry.EntryType.MEDIA_CLIP.value:
|
|
206
|
-
type = MediaEntry.Type.VOD;
|
|
207
|
-
break;
|
|
208
|
-
case KalturaMediaEntry.EntryType.LIVE_STREAM.value:
|
|
209
|
-
case KalturaMediaEntry.EntryType.LIVE_CHANNEL.value:
|
|
210
|
-
type = MediaEntry.Type.LIVE;
|
|
199
|
+
case KalturaMediaEntry.MediaType.IMAGE.value:
|
|
200
|
+
type = MediaEntry.Type.IMAGE;
|
|
211
201
|
break;
|
|
212
|
-
case KalturaMediaEntry.
|
|
213
|
-
type = MediaEntry.Type.
|
|
202
|
+
case KalturaMediaEntry.MediaType.AUDIO.value:
|
|
203
|
+
type = MediaEntry.Type.AUDIO;
|
|
214
204
|
break;
|
|
215
205
|
default:
|
|
216
|
-
|
|
217
|
-
|
|
206
|
+
switch (typeEnum) {
|
|
207
|
+
case KalturaMediaEntry.EntryType.MEDIA_CLIP.value:
|
|
208
|
+
type = MediaEntry.Type.VOD;
|
|
209
|
+
break;
|
|
210
|
+
case KalturaMediaEntry.EntryType.LIVE_STREAM.value:
|
|
211
|
+
case KalturaMediaEntry.EntryType.LIVE_CHANNEL.value:
|
|
212
|
+
type = MediaEntry.Type.LIVE;
|
|
213
|
+
break;
|
|
214
|
+
case KalturaMediaEntry.EntryType.DOCUMENT.value:
|
|
215
|
+
type = MediaEntry.Type.DOCUMENT;
|
|
216
|
+
break;
|
|
217
|
+
default:
|
|
218
|
+
type = MediaEntry.Type.UNKNOWN;
|
|
219
|
+
}
|
|
218
220
|
}
|
|
219
221
|
return type;
|
|
220
222
|
}
|
|
@@ -26,9 +26,13 @@ import {
|
|
|
26
26
|
import OVPUserService from './services/user-service';
|
|
27
27
|
import {KalturaUserGetResponse} from './response-types/kaltura-user-get-response';
|
|
28
28
|
|
|
29
|
+
const MAX_RETRY_ATTEMPTS = 10;
|
|
30
|
+
const RETRY_INTERVAL = 10000;
|
|
31
|
+
|
|
29
32
|
export default class OVPProvider extends BaseProvider<OVPProviderMediaInfoObject> {
|
|
30
33
|
private _filterOptionsConfig: ProviderFilterOptionsObject = {redirectFromEntryId: true};
|
|
31
34
|
private _vrTag: string;
|
|
35
|
+
private _retryAttempts = 0;
|
|
32
36
|
/**
|
|
33
37
|
* @constructor
|
|
34
38
|
* @param {ProviderOptionsObject} options - provider options
|
|
@@ -44,11 +48,13 @@ export default class OVPProvider extends BaseProvider<OVPProviderMediaInfoObject
|
|
|
44
48
|
|
|
45
49
|
this._isAnonymous = !this._ks ? true : undefined;
|
|
46
50
|
if (this._isAnonymous === undefined) {
|
|
47
|
-
this.initializeUserResponse(OVPConfiguration.serviceUrl, this._ks)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
this.initializeUserResponse(OVPConfiguration.serviceUrl, this._ks)
|
|
52
|
+
.then(() => {
|
|
53
|
+
this._logger.info('User response initialized');
|
|
54
|
+
})
|
|
55
|
+
.catch(err => {
|
|
56
|
+
this._logger.error('Failed to initialize user response', err);
|
|
57
|
+
});
|
|
52
58
|
}
|
|
53
59
|
}
|
|
54
60
|
|
|
@@ -136,8 +142,8 @@ export default class OVPProvider extends BaseProvider<OVPProviderMediaInfoObject
|
|
|
136
142
|
return typeof mediaInfo.redirectFromEntryId === 'boolean'
|
|
137
143
|
? mediaInfo.redirectFromEntryId
|
|
138
144
|
: typeof this._filterOptionsConfig.redirectFromEntryId === 'boolean'
|
|
139
|
-
|
|
140
|
-
|
|
145
|
+
? this._filterOptionsConfig.redirectFromEntryId
|
|
146
|
+
: true;
|
|
141
147
|
}
|
|
142
148
|
|
|
143
149
|
private _setFilterOptionsConfig(options?: ProviderFilterOptionsObject): void {
|
|
@@ -182,12 +188,12 @@ export default class OVPProvider extends BaseProvider<OVPProviderMediaInfoObject
|
|
|
182
188
|
action: OVPProviderParser.getBlockAction(response),
|
|
183
189
|
messages: OVPProviderParser.getErrorMessages(response)
|
|
184
190
|
});
|
|
185
|
-
}
|
|
186
|
-
else if (OVPProviderParser.hasScheduledRestriction(response)) {
|
|
191
|
+
} else if (OVPProviderParser.hasScheduledRestriction(response)) {
|
|
187
192
|
throw new Error(Error.Severity.CRITICAL, Error.Category.SERVICE, Error.Code.SCHEDULED_RESTRICTED, {
|
|
188
193
|
messages: OVPProviderParser.getErrorMessages(response)
|
|
189
194
|
});
|
|
190
195
|
}
|
|
196
|
+
|
|
191
197
|
const mediaEntry = OVPProviderParser.getMediaEntry(this.ks, this.partnerId, this.uiConfId, response);
|
|
192
198
|
Object.assign(mediaConfig.sources, this._getSourcesObject(mediaEntry));
|
|
193
199
|
this._verifyMediaStatus(mediaEntry);
|
|
@@ -237,7 +243,11 @@ export default class OVPProvider extends BaseProvider<OVPProviderMediaInfoObject
|
|
|
237
243
|
this._dataLoader.add(OVPPlaylistLoader, {playlistId, ks});
|
|
238
244
|
this._dataLoader.fetchData().then(
|
|
239
245
|
response => {
|
|
240
|
-
|
|
246
|
+
try {
|
|
247
|
+
this._handlePlaylistResponse(response, resolve, reject, playlistInfo);
|
|
248
|
+
} catch (err) {
|
|
249
|
+
reject(err);
|
|
250
|
+
}
|
|
241
251
|
},
|
|
242
252
|
err => {
|
|
243
253
|
reject(err);
|
|
@@ -249,6 +259,81 @@ export default class OVPProvider extends BaseProvider<OVPProviderMediaInfoObject
|
|
|
249
259
|
});
|
|
250
260
|
}
|
|
251
261
|
|
|
262
|
+
private _handlePlaylistResponse(
|
|
263
|
+
response: Map<string, ILoader>,
|
|
264
|
+
resolve: (value: ProviderPlaylistObject) => void,
|
|
265
|
+
reject: (reason?: any) => void,
|
|
266
|
+
playlistInfo: ProviderPlaylistInfoObject
|
|
267
|
+
): void {
|
|
268
|
+
this._logger.debug('Handling playlist response', {attempt: this._retryAttempts + 1, maxAttempts: MAX_RETRY_ATTEMPTS});
|
|
269
|
+
const playlistData = this._parsePlaylistDataFromResponse(response);
|
|
270
|
+
|
|
271
|
+
if (playlistData.items.length > 0) {
|
|
272
|
+
this._handlePlaylistSuccess(playlistData, resolve);
|
|
273
|
+
} else {
|
|
274
|
+
this._handlePlaylistRetry(resolve, reject, playlistInfo);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
private _handlePlaylistSuccess(
|
|
279
|
+
playlistData: ProviderPlaylistObject,
|
|
280
|
+
resolve: (value: ProviderPlaylistObject) => void
|
|
281
|
+
): void {
|
|
282
|
+
this._logger.debug('Playlist items found', {itemsCount: playlistData.items.length, totalAttempts: this._retryAttempts + 1});
|
|
283
|
+
this._retryAttempts = 0;
|
|
284
|
+
resolve(playlistData);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
private _handlePlaylistRetry(
|
|
288
|
+
resolve: (value: ProviderPlaylistObject) => void,
|
|
289
|
+
reject: (reason?: any) => void,
|
|
290
|
+
playlistInfo: ProviderPlaylistInfoObject
|
|
291
|
+
): void {
|
|
292
|
+
if (this._retryAttempts >= MAX_RETRY_ATTEMPTS) {
|
|
293
|
+
this._handleMaxRetriesReached(reject);
|
|
294
|
+
} else {
|
|
295
|
+
this._retryAttempts++;
|
|
296
|
+
this._schedulePlaylistRetry(resolve, reject, playlistInfo);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
private _handleMaxRetriesReached(reject: (reason?: any) => void): void {
|
|
301
|
+
this._logger.error('Max retry attempts reached - rejecting playlist', {maxAttempts: MAX_RETRY_ATTEMPTS});
|
|
302
|
+
this._retryAttempts = 0;
|
|
303
|
+
const playlistData = this._getPlaylistObject();
|
|
304
|
+
reject(playlistData);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
private _schedulePlaylistRetry(
|
|
308
|
+
resolve: (value: ProviderPlaylistObject) => void,
|
|
309
|
+
reject: (reason?: any) => void,
|
|
310
|
+
playlistInfo: ProviderPlaylistInfoObject
|
|
311
|
+
): void {
|
|
312
|
+
setTimeout(() => {
|
|
313
|
+
this._dataLoader = new OVPDataLoaderManager(this.playerVersion, this.partnerId, this.ks, this._networkRetryConfig);
|
|
314
|
+
let ks: string = this.ks;
|
|
315
|
+
if (!ks) {
|
|
316
|
+
ks = '{1:result:ks}';
|
|
317
|
+
this._dataLoader.add(OVPSessionLoader, {widgetId: this.widgetId});
|
|
318
|
+
}
|
|
319
|
+
// Add commas to BaseEntryResponseProfile fields to bust cache on retry
|
|
320
|
+
const retryParams = {
|
|
321
|
+
playlistId: playlistInfo.playlistId,
|
|
322
|
+
ks,
|
|
323
|
+
cacheToken: ','.repeat(this._retryAttempts)
|
|
324
|
+
};
|
|
325
|
+
this._dataLoader.add(OVPPlaylistLoader, retryParams);
|
|
326
|
+
this._dataLoader.fetchData().then(
|
|
327
|
+
retryResponse => {
|
|
328
|
+
this._handlePlaylistResponse(retryResponse, resolve, reject, playlistInfo);
|
|
329
|
+
},
|
|
330
|
+
err => {
|
|
331
|
+
reject(err);
|
|
332
|
+
}
|
|
333
|
+
);
|
|
334
|
+
}, RETRY_INTERVAL);
|
|
335
|
+
}
|
|
336
|
+
|
|
252
337
|
private _parsePlaylistDataFromResponse(data: Map<string, ILoader>): ProviderPlaylistObject {
|
|
253
338
|
this._logger.debug('Data parsing started');
|
|
254
339
|
const playlistConfig: ProviderPlaylistObject = this._getPlaylistObject();
|
|
@@ -368,10 +453,17 @@ export default class OVPProvider extends BaseProvider<OVPProviderMediaInfoObject
|
|
|
368
453
|
sourcesObject.downloadUrl = mediaEntry.downloadUrl;
|
|
369
454
|
sourcesObject.rootEntryId = mediaEntry.rootEntryId;
|
|
370
455
|
sourcesObject.capabilities = mediaEntry.capabilities;
|
|
456
|
+
if (mediaEntry.activeLiveStreamTime) {
|
|
457
|
+
sourcesObject.activeLiveStreamTime = mediaEntry.activeLiveStreamTime;
|
|
458
|
+
}
|
|
371
459
|
if (mediaEntry.sources.captions) {
|
|
372
460
|
sourcesObject.captions = mediaEntry.sources.captions;
|
|
373
461
|
}
|
|
374
|
-
if (
|
|
462
|
+
if (
|
|
463
|
+
mediaEntry.metadata &&
|
|
464
|
+
typeof mediaEntry.metadata.tags === 'string' &&
|
|
465
|
+
mediaEntry.metadata.tags.split(',').some(tag => tag.trim() === this._vrTag)
|
|
466
|
+
) {
|
|
375
467
|
sourcesObject.vr = {};
|
|
376
468
|
}
|
|
377
469
|
|
|
@@ -5,6 +5,7 @@ import {KalturaAccessControlModifyRequestHostRegexAction} from './kaltura-access
|
|
|
5
5
|
import {KalturaRuleAction} from './kaltura-rule-action';
|
|
6
6
|
import {KalturaFlavorAsset} from './kaltura-flavor-asset';
|
|
7
7
|
import {KalturaBumper} from './kaltura-bumper';
|
|
8
|
+
import {ActiveLiveStreamTime} from './kaltura-active-live-stream-time';
|
|
8
9
|
|
|
9
10
|
export class KalturaPlaybackContext extends ServiceResult {
|
|
10
11
|
/**
|
|
@@ -33,6 +34,8 @@ export class KalturaPlaybackContext extends ServiceResult {
|
|
|
33
34
|
*/
|
|
34
35
|
public bumperData: Array<KalturaBumper> = [];
|
|
35
36
|
|
|
37
|
+
public activeLiveStreamTime?: ActiveLiveStreamTime | undefined;
|
|
38
|
+
|
|
36
39
|
/**
|
|
37
40
|
* @constructor
|
|
38
41
|
* @param {Object} response The response
|
|
@@ -66,6 +69,13 @@ export class KalturaPlaybackContext extends ServiceResult {
|
|
|
66
69
|
if (bumperData) {
|
|
67
70
|
bumperData.map(bumper => this.bumperData.push(new KalturaBumper(bumper)));
|
|
68
71
|
}
|
|
72
|
+
|
|
73
|
+
if (response.activeLiveStreamTime) {
|
|
74
|
+
this.activeLiveStreamTime = {
|
|
75
|
+
startTime: response.activeLiveStreamTime.startTime,
|
|
76
|
+
endTime: response.activeLiveStreamTime.endTime
|
|
77
|
+
};
|
|
78
|
+
}
|
|
69
79
|
}
|
|
70
80
|
}
|
|
71
81
|
|
|
@@ -14,7 +14,7 @@ export default class OVPPlaylistService extends OVPService {
|
|
|
14
14
|
* @returns {RequestBuilder} The request builder
|
|
15
15
|
* @static
|
|
16
16
|
*/
|
|
17
|
-
public static execute(serviceUrl: string, ks: string, playlistId: string): RequestBuilder {
|
|
17
|
+
public static execute(serviceUrl: string, ks: string, playlistId: string, cacheToken?: string): RequestBuilder {
|
|
18
18
|
const headers: Map<string, string> = new Map();
|
|
19
19
|
headers.set('Content-Type', 'application/json');
|
|
20
20
|
const request = new RequestBuilder(headers);
|
|
@@ -23,10 +23,17 @@ export default class OVPPlaylistService extends OVPService {
|
|
|
23
23
|
request.method = 'POST';
|
|
24
24
|
request.url = request.getUrl(serviceUrl);
|
|
25
25
|
request.tag = `${SERVICE_NAME}-execute`;
|
|
26
|
+
|
|
27
|
+
const responseProfile = new BaseEntryResponseProfile();
|
|
28
|
+
// Append commas cache token to fields to bust cache on retry
|
|
29
|
+
if (cacheToken) {
|
|
30
|
+
responseProfile.fields = responseProfile.fields + cacheToken;
|
|
31
|
+
}
|
|
32
|
+
|
|
26
33
|
request.params = {
|
|
27
34
|
ks: ks,
|
|
28
35
|
id: playlistId,
|
|
29
|
-
responseProfile:
|
|
36
|
+
responseProfile: responseProfile
|
|
30
37
|
};
|
|
31
38
|
return request;
|
|
32
39
|
}
|
|
@@ -3,8 +3,10 @@ import {DocumentSource} from '../entities/document-source';
|
|
|
3
3
|
import {ProviderMediaConfigMetadataObject} from './media-config-metadata';
|
|
4
4
|
import {PKExternalCaptionObject} from './external-caption-object';
|
|
5
5
|
import {ProviderMediaSourceObject} from './media-source';
|
|
6
|
+
import {ActiveLiveStreamTime} from '../k-provider/ovp/response-types/kaltura-active-live-stream-time';
|
|
6
7
|
|
|
7
8
|
export type ProviderMediaConfigSourcesObject = {
|
|
9
|
+
activeLiveStreamTime?: ActiveLiveStreamTime;
|
|
8
10
|
dash: Array<ProviderMediaSourceObject>;
|
|
9
11
|
hls: Array<ProviderMediaSourceObject>;
|
|
10
12
|
progressive: Array<ProviderMediaSourceObject>;
|