Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(FEC-10699): add Linear media type recognition by OTT BE response #136

Merged
merged 8 commits into from
Jan 26, 2021

Conversation

RoyBregman
Copy link
Contributor

Description of the Changes

In OTT BE response, when KalturaLiveAsset and enableTrickPlay is true - set dvr to true

resolves FEC-10699

CheckLists

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • test are passing in local environment
  • Travis tests are passing (or test results are not worse than on master branch :))
  • Docs have been updated

@@ -23,7 +23,7 @@ const MediaTypeCombinations: {[mediaType: string]: Object} = {
[KalturaPlaybackContext.Type.TRAILER]: () => ({type: MediaEntry.Type.VOD}),
[KalturaPlaybackContext.Type.PLAYBACK]: mediaAssetData => {
if (parseInt(mediaAssetData.externalIds) > 0 || mediaAssetData.objectType === LIVE_ASST_OBJECT_TYPE) {
return {type: MediaEntry.Type.LIVE, dvrStatus: 0};
return {type: MediaEntry.Type.LIVE, dvrStatus: mediaAssetData.enableTrickPlay ? 1 : 0};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the condition in the ticket discuss enableTrickPlay and mediaAssetData.objectType === LIVE_ASST_OBJECT_TYPE but not mediaAssetData.externalIds

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. pushed a fix

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can, OTT doesn't have at all provider parser spec. I think we should add. Just a matter of time :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please discuss with @yairans to add unit tests coverage for this

OrenMe
OrenMe previously approved these changes Jan 25, 2021
return {type: MediaEntry.Type.LIVE, dvrStatus: 0};
} else if (mediaAssetData.objectType === LIVE_ASST_OBJECT_TYPE) {
return {type: MediaEntry.Type.LIVE, dvrStatus: mediaAssetData.enableTrickPlay ? 1 : 0};
Copy link
Contributor

@dan-ziv dan-ziv Jan 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RoyBregman suggest to add enum for this (can't remember why we didn't do it so far).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DvrStatus.ON
DvrStatus.OFF

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RoyBregman but need also to assign the enum 😁

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, i thought only declare it ;)
I pushed the wrong file... pushed it now

dan-ziv
dan-ziv previously approved these changes Jan 25, 2021
@@ -1,2 +1,2 @@
!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 i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.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 i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));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=17)}([function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(1);function i(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,i){void 0===i&&(i={}),this.severity=t,this.category=r,this.code=n,this.data=i,e._logger.error("Category:"+r+" | Code:"+n+" |",i)};i(a,"Severity",{RECOVERABLE:1,CRITICAL:2}),i(a,"Category",{NETWORK:1,SERVICE:2,PROVIDER:3}),i(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}),i(a,"_logger",Object(n.b)("Error"))},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 a})),r.d(t,"a",(function(){return i}));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(){}}}},i={};function a(e){e&&"function"==typeof e.getLogger&&(n.get=e.getLogger),e&&e.LogLevel&&(i=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 o}));var n=r(7);var i,a,s,o=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}},e}();s={VOD:"Vod",LIVE:"Live",IMAGE:"Image",AUDIO:"Audio",UNKNOWN:"Unknown"},(a="Type")in(i=o)?Object.defineProperty(i,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[a]=s},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0);function i(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),i(this,"retryConfig",{async:!0,timeout:0,maxAttempts:4}),i(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})),r.d(t,"b",(function(){return i})),r.d(t,"c",(function(){return a}));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"}},i=new Map([["mpegdash",n.DASH],["applehttp",n.HLS],["url",n.MP4]]);function a(e){var t=i.get(e);return!!t&&t.name===n.MP4.name}},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 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}},function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n,i,a,s=function(e){this.scheme=e.scheme,this.licenseURL=e.licenseURL,this.certificate=e.certificate};a={"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"},(i="Scheme")in(n=s)?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));r(8);var n=r(4),i=function(){function e(){this.progressive=[],this.dash=[],this.hls=[]}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:[]};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},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 a}));r(10);var n=r(0);function i(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){i(this,"_loadersResponseMap",new Map),i(this,"_loaders",new Map),this._networkRetryConfig=e}var t=e.prototype;return t.add=function(e,t){var r=this,n=new e(t);if(n.isValid()){this._loaders.set(e.id,n);var i=this._multiRequest.requests.length,a=n.requests;this._multiRequest.retryConfig=this._networkRetryConfig,a.forEach((function(e){r._multiRequest.add(e)}));var s=Array.from(new Array(a.length),(function(e,t){return t+i}));this._loadersResponseMap.set(e.id,s)}},t.fetchData=function(){var e=this;return new Promise((function(t,r){e._multiRequest.execute().then((function(i){e._multiResponse=i.response,e.prepareData(i.response).success?t(e._loaders):r(new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,n.a.Code.API_RESPONSE_MISMATCH,{headers:i.headers}))}),(function(e){r(e)}))}))},t.prepareData=function(e){var t=this;return this._loaders.forEach((function(r,n){var i=t._loadersResponseMap.get(n);try{i&&i.length>0&&(r.response=e.results.slice(i[0],i[i.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),i=r(1),a=r(5),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),i=0;i<r;i++)n[i]=arguments[i];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 i=n.prototype;return i.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},i.execute=function(){var e=this;return new Promise((function(t,r){try{e.params=JSON.stringify(e.params)}catch(t){n._logger.error(""+t.message),r(new s.a(s.a.Severity.CRITICAL,s.a.Category.PROVIDER,s.a.Code.FAILED_PARSING_REQUEST,{error:t,params:e.params}))}e.doHttpRequest().then((function(n){var i=new l(n);i.success?t({headers:e.responseHeaders,response:i}):r(new s.a(s.a.Severity.CRITICAL,s.a.Category.NETWORK,s.a.Code.MULTIREQUEST_API_ERROR,{url:e.url,headers:e.responseHeaders,results:i.results}))}),(function(e){r(e)}))}))},n}(n.a);u(c,"_logger",Object(i.b)("MultiRequestBuilder"));var l=function e(t){var r=this;u(this,"results",[]),this.success=!0,(t.result?t.result:t).forEach((function(t){var n=new a.a(t);if(r.results.push(n),n.hasError)return e._logger.error("Service returned an error with error code: "+n.error.code+" and message: "+n.error.message+"."),void(r.success=!1)}))};u(l,"_logger",Object(i.b)("MultiRequestResult"))},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 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 o}));var n=r(1),i=(r(9),r(0));function a(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&&a(e.prototype,t),r&&a(e,r),e}var o=function(){function e(e,t){var r,i,a;a={async:!0,timeout:0,maxAttempts:4},(i="_networkRetryConfig")in(r=this)?Object.defineProperty(r,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[i]=a,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 i.a(i.a.Severity.CRITICAL,i.a.Category.PROVIDER,i.a.Code.METHOD_NOT_IMPLEMENTED,{message:"getMediaConfig method must be implement by the derived class"}))},t.getPlaylistConfig=function(e){return Promise.reject(new i.a(i.a.Severity.CRITICAL,i.a.Category.PROVIDER,i.a.Code.METHOD_NOT_IMPLEMENTED,{message:"The provider does not support loading playlist by id"}))},t.getEntryListConfig=function(e){return Promise.reject(new i.a(i.a.Severity.CRITICAL,i.a.Category.PROVIDER,i.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).length)throw new i.a(i.a.Severity.CRITICAL,i.a.Category.SERVICE,i.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(2);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 pe})),r.d(t,"NAME",(function(){return he})),r.d(t,"VERSION",(function(){return ye}));var n=r(1),i=r(14),a={serviceUrl:"https://cdnapisec.kaltura.com/api_v3",cdnUrl:"https://cdnapisec.kaltura.com",serviceParams:{apiVersion:"3.3.0",format:1},useApiCaptions:!0},s=function(){function e(){}return e.set=function(e){e&&Object.assign(a,e)},e.get=function(){return Object(i.a)(a)},e}(),o=r(5),u=r(11),c=r(6);var l=function(){function e(e){var t,r,n,i=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 i.drm.push(new c.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 d,f,p,h=function(e){this.type=e.type};p={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(d=h)?Object.defineProperty(d,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):d[f]=p;var y=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}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(h);var g=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}(g,"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 m=function(e){this.entryId=e.entryId,this.clickThroughUrl=e.url,this.sources=e.sources?e.sources.map((function(e){return new l(e)})):[]};function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var E=function(e){var t,r;function n(t){var r;if(_(v(r=e.call(this,t)||this),"sources",[]),_(v(r),"actions",[]),_(v(r),"messages",[]),_(v(r),"flavorAssets",[]),_(v(r),"bumperData",[]),!r.hasError){var n=t.messages;n&&n.map((function(e){return r.messages.push(new u.a(e))}));var i=t.actions;i&&i.map((function(e){e.type===h.Type.REQUEST_HOST_REGEX?r.actions.push(new y(e)):r.actions.push(new h(e))}));var a=t.sources;a&&a.map((function(e){return r.sources.push(new l(e))}));var s=t.flavorAssets;s&&s.map((function(e){return r.flavorAssets.push(new g(e))}));var o=t.bumperData;o&&o.map((function(e){return r.bumperData.push(new m(e))}))}return r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var i=n.prototype;return i.hasBlockAction=function(){return void 0!==this.getBlockAction()},i.getBlockAction=function(){return this.actions.find((function(e){return e.type===h.Type.BLOCK}))},i.getErrorMessages=function(){return this.messages},i.getRequestHostRegexAction=function(){var e=this.actions.find((function(e){return e.type===h.Type.REQUEST_HOST_REGEX}));if(e instanceof y)return e},n}(o.a);function I(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var b=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};I(b,"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}),I(b,"Status",{VALID:1,INVALID:2,DELETED:3});var R=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 b(e))})))),r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(o.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 T=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};O(T,"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(T,"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(T,"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(T,"EntryModerationStatus",{PENDING_MODERATION:1,APPROVED:2,REJECTED:3,FLAGGED_FOR_REVIEW:4,MODERATE:5,AUTO_APPROVED:6});var C=function(){function e(){}return e.build=function(e){var t=s.get(),r=t.serviceUrl.substr(0,t.serviceUrl.lastIndexOf("/")),n=e.partnerId,i=e.entryId,a=e.ks,o=e.uiConfId,u=e.format,c=e.protocol,l=e.extension,d=e.flavorIds;if(!(r&&n&&i&&u&&c))return"";var f=r;return r.endsWith("/")||(f+="/"),f+="p/"+n+"/sp/"+n+"00/playManifest/entryId/"+i+"/protocol/"+c+"/format/"+u,d?f+="/flavorIds/"+d:o&&(f+="/uiConfId/"+o),""!==a&&(f+="/ks/"+a),""!==l&&(f+="/a."+l),o&&""!==d&&(f+="?uiConfId="+o),f},e}(),A=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 i=0;i<e.childNodes.length;i++){var a=e.childNodes.item(i),s=a.nodeName;if(void 0===t[s])t[s]=this.xmlToJson(a);else{if(void 0===t[s].push){var o=t[s];t[s]=[],t[s].push(o)}t[s].push(this.xmlToJson(a))}}return t},e}(),P=r(2),w=r(12),S=r(8),D=r(7),k=r(4),M=function(){this.items=[]},L=r(15),j=r(16),N={SRT:"1",DFXP:"2",WEBVTT:"3",CAP:"4"},U={3:"vtt",1:"srt"},x=function(){function e(){}return e.createConfig=function(e,t){return e.map((function(e){var r=e.url,n=U[e.format];return[N.DFXP,N.CAP].includes(e.format)&&(r=e.webVttUrl,n=U[N.WEBVTT]),r=q(r,t),{default:!!e.isDefault,type:n,language:e.languageCode,label:e.label,url:r}}))},e}();var V=function(){function e(){}return e.getMediaEntry=function(t,r,n,i){var a=new P.a,o=i.entry,u=i.playBackContextResult,c=i.metadataListResult,l=u.sources;return a.sources=e._getParsedSources(l,t,r,n,o,u),s.get().useApiCaptions&&u.data.playbackCaptions&&(a.sources.captions=x.createConfig(u.data.playbackCaptions,t)),e._fillBaseData(a,o,c),a},e.addKsToUrl=function(e,t){var r;return t?(r=-1!==new URL(e).pathname.replace(/^.*[\\/]/,"").indexOf(".")?-1===e.indexOf("?")?"?ks=":"&ks=":"/ks/",e+r+t):e},e.getPlaylist=function(t){var r=new M,n=t.playlistData,i=t.playlistItems.entries;return r.id=n.id,r.name=n.name,r.description=n.description,r.poster=n.poster,i.forEach((function(t){var n=new P.a;e._fillBaseData(n,t),r.items.push(n)})),r},e.getEntryList=function(t){var r=new L.a;return t.playlistItems.entries.forEach((function(t){var n=new P.a;e._fillBaseData(n,t),r.items.push(n)})),r},e.getBumper=function(t,r,n){var i=t.playBackContextResult,a=i.bumperData[0];if(a){var s=(a&&a.sources).find((function(e){return Object(k.c)(e.format)}));if(s){var o=e._parseProgressiveSources(s,i,r,n,0,a.entryId);if(o[0])return new j.a({url:o[0].url,clickThroughUrl:a.clickThroughUrl})}}},e._fillBaseData=function(t,r,n){return t.poster=r.poster,t.id=r.id,t.duration=r.duration,t.metadata=e._parseMetadata(n),t.metadata.description=r.description||"",t.metadata.name=r.name||"",t.metadata.tags=r.tags||"",t.status=r.status,t.type=e._getEntryType(r.entryType,r.type),t.type===P.a.Type.LIVE&&(t.dvrStatus=r.dvrStatus),t},e._getEntryType=function(e,t){var r=P.a.Type.UNKNOWN;switch(e){case T.MediaType.IMAGE.value:r=P.a.Type.IMAGE;break;case T.MediaType.AUDIO.value:r=P.a.Type.AUDIO;break;default:switch(t){case T.EntryType.MEDIA_CLIP.value:r=P.a.Type.VOD;break;case T.EntryType.LIVE_STREAM.value:case T.EntryType.LIVE_CHANNEL.value:r=P.a.Type.LIVE;break;default:r=P.a.Type.UNKNOWN}}return r},e._getParsedSources=function(t,r,n,i,a,s){var o,u,c=new D.a,l=function(t){var o=e._parseAdaptiveSource(t,s,r,n,i,a.id);if(o){var u=k.b.get(t.format);c.map(o,u)}};return a.type===T.EntryType.EXTERNAL_MEDIA.value?((u=new S.a).mimetype="video/youtube",u.url=a.referenceId,u.id=a.id+"_youtube",c.progressive.push(u)):t&&t.length>0&&(t.filter((function(e){return!Object(k.c)(e.format)})).forEach(l),o=t.find((function(t){return Object(k.c)(t.format)&&""!==t.getProtocol(e._getBaseProtocol())})),c.progressive=e._parseProgressiveSources(o,s,r,n,i,a.id)),c},e._parseAdaptiveSource=function(t,r,n,i,a,s){var o=new S.a;if(t){var u="",l=k.b.get(t.format),d=t.getProtocol(e._getBaseProtocol()),f=t.deliveryProfileId,p=t.format,h="";if(l&&(h=l.pathExt,o.mimetype=l.mimeType),t.hasFlavorIds()?(!h&&r.flavorAssets&&r.flavorAssets.length>0&&(h=r.flavorAssets[0].fileExt),u=C.build({entryId:s,flavorIds:t.flavorIds,format:p,ks:n,partnerId:i,uiConfId:a,extension:h,protocol:d})):u=e.addKsToUrl(t.url,n),!u){var y="failed to create play url from source, discarding source: ("+s+"_"+f+"), "+p;return e._logger.warn(y),null}if(o.url=e._applyRegexAction(r,u),o.id=s+"_"+f+","+p,t.hasDrmData()){var g=[];t.drm.forEach((function(e){g.push(new w.a(e.licenseURL,c.a.Scheme[e.scheme],e.certificate))})),o.drmData=g}}return o},e._parseProgressiveSources=function(t,r,n,i,a,s){var o=[],u=[];if(t){var c=t.getProtocol(e._getBaseProtocol()),l=t.format,d=t.deliveryProfileId,f=d+","+l;r.flavorAssets.map((function(t){var p=new S.a;p.id=t.id+f,p.mimetype="mp3"===t.fileExt?"audio/mp3":"video/mp4",p.height=t.height,p.width=t.width,p.bandwidth=1024*t.bitrate,p.label=t.label||t.language;var h=C.build({entryId:s,flavorIds:t.id,format:l,ks:n,partnerId:i,uiConfId:a,extension:t.fileExt,protocol:c});if(""===h)return e._logger.warn("failed to create play url from source, discarding source: ("+s+"_"+d+"), "+l+"."),null;p.url=e._applyRegexAction(r,h),t.height&&t.width?o.push(p):u.push(p)}))}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 i=A.xmlToJson(r);Object.keys(i.metadata).forEach((function(e){t[e]=i.metadata[e]["#text"]}))}})),t},e._getBaseProtocol=function(){var e=s.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._applyRegexAction=function(e,t){var r=e.getRequestHostRegexAction();if(r){var n=new RegExp(r.pattern,"i");if(t.match(n))return t.replace(n,r.replacement+"/")}return t},e}();!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(V,"_logger",Object(n.b)("OVPProviderParser"));var q=V.addKsToUrl,F=V,H=r(3),B=r(10),W=function(){function e(){}return e.getMultiRequest=function(e,t,r){var n=s.get(),i=n.serviceParams;Object.assign(i,{ks:t,clientTag:"html5:v"+e}),r&&Object.assign(i,{partnerId:r});var a=new Map;a.set("Content-Type","application/json");var o=new B.a(a);return o.method="POST",o.service="multirequest",o.url=o.getUrl(n.serviceUrl),o.params=i,o},e}();var G=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"};!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(G,"Type",{INCLUDE_FIELDS:1,EXCLUDE_FIELDS:2});var K=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 i=new H.a(n);i.service="baseEntry",i.action="getPlaybackContext",i.method="POST",i.url=i.getUrl(e),i.tag="baseEntry-getPlaybackContext";return i.params={entryId:r,ks:t,contextDataParams:{objectType:"KalturaContextDataParams",flavorTags:"all"}},i},n.list=function(e,t,r,i,a){var s=new Map;s.set("Content-Type","application/json");var o=new H.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,i,a),o},n.getEntryListReqParams=function(e,t,r,n){var i={};return e?i=r?{redirectFromEntryId:e}:{idEqual:e}:n&&(i={objectType:"KalturaBaseEntryFilter",referenceIdEqual:n}),{ks:t,filter:i,responseProfile:new G}},n}(W);var Y=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 i=new H.a(n);i.service="metadata_metadata",i.action="list",i.method="POST",i.url=i.getUrl(e),i.tag="metadata_metadata-list";var a={objectType:"KalturaMetadataFilter",objectIdEqual:r,metadataObjectTypeEqual:"1"};return i.params={filter:a,ks:t},i},n}(W);var J=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 T(e))})))),r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(o.a);function X(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 Q(e,t,r){return t&&X(e.prototype,t),r&&X(e,r),e}var z=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}Q(e,null,[{key:"id",get:function(){return"media"}}]);var t=e.prototype;return t.buildRequests=function(e){var t=s.get(),r=[];r.push(K.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(K.getPlaybackContext(t.serviceUrl,e.ks,n)),r.push(Y.list(t.serviceUrl,e.ks,n)),r},t.isValid=function(){return!(!this._entryId&&!this._referenceId)},Q(e,[{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){var t=new J(e[0].data);this._response.entry=t.entries[0],this._response.playBackContextResult=new E(e[1].data),this._response.metadataListResult=new R(e[2].data)},get:function(){return this._response}}]),e}();var Z=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 H.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}(W);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(){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}}])&&$(e.prototype,t),r&&$(e,r);var i=n.prototype;return i.buildRequests=function(e){var t=s.get(),r=[];return r.push(Z.anonymousSession(t.serviceUrl,e.widgetId)),r},i.isValid=function(){return!!this._widgetId},n}();var te=function(e){var t,r;function n(t,r,n,i){var a;return void 0===n&&(n=""),(a=e.call(this,i)||this)._multiRequest=W.getMultiRequest(t,n,r),a}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(r(9).a);var re=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 i=new H.a(n);return i.service="playlist",i.action="execute",i.method="POST",i.url=i.getUrl(e),i.tag="playlist-execute",i.params={ks:t,id:r,responseProfile:new G},i},n.get=function(e,t,r){var n=new Map;n.set("Content-Type","application/json");var i=new H.a(n);return i.service="playlist",i.action="get",i.method="POST",i.url=i.getUrl(e),i.tag="playlist-get",i.params={ks:t,id:r,responseProfile:{fields:"id,name,description,thumbnailUrl",type:1}},i},n}(W),ne=function(e){this.id=e.id,this.name=e.name,this.description=e.description,this.poster=e.thumbnailUrl};var ie=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 T(e))}))),r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(o.a);function ae(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 se(e,t,r){return t&&ae(e.prototype,t),r&&ae(e,r),e}var oe=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}se(e,null,[{key:"id",get:function(){return"playlist"}}]);var t=e.prototype;return t.buildRequests=function(e){var t=s.get(),r=[];return r.push(re.get(t.serviceUrl,e.ks,e.playlistId)),r.push(re.execute(t.serviceUrl,e.ks,e.playlistId)),r},t.isValid=function(){return!!this._playlistId},se(e,[{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){this._response.playlistData=new ne(e[0].data),this._response.playlistItems=new ie(e[1].data)},get:function(){return this._response}}]),e}(),ue=r(13);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",{playlistItems:{entries:[]}}),this.requests=this.buildRequests(e),this._entries=e.entries}le(e,null,[{key:"id",get:function(){return"entry_list"}}]);var t=e.prototype;return t.buildRequests=function(e){var t=s.get(),r=[];return e.entries.forEach((function(n){r.push(K.list(t.serviceUrl,e.ks,n.entryId||n,e.redirectFromEntryId,n.referenceId))})),r},t.isValid=function(){return!(!this._entries||!this._entries.length)},le(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 J(e.data),r._response.playlistItems.entries.push(t.entries[0])}))},get:function(){return this._response}}]),e}(),fe=r(0);var pe=function(e){var t,r;function i(t,r){var i;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}(i=e.call(this,t,r)||this),"_filterOptionsConfig",{redirectFromEntryId:!0}),i._logger=Object(n.b)("OVPProvider"),s.set(t.env),i._setFilterOptionsConfig(t.filterOptions),i._networkRetryConfig=Object.assign(i._networkRetryConfig,t.networkRetryParameters),i}r=e,(t=i).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var a=i.prototype;return a.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 te(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var i=e.entryId,a=e.referenceId;if(i||a){var s=t.ks;s||(s="{1:result:ks}",t._dataLoader.add(ee,{widgetId:t.widgetId}));var o=t._getEntryRedirectFilter(e);return t._dataLoader.add(z,{entryId:i,ks:s,redirectFromEntryId:o,referenceId:a}),t._dataLoader.fetchData().then((function(e){try{r(t._parseDataFromResponse(e))}catch(e){n(e)}}),(function(e){n(e)}))}n(new fe.a(fe.a.Severity.CRITICAL,fe.a.Category.PROVIDER,fe.a.Code.MISSING_MANDATORY_PARAMS,{message:"missing entry id"}))}))},a._getEntryRedirectFilter=function(e){return"boolean"==typeof e.redirectFromEntryId?e.redirectFromEntryId:"boolean"!=typeof this._filterOptionsConfig.redirectFromEntryId||this._filterOptionsConfig.redirectFromEntryId},a._setFilterOptionsConfig=function(e){e&&"boolean"==typeof e.redirectFromEntryId&&(this._filterOptionsConfig.redirectFromEntryId=e.redirectFromEntryId)},a._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(ee.id)){var r=e.get(ee.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(z.id)){var n=e.get(z.id);if(n&&n.response){var i=n.response;if(F.hasBlockAction(i))throw new fe.a(fe.a.Severity.CRITICAL,fe.a.Category.SERVICE,fe.a.Code.BLOCK_ACTION,{action:F.getBlockAction(i),messages:F.getErrorMessages(i)});var a=F.getMediaEntry(this.isAnonymous?"":this.ks,this.partnerId,this.uiConfId,i);Object.assign(t.sources,this._getSourcesObject(a)),this._verifyMediaStatus(a),this._verifyHasSources(t.sources);var s=F.getBumper(i,this.isAnonymous?"":this.ks,this.partnerId);s&&Object.assign(t.plugins,{bumper:s})}}}return this._logger.debug("Data parsing finished",t),t},a._verifyMediaStatus=function(e){if([T.EntryStatus.IMPORT,T.EntryStatus.PRECONVERT].includes(e.status))throw new fe.a(fe.a.Severity.CRITICAL,fe.a.Category.SERVICE,fe.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}})},a.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 te(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var i=e.playlistId;if(i){var a=t.ks;a||(a="{1:result:ks}",t._dataLoader.add(ee,{widgetId:t.widgetId})),t._dataLoader.add(oe,{playlistId:i,ks:a}),t._dataLoader.fetchData().then((function(e){r(t._parsePlaylistDataFromResponse(e))}),(function(e){n(e)}))}else n({success:!1,data:"Missing mandatory parameter"})}))},a._parsePlaylistDataFromResponse=function(e){var t=this;this._logger.debug("Data parsing started");var r=this._getPlaylistObject();if(e&&e.has(oe.id)){var n=e.get(oe.id);if(n&&n.response){var i=F.getPlaylist(n.response);r.id=i.id,r.poster=i.poster,r.metadata.name=i.name,r.metadata.description=i.description,i.items.forEach((function(e){return r.items.push({sources:t._getSourcesObject(e)})}))}}return this._logger.debug("Data parsing finished",r),r},a.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 te(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var i=e.entries;if(i&&i.length){var a=t.ks;a||(a="{1:result:ks}",t._dataLoader.add(ee,{widgetId:t.widgetId}));var s=t._getEntryRedirectFilter(e);t._dataLoader.add(de,{entries:i,ks:a,redirectFromEntryId:s}),t._dataLoader.fetchData().then((function(e){r(t._parseEntryListDataFromResponse(e))}),(function(e){n(e)}))}else n({success:!1,data:"Missing mandatory parameter"})}))},a._parseEntryListDataFromResponse=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)F.getEntryList(n.response).items.forEach((function(e){return r.items.push({sources:t._getSourcesObject(e)})}))}return this._logger.debug("Data parsing finished",r),r},a._getPlaylistObject=function(){return{id:"",metadata:{name:"",description:""},poster:"",items:[]}},a._getDefaultSourcesObject=function(){return{hls:[],dash:[],progressive:[],id:"",duration:0,type:P.a.Type.UNKNOWN,poster:"",dvr:!1,vr:null,metadata:{name:"",description:"",tags:""}}},a._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.sources.captions&&(t.captions=e.sources.captions),e.metadata&&"string"==typeof e.metadata.tags&&e.metadata.tags.indexOf("360")>-1&&(t.vr={}),Object.assign(t.metadata,e.metadata),t},i}(ue.a),he="playkit-js-providers-ovp",ye="2.27.0"}])}));
!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 i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.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 i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));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=17)}([function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(1);function i(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,i){void 0===i&&(i={}),this.severity=t,this.category=r,this.code=n,this.data=i,e._logger.error("Category:"+r+" | Code:"+n+" |",i)};i(a,"Severity",{RECOVERABLE:1,CRITICAL:2}),i(a,"Category",{NETWORK:1,SERVICE:2,PROVIDER:3}),i(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}),i(a,"_logger",Object(n.b)("Error"))},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 a})),r.d(t,"a",(function(){return i}));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(){}}}},i={};function a(e){e&&"function"==typeof e.getLogger&&(n.get=e.getLogger),e&&e.LogLevel&&(i=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 o}));var n=r(7);var i,a,s,o=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}},e}();s={VOD:"Vod",LIVE:"Live",IMAGE:"Image",AUDIO:"Audio",UNKNOWN:"Unknown"},(a="Type")in(i=o)?Object.defineProperty(i,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[a]=s},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(0);function i(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),i(this,"retryConfig",{async:!0,timeout:0,maxAttempts:4}),i(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})),r.d(t,"b",(function(){return i})),r.d(t,"c",(function(){return a}));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"}},i=new Map([["mpegdash",n.DASH],["applehttp",n.HLS],["url",n.MP4]]);function a(e){var t=i.get(e);return!!t&&t.name===n.MP4.name}},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 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}},function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n,i,a,s=function(e){this.scheme=e.scheme,this.licenseURL=e.licenseURL,this.certificate=e.certificate};a={"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"},(i="Scheme")in(n=s)?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));r(8);var n=r(4),i=function(){function e(){this.progressive=[],this.dash=[],this.hls=[]}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:[]};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},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 a}));r(10);var n=r(0);function i(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){i(this,"_loadersResponseMap",new Map),i(this,"_loaders",new Map),this._networkRetryConfig=e}var t=e.prototype;return t.add=function(e,t){var r=this,n=new e(t);if(n.isValid()){this._loaders.set(e.id,n);var i=this._multiRequest.requests.length,a=n.requests;this._multiRequest.retryConfig=this._networkRetryConfig,a.forEach((function(e){r._multiRequest.add(e)}));var s=Array.from(new Array(a.length),(function(e,t){return t+i}));this._loadersResponseMap.set(e.id,s)}},t.fetchData=function(){var e=this;return new Promise((function(t,r){e._multiRequest.execute().then((function(i){e._multiResponse=i.response,e.prepareData(i.response).success?t(e._loaders):r(new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,n.a.Code.API_RESPONSE_MISMATCH,{headers:i.headers}))}),(function(e){r(e)}))}))},t.prepareData=function(e){var t=this;return this._loaders.forEach((function(r,n){var i=t._loadersResponseMap.get(n);try{i&&i.length>0&&(r.response=e.results.slice(i[0],i[i.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),i=r(1),a=r(5),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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this file change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it was by mistake. I even pushed a rollback but it somehow still considered it changed...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted successfully

RoyBregman and others added 2 commits January 26, 2021 17:21
@RoyBregman RoyBregman merged commit 23a3f99 into master Jan 26, 2021
@RoyBregman RoyBregman deleted the FEC-10699-linear-media-type branch January 26, 2021 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants