@viewlift/player-backup 1.0.70-backup → 1.0.72-backup

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/cjs/bundle.css CHANGED
@@ -184,6 +184,143 @@ button.vjs-big-play-button {
184
184
  }
185
185
  }
186
186
 
187
+ /* Chromecast */
188
+ .video-js .vjs-chromecast-button .vjs-icon-placeholder {
189
+ background: url('https://player.viewlift.com/images/ic_cast_white_24dp.png') center center no-repeat;
190
+ background-size: contain;
191
+ display: inline-block;
192
+ width: 16px;
193
+ height: 16px;
194
+ }
195
+
196
+ .video-js .vjs-chromecast-button:hover {
197
+ cursor: pointer;
198
+ }
199
+
200
+ .video-js .vjs-chromecast-button:hover .vjs-icon-placeholder {
201
+ background-image: url('https://player.viewlift.com/images/ic_cast_white_24dp.png');
202
+ }
203
+
204
+ .video-js .vjs-chromecast-button.vjs-chromecast-casting-state .vjs-icon-placeholder {
205
+ background-image: url('https://player.viewlift.com/images/ic_cast_connected_white_24dp.png');
206
+ }
207
+
208
+ .video-js .vjs-chromecast-button.vjs-chromecast-casting-state:hover .vjs-icon-placeholder {
209
+ background-image: url('https://player.viewlift.com/images/ic_cast_connected_white_24dp.png');
210
+ }
211
+ .video-js .vjs-chromecast-button >.vjs-chromecast-button-label{
212
+ display: none !important;
213
+ }
214
+
215
+ .video-js .vjs-tech-chromecast {
216
+ display: flex;
217
+ flex-direction: column;
218
+ justify-content: center;
219
+ align-items: center;
220
+ overflow: hidden;
221
+ }
222
+
223
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster::after {
224
+ content: ' ';
225
+ display: block;
226
+ height: 2px;
227
+ width: 100px;
228
+ background-color: #cccccc;
229
+ position: absolute;
230
+ left: calc(50% - 50px);
231
+ }
232
+
233
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster-img {
234
+ max-height: 180px;
235
+ width: auto;
236
+ border: 2px solid #cccccc;
237
+ }
238
+
239
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster-img.vjs-tech-chromecast-poster-img-empty {
240
+ width: 160px;
241
+ height: 90px;
242
+ }
243
+
244
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title-container {
245
+ position: absolute;
246
+ bottom: 50%;
247
+ margin-bottom: 100px;
248
+ color: #cccccc;
249
+ text-align: center;
250
+ }
251
+
252
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title {
253
+ font-size: 22px;
254
+ }
255
+
256
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title.vjs-tech-chromecast-title-empty {
257
+ display: none;
258
+ }
259
+
260
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-subtitle {
261
+ font-size: 18px;
262
+ padding-top: 0.5em;
263
+ }
264
+
265
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-subtitle.vjs-tech-chromecast-subtitle-empty {
266
+ display: none;
267
+ }
268
+
269
+ .video-js .vjs-tech-chromecast {
270
+ display: flex;
271
+ flex-direction: column;
272
+ justify-content: center;
273
+ align-items: center;
274
+ overflow: hidden;
275
+ }
276
+
277
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster::after {
278
+ content: ' ';
279
+ display: block;
280
+ height: 2px;
281
+ width: 100px;
282
+ background-color: #ccc;
283
+ position: absolute;
284
+ left: calc(50% - 50px);
285
+ }
286
+
287
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster-img {
288
+ max-height: 180px;
289
+ width: auto;
290
+ border: 2px solid #ccc;
291
+ }
292
+
293
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster-img.vjs-tech-chromecast-poster-img-empty {
294
+ width: 160px;
295
+ height: 90px;
296
+ }
297
+
298
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title-container {
299
+ position: absolute;
300
+ bottom: 50%;
301
+ margin-bottom: 100px;
302
+ color: #ccc;
303
+ text-align: center;
304
+ }
305
+
306
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title {
307
+ font-size: 22px;
308
+ }
309
+
310
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title.vjs-tech-chromecast-title-empty {
311
+ display: none;
312
+ }
313
+
314
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-subtitle {
315
+ font-size: 18px;
316
+ padding-top: 0.5em;
317
+ }
318
+
319
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-subtitle.vjs-tech-chromecast-subtitle-empty {
320
+ display: none;
321
+ }
322
+
323
+ /* Chromecast End */
187
324
 
188
325
  /* ADs */
189
326
  .ima-ad-container {
@@ -500,143 +637,6 @@ button.vjs-big-play-button {
500
637
  }
501
638
 
502
639
  /* Resolution Module End */
503
- /* Chromecast */
504
- .video-js .vjs-chromecast-button .vjs-icon-placeholder {
505
- background: url('https://player.viewlift.com/images/ic_cast_white_24dp.png') center center no-repeat;
506
- background-size: contain;
507
- display: inline-block;
508
- width: 16px;
509
- height: 16px;
510
- }
511
-
512
- .video-js .vjs-chromecast-button:hover {
513
- cursor: pointer;
514
- }
515
-
516
- .video-js .vjs-chromecast-button:hover .vjs-icon-placeholder {
517
- background-image: url('https://player.viewlift.com/images/ic_cast_white_24dp.png');
518
- }
519
-
520
- .video-js .vjs-chromecast-button.vjs-chromecast-casting-state .vjs-icon-placeholder {
521
- background-image: url('https://player.viewlift.com/images/ic_cast_connected_white_24dp.png');
522
- }
523
-
524
- .video-js .vjs-chromecast-button.vjs-chromecast-casting-state:hover .vjs-icon-placeholder {
525
- background-image: url('https://player.viewlift.com/images/ic_cast_connected_white_24dp.png');
526
- }
527
- .video-js .vjs-chromecast-button >.vjs-chromecast-button-label{
528
- display: none !important;
529
- }
530
-
531
- .video-js .vjs-tech-chromecast {
532
- display: flex;
533
- flex-direction: column;
534
- justify-content: center;
535
- align-items: center;
536
- overflow: hidden;
537
- }
538
-
539
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster::after {
540
- content: ' ';
541
- display: block;
542
- height: 2px;
543
- width: 100px;
544
- background-color: #cccccc;
545
- position: absolute;
546
- left: calc(50% - 50px);
547
- }
548
-
549
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster-img {
550
- max-height: 180px;
551
- width: auto;
552
- border: 2px solid #cccccc;
553
- }
554
-
555
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster-img.vjs-tech-chromecast-poster-img-empty {
556
- width: 160px;
557
- height: 90px;
558
- }
559
-
560
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title-container {
561
- position: absolute;
562
- bottom: 50%;
563
- margin-bottom: 100px;
564
- color: #cccccc;
565
- text-align: center;
566
- }
567
-
568
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title {
569
- font-size: 22px;
570
- }
571
-
572
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title.vjs-tech-chromecast-title-empty {
573
- display: none;
574
- }
575
-
576
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-subtitle {
577
- font-size: 18px;
578
- padding-top: 0.5em;
579
- }
580
-
581
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-subtitle.vjs-tech-chromecast-subtitle-empty {
582
- display: none;
583
- }
584
-
585
- .video-js .vjs-tech-chromecast {
586
- display: flex;
587
- flex-direction: column;
588
- justify-content: center;
589
- align-items: center;
590
- overflow: hidden;
591
- }
592
-
593
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster::after {
594
- content: ' ';
595
- display: block;
596
- height: 2px;
597
- width: 100px;
598
- background-color: #ccc;
599
- position: absolute;
600
- left: calc(50% - 50px);
601
- }
602
-
603
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster-img {
604
- max-height: 180px;
605
- width: auto;
606
- border: 2px solid #ccc;
607
- }
608
-
609
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster-img.vjs-tech-chromecast-poster-img-empty {
610
- width: 160px;
611
- height: 90px;
612
- }
613
-
614
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title-container {
615
- position: absolute;
616
- bottom: 50%;
617
- margin-bottom: 100px;
618
- color: #ccc;
619
- text-align: center;
620
- }
621
-
622
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title {
623
- font-size: 22px;
624
- }
625
-
626
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title.vjs-tech-chromecast-title-empty {
627
- display: none;
628
- }
629
-
630
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-subtitle {
631
- font-size: 18px;
632
- padding-top: 0.5em;
633
- }
634
-
635
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-subtitle.vjs-tech-chromecast-subtitle-empty {
636
- display: none;
637
- }
638
-
639
- /* Chromecast End */
640
640
  /* Airplay */
641
641
 
642
642
  .video-js .vjs-airplay-button .vjs-icon-placeholder {
package/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),i=require("@babel/runtime/regenerator"),n=require("axios"),o=require("./generic-e42efcd8.js"),r=require("video.js"),l=require("./util-d4c56a2d.js"),a=require("./renditions-b85edb07.js"),s=require("./resolution-08d6bb23.js"),d=require("./localisation-56e0a999.js");function u(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function c(e,t){u("event",e,t)}function v(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function m(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?v(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf");function f(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function w(){var e=window.sessionStorage.getItem("uid");return e||(e=f(),window.sessionStorage.setItem("uid",e),e)}function p(){return h.apply(this,arguments)}function h(){return h=t(i.mark((function e(){var t,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.getToken();case 2:if(t=e.sent,null==(n=JSON.parse(atob(t.split(".")[1])))||!n.anonymousId){e.next=8;break}return e.abrupt("return","guest-user");case 8:return e.abrupt("return",null==n?void 0:n.userId);case 9:case"end":return e.stop()}}),e)}))),h.apply(this,arguments)}window.initialise=function(e){window.sid=f(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var i,n,o,r=Math.floor(e.currentTime());c(r?"FAILED_TO_START":"DROPPED_STREAM",m({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(i=window)||void 0===i||null===(n=i.customData)||void 0===n||null===(o=n.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,i,n;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),c("PLAY",m({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var i,n;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(i=t.el_)&&void 0!==i&&null!==(n=i.className)&&void 0!==n&&n.includes("vjs-waiting"))c("BUFFERING",m({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,i,n;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,c("FIRST_FRAME",m({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),vid:window.videoId},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,i,n,o,r,l;c("AD_REQUEST",m({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),vid:window.videoId,resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(i=t.customData)||void 0===i||null===(n=i.beacon)||void 0===n?void 0:n.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),c("AD_IMPRESSION",m({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:window.videoId},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var i=Math.floor(e.currentTime());i>=30&&i%30==0&&!t.includes(i)&&(t.push(i),fireEvent({eventName:"PING",videoPosition:i,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),i=e.duration(),n=e.buffered(),o=0;o<n.length;o++){var r=n.start(o),l=n.end(o);if(g(t,r,l)){var a=Math.round(i-l);if(isFinite(a))return a}}}))()};var g=function(e,t,i){return e>=t&&e<=i};window.fireEvent=function(){var e=t(i.mark((function e(t){var r,l,a,s,d,u,c,v,f,h,g;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=m,e.t1=m,e.t2=m({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=w(),e.t5=window.videoId,e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(i=t.adPosition)?String(i):"":"",e.next=20,p();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),h=[e.t31],e.next=37,o.getToken();case 37:g=e.sent,n({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(f=v.beacon)||void 0===f?void 0:f.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:g},contentType:"application/x-www-form-urlencoded",dataType:"text",data:h}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var i}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var y,b,T=function(e){var t,i=o.getPlayer(null==e?void 0:e.playerId);null!=e&&null!==(t=e.series)&&void 0!==t&&t.enable||null==e||!e.chromecastReceiverId?console.log("Chromecast plugin is not available"):window.__onGCastApiAvailable=function(){null==i||i.chromecast({receiverAppID:null==e?void 0:e.chromecastReceiverId,addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},null!=e&&e.airplay&&"Safari"==o.detectBrowser()?null==i||i.airPlay({addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available")},P=function(e,t){var i=o.getPlayer(e);i&&t&&i.controlBar&&i.controlBar.progressControl.seekBar.on("click",(function(t){var i,n,o,l,a,s=this.el(),d=r.dom.getPointerPosition(s,t).x;r.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(i=window)||void 0===i||null===(n=i.cast)||void 0===n||null===(o=n.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),m=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=m*d,v.seek()}}))};function k(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function I(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?k(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var O=[],E=0,S=null;function j(e,t,i){var n,r,l,a,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];b=(null==t||null===(n=t.watchHistory)||void 0===n?void 0:n.apiVersion)||"v1";var d=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,u=Math.floor(e.currentTime()),c=Math.floor(e.duration()),v=null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.xapiKey,m=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,f={};"v1"==b?f={videoId:y,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==b&&(f=I(I({videoId:y,watchedTime:Math.floor(e.currentTime()),watchedPercentage:s?100:Math.floor(u/c*100),doneWatching:s,profileId:d},S&&{seriesId:S}),m&&{originalObjectId:m})),o.saveWatchHistory(f,b).then((function(e){})).catch((function(e){})),E=u+i}var D=function(e,t,i){var n=o.getPlayer(e);if(n)if(t>=0&&t<=100){n.muted()&&n.muted(!1);var r=parseFloat(t)/100;n.volume(r),i&&i({status:!0,msg:"Volume set to ".concat(t,"%")})}else i&&i({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else i({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},C=function(e){var t=o.getPlayer(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function A(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function R(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?A(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var F=function(e,t,i,n){var r,l,a=n.res,s=n.sres,d=o.getPlayer(e),u=(null==a?void 0:a.contentType)||"video",c=(null==a||null===(r=a[u])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;o.setCurrentVideo(a),d.on("loadstart",(function(){c&&i.resolve({status:!0,msg:"Video Loaded",response:a})})),d.on("loadeddata",(function(){var n;(null==d||!d.muted())&&D(e,sessionStorage.getItem("volume")||"100");var r=o.getCurrentVideo();if(o.clearError(),i.resolve(R({status:!0,msg:"Player Initialised"},s?{seriesResponse:s,response:a}:{response:a})),null!=t&&t.watchHistory&&null!=t&&null!==(n=t.watchHistory)&&void 0!==n&&n.enable&&!t.isAnonymousUser){var l,u,c=R(R({},t),a);!function(e,t,i){var n,r,l;null!=t&&t.series&&null!=t&&null!==(n=t.series)&&void 0!==n&&n.enable&&(S=null==t||null===(r=t.series)||void 0===r?void 0:r.id),O=[],E=0,y=i;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,s=o.getPlayer(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());O.includes(E)||(e==E?(O.push(e),j(s,t,a)):e>E&&(E=e+a))})),s.one("ended",(function(){j(s,t,a,!0)})))}(e,c,null==r||null===(l=r.video)||void 0===l||null===(u=l.gist)||void 0===u?void 0:u.id)}})),d.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];d.trigger("subtitlechanged",t)})),d.on("subtitlechanged",(function(e,t){var i,n,o,r,l,a,s,d,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(i=window)||void 0===i||null===(n=i.cast)||void 0===n||null===(o=n.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(d=s.framework)||void 0===d||null===(u=d.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===m){var w,p=f.getMediaSession(),h=p.media.tracks.filter((function(e){return"TEXT"==e.type}));w=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),p.editTracksInfo(w)}})),d.on("loadedmetadata",(function(){window.endFirstFrame(d)})),d.one("error",(function(){var t,n;o.handleError(e,(null==d||null===(t=d.error())||void 0===t?void 0:t.message)||"Some error occured"),i.reject({status:!1,msg:(null==d||null===(n=d.error())||void 0===n?void 0:n.message)||"Some error occured"})})),d.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var i,n,r,l=null===(i=o.getCurrentVideo())||void 0===i||null===(n=i.video)||void 0===n||null===(r=n.gist)||void 0===r?void 0:r.id,a=o.getSeriesWatchMap().get(l)||{t:0,p:0},s=a.t,u=a.p;s&&u<95&&setTimeout((function(){d.currentTime(s)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){d.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),d.on("volumechange",(function(){var e=100*d.volume().toFixed(2);d.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}))},x=function(e,t){var i=null==t?void 0:t.skin;"live"==i?Promise.resolve().then((function(){return require("./skin-a2d1f400.js")})).then((function(i){i.initialiseSkin(e,t)})):"default"==i?Promise.resolve().then((function(){return require("./skin-f7bc6ad6.js")})).then((function(i){i.initialiseSkin(e,t)})):"carousel"==i?Promise.resolve().then((function(){return require("./skin-04e830af.js")})).then((function(t){t.initaliseSkin(e)})):"defaultV2"==i?Promise.resolve().then((function(){return require("./skin-9b48aa25.js")})).then((function(i){i.initialiseSkin(e,t)})):"multiplayer"==i&&Promise.resolve().then((function(){return require("./skin-9f831f6f.js")})).then((function(i){i.initialiseSkin(e,t)}))},B=function(e){return new Promise((function(t,i){if(M(e))i("".concat(e," is alread initialised"));else{var n=document.createElement("script");n.async=!1,n.src=e,n.onload=function(){t()},n.onerror=function(t){i("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(n)}}))},M=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},_=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var H,V=function(){var e=t(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=function(){var e=t(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),q=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){B("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(r)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(r)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),B("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:V,loadEMELibrary:N});function L(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function W(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?L(Object(n),!0).forEach((function(i){e(t,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var U=function(n,l,a,s){var d,u,c,v,m,f,w,p,h,g,y,b,k,I,O,E,S,j,D,C,A,R,B,M,H,q,L,U,z,G,J,K,Q,Y=l.res,X=void 0===Y?null:Y,Z=l.sres,$=void 0===Z?null:Z,ee=(null===(d=window)||void 0===d||null===(u=d.cast)||void 0===u||null===(c=u.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(m=v.getInstance())||void 0===m?void 0:m.S)||void 0,te=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==ee&&"NOT_CONNECTED"!==ee?["html5","chromecast"]:["chromecast","html5"]:["html5"],ie=(null===(f=X)||void 0===f?void 0:f.contentType)||"video",ne=o.impolicy16x9(null===(w=X)||void 0===w||null===(p=w[ie])||void 0===p||null===(h=p.gist)||void 0===h?void 0:h.videoImageUrl)||o.impolicy16x9(null===(g=X)||void 0===g||null===(y=g[ie])||void 0===y||null===(b=y.gist)||void 0===b||null===(k=b.imageGist)||void 0===k?void 0:k.r16x9),oe=(null===(I=X)||void 0===I||null===(O=I[ie])||void 0===O||null===(E=O.liveDetails)||void 0===E?void 0:E.isDvrEnabled)||!1,re=(null===(S=X)||void 0===S||null===(j=S[ie])||void 0===j||null===(D=j.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!1,le=(null==a?void 0:a.drmLibrary)||!1,ae=(null===(C=X)||void 0===C||null===(A=C.ads)||void 0===A||null===(R=A.preRoll)||void 0===R||null===(B=R.adTags)||void 0===B||null===(M=B.web)||void 0===M?void 0:M.active)&&(null===(H=X)||void 0===H||null===(q=H.ads)||void 0===q||null===(L=q.preRoll)||void 0===L||null===(U=L.adTags)||void 0===U||null===(z=U.web)||void 0===z?void 0:z.url);X=W(W({},X),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var se=(Q={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:("default"==a.skin||"defaultV2"==a.skin||"live"==(null==a?void 0:a.skin))&&{inline:!1},fullscreenToggle:"default"==a.skin||"defaultV2"==a.skin,audioTrackButton:!1,pictureInPictureToggle:(a.skin,!1)},muteToggle:"multiplayer"==a.skin,liveui:oe},e(Q,"autoplay",null==a?void 0:a.autoplay),e(Q,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!ae),e(Q,"loop",(null==a?void 0:a.loop)||!1),e(Q,"audioPosterMode",null==a?void 0:a.audioPosterMode),e(Q,"html5",W(W({dash:W(W({},!r.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}}),vhs:W(W({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(G=a.customData)||void 0===G?void 0:G.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(J=a.customData)||void 0===J?void 0:J.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(K=a.customData)||void 0===K?void 0:K.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(Q,"poster",ne),e(Q,"techOrder",te),e(Q,"chromecast",{requestCustomDataFn:function(e){var t=o.getPlayer(n),i=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,t,i){var n,o,r,l,a,s,d,u,c,v,m=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[m]&&null!=e&&e[m].drmEnabled){f.isDrmEnabled=!0;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;f.licenseUrl=w;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];f.licenseToken=p}var h=(null==e||null===(n=e[m])||void 0===n||null===(o=n.gist)||void 0===o?void 0:o.contentType)||"VIDEO";f.contentType=h;var g=null==e||null===(r=e[m])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=g;var y=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=y;var b=null==e||null===(d=e[m])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return f.mediaImage=b,f.subTitles=i,f.DVR=(null==e||null===(c=e[m])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(X,e,i)}}),Q),de=r(n,se,function(){var e=t(i.mark((function e(){var t,l,d,u,c,v,m,f,w,p,h,g,y,b,k,I,O,E,S,j,D,C,A,R;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(T(a),re&&s.resolve(W({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:X}:{response:X})),window.initialise(de),window.firstFrame(de),"white"!==window.controlsColor&&_(window.controlsColor,de),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),b=null===(t=X)||void 0===t||null===(l=t[ie])||void 0===l?void 0:l.drmEnabled,k=null===(d=X)||void 0===d||null===(u=d[ie])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!b&&!le){e.next=21;break}if("Safari"!==o.detectBrowser()){e.next=14;break}return e.next=12,N();case 12:e.next=21;break;case 14:if("caliente"!=(null===(I=window)||void 0===I?void 0:I.siteName)){e.next=19;break}return e.next=17,N();case 17:e.next=21;break;case 19:return e.next=21,V();case 21:oe&&P(n,k),!ae||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(n,ae,X),(O=o.getSource(X,n))?o.loadVideo(n,O):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:X}),o.handleError(n,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=X)||void 0===m||null===(f=m[ie])||void 0===f||null===(w=f.contentDetails)||void 0===w||null===(p=w.closedCaptions)||void 0===p?void 0:p.length)>0||(null===(h=X)||void 0===h||null===(g=h[ie])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(R=(null===(S=X)||void 0===S||null===(j=S[ie])||void 0===j||null===(D=j.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(C=X)||void 0===C||null===(A=C[ie])||void 0===A?void 0:A.closedCaptions),E=R.filter((function(e){return"VTT"===e.format})),o.addCaptions(n,E)),null!=a&&a.disableControls?o.disableControls(n):x(n,W(W(W({},a),se),{},{liveVideo:re,isDvrEnabled:oe,res:X,sres:$})),F(n,W(W(W({},a),se),{},{liveVideo:re}),s,{res:X,sres:$});case 28:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:o.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(e){return new Promise((function(t,i){var n,r,l,a,s,c,v,m,f,w,p;if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){var h=(null==e||null===(n=e.epg)||void 0===n?void 0:n.enable)||!1,g=null==e?void 0:e.videoId,y=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1;window.videoId=g;var b=null==e?void 0:e.token;if(o.refreshTokenManager().set(null==e?void 0:e.refreshToken),b&&!o.isTokenExpired(b)){H=JSON.parse(atob(b.split(".")[1])),window.siteId=null===(l=H)||void 0===l?void 0:l.siteId,window.siteName=null===(a=H)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=H)||void 0===s||!s.anonymousId),e.siteOwner=(null===(c=H)||void 0===c?void 0:c.site)||null,e.userId=(null===(v=H)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(m=H)||void 0===m?void 0:m.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",b);var T=null==e?void 0:e.playerId,P=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,k=null==e?void 0:e.airplay,I=null==e?void 0:e.apiBaseUrl,O=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,E=null==e?void 0:e.errors;E&&(window.customErrors=E),window.customData=null==e?void 0:e.customData,d.setLocalisation(null==e||null===(w=e.customData)||void 0===w?void 0:w.localisation),I&&(window.playerEntitlementUrl=I),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!o.isNotAValidSkin(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return q})).then((function(e){e.importIMA()})),!P||null!=e&&e.series||Promise.resolve().then((function(){return q})).then((function(e){e.importChromecast()})),k&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return q})).then((function(e){e.importAirplay()})),O&&B("https://www.googletagmanager.com/gtag/js?id=".concat(O)).then((function(){return e=O,window.dataLayer=window.dataLayer||[],u("js",new Date),void u("config",e);var e})).catch((function(e){}));var S=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(T));if(S&&S.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y){var j,D=null==e||null===(j=e.series)||void 0===j?void 0:j.id;o.getSeriesDetails(D,b).then((function(n){var r,l,a,s=n.data,d=n.data.seasons;o.setCurrentSeries(d);var u=g||(null==d||null===(r=d[0])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);!function(e,t){var i=new Map;o.getSeriesWatchHistory({videoId:e,token:t}).then((function(e){e.data.map((function(e){i.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),o.setSeriesWatchMap(i)})).catch((function(e){return console.log(e)}))}(D,b),o.getVideoDetails(u,b).then((function(n){var r,l,a;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(n.data),U(T,{res:null==n?void 0:n.data,sres:s},e,{resolve:t,reject:i})})).catch((function(e){o.initiateErrorHandling(e,T,i,g)}))})).catch((function(e){o.initiateErrorHandling(e,T,i)}))}else if(h){var C=null==e?void 0:e.epg;o.getLinearChannelDetails(C,b).then((function(n){var o=null==n?void 0:n.data;o.contentType="linearchannel",U(T,{res:o},e,{resolve:t,reject:i})})).catch((function(e){o.initiateErrorHandling(e,T,i,g)}))}else o.getVideoDetails(g,b).then((function(n){var r,l,a,s;window.contentType=null==n||null===(r=n.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(null==n?void 0:n.data);var d=null==n?void 0:n.data;null!=e&&e.watchHistory&&null!=e&&null!==(s=e.watchHistory)&&void 0!==s&&s.enable?o.getVideoInfo(g,b).then((function(n){var o,r,l,a,s,u;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==n?void 0:n.data)),e.watchHistoryResumeTime=(null==n||null===(s=n.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==n||null===(u=n.data)||void 0===u?void 0:u.watchedPercentage)||null,d.contentType="video",U(T,{res:d},e,{resolve:t,reject:i})})).catch((function(n){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(n)),U(T,{res:d},e,{resolve:t,reject:i})})):U(T,{res:d},e,{resolve:t,reject:i})})).catch((function(e){o.initiateErrorHandling(e,T,i,g)}))}else i({status:!1,msg:"".concat(b?"Token is expired !":"Missing Authorization Token"),response:{token:b}})}}))},getRenditions:a.getRenditions,skip:o.skip,getPlayer:o.getPlayer,play:o.play,pause:o.pause,detectBrowser:o.detectBrowser,rewind:o.rewind,loadVideo:o.loadVideo,seekToTimeStamp:l.seekToTimeStamp,isPlayerInitialised:o.isPlayerInitialised,load:o.load,dispose:o.dispose,enableCaptions:o.enableCaptions,disableCaptions:o.disableCaptions,getCaptions:o.getCaptions,playSelectedResolution:s.playSelectedResolution,getSource:o.getSource,setVolume:D,getVolume:C,disableControls:o.disableControls,setPlaybackSpeed:l.setPlaybackSpeed}};
1
+ "use strict";require("video.js/dist/video-js.min.css");var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),n=require("@babel/runtime/regenerator"),i=require("axios"),o=require("./generic-e42efcd8.js"),r=require("video.js"),l=require("./util-d4c56a2d.js"),a=require("./renditions-b85edb07.js"),s=require("./resolution-08d6bb23.js"),d=require("./localisation-56e0a999.js");function u(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function c(e,t){u("event",e,t)}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function m(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?v(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}require("js-cookie"),require("ua-parser-js"),require("@babel/runtime/helpers/toConsumableArray"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf");function f(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function w(){var e=window.sessionStorage.getItem("uid");return e||(e=f(),window.sessionStorage.setItem("uid",e),e)}function p(){return h.apply(this,arguments)}function h(){return h=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.getToken();case 2:if(t=e.sent,null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=8;break}return e.abrupt("return","guest-user");case 8:return e.abrupt("return",null==i?void 0:i.userId);case 9:case"end":return e.stop()}}),e)}))),h.apply(this,arguments)}window.initialise=function(e){window.sid=f(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());c(r?"FAILED_TO_START":"DROPPED_STREAM",m({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,n,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),c("PLAY",m({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))c("BUFFERING",m({pfm:window.platform,uid:w(),vid:window.videoId,videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,c("FIRST_FRAME",m({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),vid:window.videoId},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,n,i,o,r,l;c("AD_REQUEST",m({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),vid:window.videoId,resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),c("AD_IMPRESSION",m({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:w(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:window.videoId},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(g(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var g=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark((function e(t){var r,l,a,s,d,u,c,v,f,h,g;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=m,e.t1=m,e.t2=m({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=w(),e.t5=window.videoId,e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=20,p();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),h=[e.t31],e.next=37,o.getToken();case 37:g=e.sent,i({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(f=v.beacon)||void 0===f?void 0:f.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:g},contentType:"application/x-www-form-urlencoded",dataType:"text",data:h}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var y,b,T=function(e){return new Promise((function(t,n){if(k(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},k=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},P=function(){var e=t(n.mark((function e(t){var i,l,a;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=o.getPlayer(null==t?void 0:t.playerId),null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable||null==t||!t.chromecastReceiverId){e.next=12;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return a=e.sent,e.next=7,T("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 7:a.default(r),window.__onGCastApiAvailable=function(){null==l||l.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=13;break;case 12:console.log("Chromecast plugin is not available");case 13:null!=t&&t.airplay&&"Safari"==o.detectBrowser()?null==l||l.airPlay({addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),I=function(e,t){var n=o.getPlayer(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,o,l,a,s=this.el(),d=r.dom.getPointerPosition(s,t).x;r.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var u=window.cast&&window.cast.framework&&window.cast.framework.CastSession,c=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(l=o.CastContext)||void 0===l||null===(a=l.getInstance())||void 0===a?void 0:a.S;if(console.log(u),u&&"CONNECTED"===c){window.cast.framework.RemotePlayer.canSeek=!0;var v=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),m=v.h.media[0].liveSeekableRange.end;v.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=m*d,v.seek()}}))};function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function S(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?O(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):O(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var E=[],j=0,D=null;function C(e,t,n){var i,r,l,a,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];b=(null==t||null===(i=t.watchHistory)||void 0===i?void 0:i.apiVersion)||"v1";var d=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.profileId,u=Math.floor(e.currentTime()),c=Math.floor(e.duration()),v=null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.xapiKey,m=(null==t||null===(a=t.video)||void 0===a?void 0:a.originalObjectId)||null,f={};"v1"==b?f={videoId:y,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==b&&(f=S(S({videoId:y,watchedTime:Math.floor(e.currentTime()),watchedPercentage:s?100:Math.floor(u/c*100),doneWatching:s,profileId:d},D&&{seriesId:D}),m&&{originalObjectId:m})),o.saveWatchHistory(f,b).then((function(e){})).catch((function(e){})),j=u+n}var R=function(e,t,n){var i=o.getPlayer(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var r=parseFloat(t)/100;i.volume(r),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},A=function(e){var t=o.getPlayer(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function x(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?F(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):F(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var B=function(e,t,n,i){var r,l,a=i.res,s=i.sres,d=o.getPlayer(e),u=(null==a?void 0:a.contentType)||"video",c=(null==a||null===(r=a[u])||void 0===r||null===(l=r.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;o.setCurrentVideo(a),d.on("loadstart",(function(){c&&n.resolve({status:!0,msg:"Video Loaded",response:a})})),d.on("loadeddata",(function(){var i;(null==d||!d.muted())&&R(e,sessionStorage.getItem("volume")||"100");var r=o.getCurrentVideo();if(o.clearError(),n.resolve(x({status:!0,msg:"Player Initialised"},s?{seriesResponse:s,response:a}:{response:a})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&!t.isAnonymousUser){var l,u,c=x(x({},t),a);!function(e,t,n){var i,r,l;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(D=null==t||null===(r=t.series)||void 0===r?void 0:r.id),E=[],j=0,y=n;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,s=o.getPlayer(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());E.includes(j)||(e==j?(E.push(e),C(s,t,a)):e>j&&(j=e+a))})),s.one("ended",(function(){C(s,t,a,!0)})))}(e,c,null==r||null===(l=r.video)||void 0===l||null===(u=l.gist)||void 0===u?void 0:u.id)}})),d.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];d.trigger("subtitlechanged",t)})),d.on("subtitlechanged",(function(e,t){var n,i,o,r,l,a,s,d,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(d=s.framework)||void 0===d||null===(u=d.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===m){var w,p=f.getMediaSession(),h=p.media.tracks.filter((function(e){return"TEXT"==e.type}));w=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),p.editTracksInfo(w)}})),d.on("loadedmetadata",(function(){window.endFirstFrame(d)})),d.one("error",(function(){var t,i;o.handleError(e,(null==d||null===(t=d.error())||void 0===t?void 0:t.message)||"Some error occured"),n.reject({status:!1,msg:(null==d||null===(i=d.error())||void 0===i?void 0:i.message)||"Some error occured"})})),d.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,r,l=null===(n=o.getCurrentVideo())||void 0===n||null===(i=n.video)||void 0===i||null===(r=i.gist)||void 0===r?void 0:r.id,a=o.getSeriesWatchMap().get(l)||{t:0,p:0},s=a.t,u=a.p;s&&u<95&&setTimeout((function(){d.currentTime(s)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){d.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),d.on("volumechange",(function(){var e=100*d.volume().toFixed(2);d.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),d.on("chromecastDisconnected",(function(){if(c){console.log('chromecast-disconnected,"2"',c),console.log("resetting source",d.currentType(),d.currentSource());for(var e=d.currentSource(),t=d.textTracks(),n=t.length-1;n>=0;n--)d.removeRemoteTextTrack(t[n]);d.src(e)}}))},M=function(e,t){var n=null==t?void 0:t.skin;"live"==n?Promise.resolve().then((function(){return require("./skin-a2d1f400.js")})).then((function(n){n.initialiseSkin(e,t)})):"default"==n?Promise.resolve().then((function(){return require("./skin-f7bc6ad6.js")})).then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?Promise.resolve().then((function(){return require("./skin-04e830af.js")})).then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?Promise.resolve().then((function(){return require("./skin-9b48aa25.js")})).then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n&&Promise.resolve().then((function(){return require("./skin-9f831f6f.js")})).then((function(n){n.initialiseSkin(e,t)}))},H=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var _,V=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),q=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){T("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(r)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(r)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),T("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:V,loadEMELibrary:N});function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function W(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?L(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var U=function(i,l,a,s){var d,u,c,v,m,f,w,p,h,g,y,b,T,k,O,S,E,j,D,C,R,A,F,x,_,q,L,U,z,G,J,K,Q,Y=l.res,X=void 0===Y?null:Y,Z=l.sres,$=void 0===Z?null:Z;null===(d=window)||void 0===d||null===(u=d.cast)||void 0===u||null===(c=u.framework)||void 0===c||null===(v=c.CastContext)||void 0===v||null===(m=v.getInstance())||void 0===m||m.S;var ee=null!=a&&a.chromecastReceiverId?["chromecast","html5"]:["html5"],te=(null===(f=X)||void 0===f?void 0:f.contentType)||"video",ne=o.impolicy16x9(null===(w=X)||void 0===w||null===(p=w[te])||void 0===p||null===(h=p.gist)||void 0===h?void 0:h.videoImageUrl)||o.impolicy16x9(null===(g=X)||void 0===g||null===(y=g[te])||void 0===y||null===(b=y.gist)||void 0===b||null===(T=b.imageGist)||void 0===T?void 0:T.r16x9),ie=(null===(k=X)||void 0===k||null===(O=k[te])||void 0===O||null===(S=O.liveDetails)||void 0===S?void 0:S.isDvrEnabled)||!1,oe=(null===(E=X)||void 0===E||null===(j=E[te])||void 0===j||null===(D=j.streamingInfo)||void 0===D?void 0:D.isLiveStream)||!1,re=(null==a?void 0:a.drmLibrary)||!1,le=(null===(C=X)||void 0===C||null===(R=C.ads)||void 0===R||null===(A=R.preRoll)||void 0===A||null===(F=A.adTags)||void 0===F||null===(x=F.web)||void 0===x?void 0:x.active)&&(null===(_=X)||void 0===_||null===(q=_.ads)||void 0===q||null===(L=q.preRoll)||void 0===L||null===(U=L.adTags)||void 0===U||null===(z=U.web)||void 0===z?void 0:z.url);X=W(W({},X),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var ae=(Q={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:("default"==a.skin||"defaultV2"==a.skin||"live"==(null==a?void 0:a.skin))&&{inline:!1},fullscreenToggle:"default"==a.skin||"defaultV2"==a.skin,audioTrackButton:!1,pictureInPictureToggle:(a.skin,!1)},muteToggle:"multiplayer"==a.skin,liveui:ie},e(Q,"autoplay",null==a?void 0:a.autoplay),e(Q,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!le),e(Q,"loop",(null==a?void 0:a.loop)||!1),e(Q,"audioPosterMode",null==a?void 0:a.audioPosterMode),e(Q,"html5",W(W({dash:W(W({},!r.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}}),vhs:W(W({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(G=a.customData)||void 0===G?void 0:G.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(J=a.customData)||void 0===J?void 0:J.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(K=a.customData)||void 0===K?void 0:K.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(Q,"poster",ne),e(Q,"techOrder",ee),e(Q,"chromecast",{requestCustomDataFn:function(e){var t=o.getPlayer(i),n=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,t,n){var i,o,r,l,a,s,d,u,c,v,m=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[m]&&null!=e&&e[m].drmEnabled){f.isDrmEnabled=!0;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;f.licenseUrl=w;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];f.licenseToken=p}var h=(null==e||null===(i=e[m])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";f.contentType=h;var g=null==e||null===(r=e[m])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=g;var y=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=y;var b=null==e||null===(d=e[m])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return f.mediaImage=b,f.subTitles=n,f.DVR=(null==e||null===(c=e[m])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(X,e,n)}}),Q),se=r(i,ae,function(){var e=t(n.mark((function e(){var t,l,d,u,c,v,m,f,w,p,h,g,y,b,T,k,O,S,E,j,D,C,R,A;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,P(a);case 2:if(oe&&s.resolve(W({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:X}:{response:X})),window.initialise(se),window.firstFrame(se),"white"!==window.controlsColor&&H(window.controlsColor,se),/Android/i.test(navigator.userAgent)&&(r.options.vhs.overrideNative=!0),b=null===(t=X)||void 0===t||null===(l=t[te])||void 0===l?void 0:l.drmEnabled,T=null===(d=X)||void 0===d||null===(u=d[te])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!b&&!re){e.next=22;break}if("Safari"!==o.detectBrowser()){e.next=15;break}return e.next=13,N();case 13:e.next=22;break;case 15:if("caliente"!=(null===(k=window)||void 0===k?void 0:k.siteName)){e.next=20;break}return e.next=18,N();case 18:e.next=22;break;case 20:return e.next=22,V();case 22:ie&&I(i,T),!le||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||o.initialiseAdvertisement(i,le,X),(O=o.getSource(X,i))?o.loadVideo(i,O):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:X}),o.handleError(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=X)||void 0===m||null===(f=m[te])||void 0===f||null===(w=f.contentDetails)||void 0===w||null===(p=w.closedCaptions)||void 0===p?void 0:p.length)>0||(null===(h=X)||void 0===h||null===(g=h[te])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(A=(null===(E=X)||void 0===E||null===(j=E[te])||void 0===j||null===(D=j.contentDetails)||void 0===D?void 0:D.closedCaptions)||(null===(C=X)||void 0===C||null===(R=C[te])||void 0===R?void 0:R.closedCaptions),S=A.filter((function(e){return"VTT"===e.format})),o.addCaptions(i,S)),null!=a&&a.disableControls?o.disableControls(i):M(i,W(W(W({},a),ae),{},{liveVideo:oe,isDvrEnabled:ie,res:X,sres:$})),B(i,W(W(W({},a),ae),{},{liveVideo:oe}),s,{res:X,sres:$});case 29:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};module.exports=function(){return{loadVideoInstantly:o.loadVideoInstantly,onTimeUpdate:l.onTimeUpdate,getVideoDuration:l.getVideoDuration,onVideoEnded:l.onVideoEnded,init:function(e){return new Promise((function(t,n){var i,r,l,a,s,c,v,m,f,w,p;if(!o.isPlayerInitialised(null==e?void 0:e.playerId)){var h=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,g=null==e?void 0:e.videoId,y=(null==e||null===(r=e.series)||void 0===r?void 0:r.enable)||!1;window.videoId=g;var b=null==e?void 0:e.token;if(o.refreshTokenManager().set(null==e?void 0:e.refreshToken),b&&!o.isTokenExpired(b)){_=JSON.parse(atob(b.split(".")[1])),window.siteId=null===(l=_)||void 0===l?void 0:l.siteId,window.siteName=null===(a=_)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=_)||void 0===s||!s.anonymousId),e.siteOwner=(null===(c=_)||void 0===c?void 0:c.site)||null,e.userId=(null===(v=_)||void 0===v?void 0:v.userId)||null,window.sessionStorage.setItem("uid",null===(m=_)||void 0===m?void 0:m.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",b);var k=null==e?void 0:e.playerId;e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId;var P=null==e?void 0:e.airplay,I=null==e?void 0:e.apiBaseUrl,O=(null==e||null===(f=e.analytics)||void 0===f?void 0:f.gaId)||null,S=null==e?void 0:e.errors;S&&(window.customErrors=S),window.customData=null==e?void 0:e.customData,d.setLocalisation(null==e||null===(w=e.customData)||void 0===w?void 0:w.localisation),I&&(window.playerEntitlementUrl=I),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!o.isNotAValidSkin(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return q})).then((function(e){e.importIMA()})),P&&"Safari"==o.detectBrowser()&&Promise.resolve().then((function(){return q})).then((function(e){e.importAirplay()})),O&&T("https://www.googletagmanager.com/gtag/js?id=".concat(O)).then((function(){return e=O,window.dataLayer=window.dataLayer||[],u("js",new Date),void u("config",e);var e})).catch((function(e){}));var E=null===(p=document)||void 0===p?void 0:p.getElementById("".concat(k));if(E&&E.addEventListener("contextmenu",(function(e){return e.preventDefault()})),y){var j,D=null==e||null===(j=e.series)||void 0===j?void 0:j.id;o.getSeriesDetails(D,b).then((function(i){var r,l,a,s=i.data,d=i.data.seasons;o.setCurrentSeries(d);var u=g||(null==d||null===(r=d[0])||void 0===r||null===(l=r.episodes)||void 0===l||null===(a=l[0])||void 0===a?void 0:a.id);!function(e,t){var n=new Map;o.getSeriesWatchHistory({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),o.setSeriesWatchMap(n)})).catch((function(e){return console.log(e)}))}(D,b),o.getVideoDetails(u,b).then((function(i){var r,l,a;window.contentType=null==i||null===(r=i.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(i.data),U(k,{res:null==i?void 0:i.data,sres:s},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,k,n,g)}))})).catch((function(e){o.initiateErrorHandling(e,k,n)}))}else if(h){var C=null==e?void 0:e.epg;o.getLinearChannelDetails(C,b).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",U(k,{res:o},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,k,n,g)}))}else o.getVideoDetails(g,b).then((function(i){var r,l,a,s;window.contentType=null==i||null===(r=i.data)||void 0===r||null===(l=r.video)||void 0===l||null===(a=l.gist)||void 0===a?void 0:a.contentType,o.setCurrentVideo(null==i?void 0:i.data);var d=null==i?void 0:i.data;null!=e&&e.watchHistory&&null!=e&&null!==(s=e.watchHistory)&&void 0!==s&&s.enable?o.getVideoInfo(g,b).then((function(i){var o,r,l,a,s,u;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==i?void 0:i.data)),e.watchHistoryResumeTime=(null==i||null===(s=i.data)||void 0===s?void 0:s.watchedTime)||null,e.watchedPercentage=(null==i||null===(u=i.data)||void 0===u?void 0:u.watchedPercentage)||null,d.contentType="video",U(k,{res:d},e,{resolve:t,reject:n})})).catch((function(i){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(i)),U(k,{res:d},e,{resolve:t,reject:n})})):U(k,{res:d},e,{resolve:t,reject:n})})).catch((function(e){o.initiateErrorHandling(e,k,n,g)}))}else n({status:!1,msg:"".concat(b?"Token is expired !":"Missing Authorization Token"),response:{token:b}})}}))},getRenditions:a.getRenditions,skip:o.skip,getPlayer:o.getPlayer,play:o.play,pause:o.pause,detectBrowser:o.detectBrowser,rewind:o.rewind,loadVideo:o.loadVideo,seekToTimeStamp:l.seekToTimeStamp,isPlayerInitialised:o.isPlayerInitialised,load:o.load,dispose:o.dispose,enableCaptions:o.enableCaptions,disableCaptions:o.disableCaptions,getCaptions:o.getCaptions,playSelectedResolution:s.playSelectedResolution,getSource:o.getSource,setVolume:R,getVolume:A,disableControls:o.disableControls,setPlaybackSpeed:l.setPlaybackSpeed}};
package/esm/bundle.css CHANGED
@@ -184,6 +184,143 @@ button.vjs-big-play-button {
184
184
  }
185
185
  }
186
186
 
187
+ /* Chromecast */
188
+ .video-js .vjs-chromecast-button .vjs-icon-placeholder {
189
+ background: url('https://player.viewlift.com/images/ic_cast_white_24dp.png') center center no-repeat;
190
+ background-size: contain;
191
+ display: inline-block;
192
+ width: 16px;
193
+ height: 16px;
194
+ }
195
+
196
+ .video-js .vjs-chromecast-button:hover {
197
+ cursor: pointer;
198
+ }
199
+
200
+ .video-js .vjs-chromecast-button:hover .vjs-icon-placeholder {
201
+ background-image: url('https://player.viewlift.com/images/ic_cast_white_24dp.png');
202
+ }
203
+
204
+ .video-js .vjs-chromecast-button.vjs-chromecast-casting-state .vjs-icon-placeholder {
205
+ background-image: url('https://player.viewlift.com/images/ic_cast_connected_white_24dp.png');
206
+ }
207
+
208
+ .video-js .vjs-chromecast-button.vjs-chromecast-casting-state:hover .vjs-icon-placeholder {
209
+ background-image: url('https://player.viewlift.com/images/ic_cast_connected_white_24dp.png');
210
+ }
211
+ .video-js .vjs-chromecast-button >.vjs-chromecast-button-label{
212
+ display: none !important;
213
+ }
214
+
215
+ .video-js .vjs-tech-chromecast {
216
+ display: flex;
217
+ flex-direction: column;
218
+ justify-content: center;
219
+ align-items: center;
220
+ overflow: hidden;
221
+ }
222
+
223
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster::after {
224
+ content: ' ';
225
+ display: block;
226
+ height: 2px;
227
+ width: 100px;
228
+ background-color: #cccccc;
229
+ position: absolute;
230
+ left: calc(50% - 50px);
231
+ }
232
+
233
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster-img {
234
+ max-height: 180px;
235
+ width: auto;
236
+ border: 2px solid #cccccc;
237
+ }
238
+
239
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster-img.vjs-tech-chromecast-poster-img-empty {
240
+ width: 160px;
241
+ height: 90px;
242
+ }
243
+
244
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title-container {
245
+ position: absolute;
246
+ bottom: 50%;
247
+ margin-bottom: 100px;
248
+ color: #cccccc;
249
+ text-align: center;
250
+ }
251
+
252
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title {
253
+ font-size: 22px;
254
+ }
255
+
256
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title.vjs-tech-chromecast-title-empty {
257
+ display: none;
258
+ }
259
+
260
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-subtitle {
261
+ font-size: 18px;
262
+ padding-top: 0.5em;
263
+ }
264
+
265
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-subtitle.vjs-tech-chromecast-subtitle-empty {
266
+ display: none;
267
+ }
268
+
269
+ .video-js .vjs-tech-chromecast {
270
+ display: flex;
271
+ flex-direction: column;
272
+ justify-content: center;
273
+ align-items: center;
274
+ overflow: hidden;
275
+ }
276
+
277
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster::after {
278
+ content: ' ';
279
+ display: block;
280
+ height: 2px;
281
+ width: 100px;
282
+ background-color: #ccc;
283
+ position: absolute;
284
+ left: calc(50% - 50px);
285
+ }
286
+
287
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster-img {
288
+ max-height: 180px;
289
+ width: auto;
290
+ border: 2px solid #ccc;
291
+ }
292
+
293
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster-img.vjs-tech-chromecast-poster-img-empty {
294
+ width: 160px;
295
+ height: 90px;
296
+ }
297
+
298
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title-container {
299
+ position: absolute;
300
+ bottom: 50%;
301
+ margin-bottom: 100px;
302
+ color: #ccc;
303
+ text-align: center;
304
+ }
305
+
306
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title {
307
+ font-size: 22px;
308
+ }
309
+
310
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title.vjs-tech-chromecast-title-empty {
311
+ display: none;
312
+ }
313
+
314
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-subtitle {
315
+ font-size: 18px;
316
+ padding-top: 0.5em;
317
+ }
318
+
319
+ .video-js .vjs-tech-chromecast .vjs-tech-chromecast-subtitle.vjs-tech-chromecast-subtitle-empty {
320
+ display: none;
321
+ }
322
+
323
+ /* Chromecast End */
187
324
 
188
325
  /* ADs */
189
326
  .ima-ad-container {
@@ -500,143 +637,6 @@ button.vjs-big-play-button {
500
637
  }
501
638
 
502
639
  /* Resolution Module End */
503
- /* Chromecast */
504
- .video-js .vjs-chromecast-button .vjs-icon-placeholder {
505
- background: url('https://player.viewlift.com/images/ic_cast_white_24dp.png') center center no-repeat;
506
- background-size: contain;
507
- display: inline-block;
508
- width: 16px;
509
- height: 16px;
510
- }
511
-
512
- .video-js .vjs-chromecast-button:hover {
513
- cursor: pointer;
514
- }
515
-
516
- .video-js .vjs-chromecast-button:hover .vjs-icon-placeholder {
517
- background-image: url('https://player.viewlift.com/images/ic_cast_white_24dp.png');
518
- }
519
-
520
- .video-js .vjs-chromecast-button.vjs-chromecast-casting-state .vjs-icon-placeholder {
521
- background-image: url('https://player.viewlift.com/images/ic_cast_connected_white_24dp.png');
522
- }
523
-
524
- .video-js .vjs-chromecast-button.vjs-chromecast-casting-state:hover .vjs-icon-placeholder {
525
- background-image: url('https://player.viewlift.com/images/ic_cast_connected_white_24dp.png');
526
- }
527
- .video-js .vjs-chromecast-button >.vjs-chromecast-button-label{
528
- display: none !important;
529
- }
530
-
531
- .video-js .vjs-tech-chromecast {
532
- display: flex;
533
- flex-direction: column;
534
- justify-content: center;
535
- align-items: center;
536
- overflow: hidden;
537
- }
538
-
539
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster::after {
540
- content: ' ';
541
- display: block;
542
- height: 2px;
543
- width: 100px;
544
- background-color: #cccccc;
545
- position: absolute;
546
- left: calc(50% - 50px);
547
- }
548
-
549
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster-img {
550
- max-height: 180px;
551
- width: auto;
552
- border: 2px solid #cccccc;
553
- }
554
-
555
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster-img.vjs-tech-chromecast-poster-img-empty {
556
- width: 160px;
557
- height: 90px;
558
- }
559
-
560
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title-container {
561
- position: absolute;
562
- bottom: 50%;
563
- margin-bottom: 100px;
564
- color: #cccccc;
565
- text-align: center;
566
- }
567
-
568
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title {
569
- font-size: 22px;
570
- }
571
-
572
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title.vjs-tech-chromecast-title-empty {
573
- display: none;
574
- }
575
-
576
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-subtitle {
577
- font-size: 18px;
578
- padding-top: 0.5em;
579
- }
580
-
581
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-subtitle.vjs-tech-chromecast-subtitle-empty {
582
- display: none;
583
- }
584
-
585
- .video-js .vjs-tech-chromecast {
586
- display: flex;
587
- flex-direction: column;
588
- justify-content: center;
589
- align-items: center;
590
- overflow: hidden;
591
- }
592
-
593
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster::after {
594
- content: ' ';
595
- display: block;
596
- height: 2px;
597
- width: 100px;
598
- background-color: #ccc;
599
- position: absolute;
600
- left: calc(50% - 50px);
601
- }
602
-
603
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster-img {
604
- max-height: 180px;
605
- width: auto;
606
- border: 2px solid #ccc;
607
- }
608
-
609
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-poster-img.vjs-tech-chromecast-poster-img-empty {
610
- width: 160px;
611
- height: 90px;
612
- }
613
-
614
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title-container {
615
- position: absolute;
616
- bottom: 50%;
617
- margin-bottom: 100px;
618
- color: #ccc;
619
- text-align: center;
620
- }
621
-
622
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title {
623
- font-size: 22px;
624
- }
625
-
626
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-title.vjs-tech-chromecast-title-empty {
627
- display: none;
628
- }
629
-
630
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-subtitle {
631
- font-size: 18px;
632
- padding-top: 0.5em;
633
- }
634
-
635
- .video-js .vjs-tech-chromecast .vjs-tech-chromecast-subtitle.vjs-tech-chromecast-subtitle-empty {
636
- display: none;
637
- }
638
-
639
- /* Chromecast End */
640
640
  /* Airplay */
641
641
 
642
642
  .video-js .vjs-airplay-button .vjs-icon-placeholder {
package/esm/index.js CHANGED
@@ -1 +1 @@
1
- import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import i from"axios";import{g as o,a as r,d as l,s as a,c as s,h as d,b as u,e as c,f as v,i as m,j as f,l as p,k as w,p as h,m as g,r as y,n as b,o as T,q as I,t as k,u as P,v as O,w as E,x as j,y as S,z as D,A,B as R,C as F,D as C,E as x,F as B,G as M,H as _,I as H,J as N,K as L}from"./generic-7c12a59f.js";import V from"video.js";import{o as U,g as W,a as q,s as z,b as G}from"./util-b0bc7e61.js";import{g as J}from"./renditions-29c48da7.js";import{playSelectedResolution as K}from"./resolution-8bf5df58.js";import{s as Q}from"./localisation-0bf399a1.js";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";function Y(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function X(e,t){Y("event",e,t)}function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function $(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Z(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Z(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function ee(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function te(){var e=window.sessionStorage.getItem("uid");return e||(e=ee(),window.sessionStorage.setItem("uid",e),e)}function ne(){return ie.apply(this,arguments)}function ie(){return ie=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o();case 2:if(t=e.sent,null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=8;break}return e.abrupt("return","guest-user");case 8:return e.abrupt("return",null==i?void 0:i.userId);case 9:case"end":return e.stop()}}),e)}))),ie.apply(this,arguments)}window.initialise=function(e){window.sid=ee(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());X(r?"FAILED_TO_START":"DROPPED_STREAM",$({pfm:window.platform,uid:te(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,n,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),X("PLAY",$({pfm:window.platform,uid:te(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))X("BUFFERING",$({pfm:window.platform,uid:te(),vid:window.videoId,videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,X("FIRST_FRAME",$({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:te(),vid:window.videoId},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,n,i,o,r,l;X("AD_REQUEST",$({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:te(),vid:window.videoId,resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),X("AD_IMPRESSION",$({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:te(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:window.videoId},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(oe(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var oe=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark((function e(t){var r,l,a,s,d,u,c,v,m,f,p;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=$,e.t1=$,e.t2=$({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=te(),e.t5=window.videoId,e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=20,ne();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),f=[e.t31],e.next=37,o();case 37:p=e.sent,i({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(m=v.beacon)||void 0===m?void 0:m.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:p},contentType:"application/x-www-form-urlencoded",dataType:"text",data:f}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var re,le,ae=function(e){var t,n=r(null==e?void 0:e.playerId);null!=e&&null!==(t=e.series)&&void 0!==t&&t.enable||null==e||!e.chromecastReceiverId?console.log("Chromecast plugin is not available"):window.__onGCastApiAvailable=function(){null==n||n.chromecast({receiverAppID:null==e?void 0:e.chromecastReceiverId,addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},null!=e&&e.airplay&&"Safari"==l()?null==n||n.airPlay({addButtonToControlBar:"default"==e.skin||"defaultV2"==e.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available")},se=function(e,t){var n=r(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,o,r,l,a=this.el(),s=V.dom.getPointerPosition(a,t).x;V.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,u=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S;if(console.log(d),d&&"CONNECTED"===u){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}}))};function de(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ue(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?de(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):de(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var ce=[],ve=0,me=null;function fe(e,t,n){var i,o,r,l,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];le=(null==t||null===(i=t.watchHistory)||void 0===i?void 0:i.apiVersion)||"v1";var d=null==t||null===(o=t.watchHistory)||void 0===o?void 0:o.profileId,u=Math.floor(e.currentTime()),c=Math.floor(e.duration()),v=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.xapiKey,m=(null==t||null===(l=t.video)||void 0===l?void 0:l.originalObjectId)||null,f={};"v1"==le?f={videoId:re,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==le&&(f=ue(ue({videoId:re,watchedTime:Math.floor(e.currentTime()),watchedPercentage:s?100:Math.floor(u/c*100),doneWatching:s,profileId:d},me&&{seriesId:me}),m&&{originalObjectId:m})),a(f,le).then((function(e){})).catch((function(e){})),ve=u+n}var pe=function(e,t,n){var i=r(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var o=parseFloat(t)/100;i.volume(o),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},we=function(e){var t=r(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function he(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ge(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?he(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):he(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var ye=function(e,t,n,i){var o,l,a=i.res,m=i.sres,f=r(e),p=(null==a?void 0:a.contentType)||"video",w=(null==a||null===(o=a[p])||void 0===o||null===(l=o.streamingInfo)||void 0===l?void 0:l.isLiveStream)||!1;c(a),f.on("loadstart",(function(){w&&n.resolve({status:!0,msg:"Video Loaded",response:a})})),f.on("loadeddata",(function(){var i;(null==f||!f.muted())&&pe(e,sessionStorage.getItem("volume")||"100");var o=u();if(s(),n.resolve(ge({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:a}:{response:a})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&!t.isAnonymousUser){var l,d,c=ge(ge({},t),a);!function(e,t,n){var i,o,l;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(me=null==t||null===(o=t.series)||void 0===o?void 0:o.id),ce=[],ve=0,re=n;var a=(null==t||null===(l=t.watchHistory)||void 0===l?void 0:l.interval)||30,s=r(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());ce.includes(ve)||(e==ve?(ce.push(e),fe(s,t,a)):e>ve&&(ve=e+a))})),s.one("ended",(function(){fe(s,t,a,!0)})))}(e,c,null==o||null===(l=o.video)||void 0===l||null===(d=l.gist)||void 0===d?void 0:d.id)}})),f.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];f.trigger("subtitlechanged",t)})),f.on("subtitlechanged",(function(e,t){var n,i,o,r,l,a,s,d,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(d=s.framework)||void 0===d||null===(u=d.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===m){var p,w=f.getMediaSession(),h=w.media.tracks.filter((function(e){return"TEXT"==e.type}));p=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(p)}})),f.on("loadedmetadata",(function(){window.endFirstFrame(f)})),f.one("error",(function(){var t,i;d(e,(null==f||null===(t=f.error())||void 0===t?void 0:t.message)||"Some error occured"),n.reject({status:!1,msg:(null==f||null===(i=f.error())||void 0===i?void 0:i.message)||"Some error occured"})})),f.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,o,r=null===(n=u())||void 0===n||null===(i=n.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.id,l=v().get(r)||{t:0,p:0},a=l.t,s=l.p;a&&s<95&&setTimeout((function(){f.currentTime(a)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){f.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),f.on("volumechange",(function(){var e=100*f.volume().toFixed(2);f.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)}))},be=function(e,t){var n=null==t?void 0:t.skin;"live"==n?import("./skin-027b5fcd.js").then((function(n){n.initialiseSkin(e,t)})):"default"==n?import("./skin-7e32fcd2.js").then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?import("./skin-84d9a239.js").then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?import("./skin-6a551937.js").then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n&&import("./skin-79f86718.js").then((function(n){n.initialiseSkin(e,t)}))},Te=function(e){return new Promise((function(t,n){if(Ie(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!1,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},Ie=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},ke=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var Pe,Oe=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ee=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),je=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){Te("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(V)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(V)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),Te("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:Oe,loadEMELibrary:Ee});function Se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function De(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Se(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Se(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Ae=function(i,o,a,s){var u,c,v,m,f,p,w,h,g,y,T,I,k,P,O,E,D,A,R,F,C,x,B,M,L,U,W,q,z,G,J,K,Q,Y=o.res,X=void 0===Y?null:Y,Z=o.sres,$=void 0===Z?null:Z,ee=(null===(u=window)||void 0===u||null===(c=u.cast)||void 0===c||null===(v=c.framework)||void 0===v||null===(m=v.CastContext)||void 0===m||null===(f=m.getInstance())||void 0===f?void 0:f.S)||void 0,te=null!=a&&a.chromecastReceiverId?"NO_DEVICES_AVAILABLE"!==ee&&"NOT_CONNECTED"!==ee?["html5","chromecast"]:["chromecast","html5"]:["html5"],ne=(null===(p=X)||void 0===p?void 0:p.contentType)||"video",ie=_(null===(w=X)||void 0===w||null===(h=w[ne])||void 0===h||null===(g=h.gist)||void 0===g?void 0:g.videoImageUrl)||_(null===(y=X)||void 0===y||null===(T=y[ne])||void 0===T||null===(I=T.gist)||void 0===I||null===(k=I.imageGist)||void 0===k?void 0:k.r16x9),oe=(null===(P=X)||void 0===P||null===(O=P[ne])||void 0===O||null===(E=O.liveDetails)||void 0===E?void 0:E.isDvrEnabled)||!1,re=(null===(D=X)||void 0===D||null===(A=D[ne])||void 0===A||null===(R=A.streamingInfo)||void 0===R?void 0:R.isLiveStream)||!1,le=(null==a?void 0:a.drmLibrary)||!1,de=(null===(F=X)||void 0===F||null===(C=F.ads)||void 0===C||null===(x=C.preRoll)||void 0===x||null===(B=x.adTags)||void 0===B||null===(M=B.web)||void 0===M?void 0:M.active)&&(null===(L=X)||void 0===L||null===(U=L.ads)||void 0===U||null===(W=U.preRoll)||void 0===W||null===(q=W.adTags)||void 0===q||null===(z=q.web)||void 0===z?void 0:z.url);X=De(De({},X),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var ue=(Q={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:("default"==a.skin||"defaultV2"==a.skin||"live"==(null==a?void 0:a.skin))&&{inline:!1},fullscreenToggle:"default"==a.skin||"defaultV2"==a.skin,audioTrackButton:!1,pictureInPictureToggle:(a.skin,!1)},muteToggle:"multiplayer"==a.skin,liveui:oe},e(Q,"autoplay",null==a?void 0:a.autoplay),e(Q,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!de),e(Q,"loop",(null==a?void 0:a.loop)||!1),e(Q,"audioPosterMode",null==a?void 0:a.audioPosterMode),e(Q,"html5",De(De({dash:De(De({},!V.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}}),vhs:De(De({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(G=a.customData)||void 0===G?void 0:G.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(J=a.customData)||void 0===J?void 0:J.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(K=a.customData)||void 0===K?void 0:K.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(Q,"poster",ie),e(Q,"techOrder",te),e(Q,"chromecast",{requestCustomDataFn:function(e){var t=r(i),n=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,t,n){var i,o,r,l,a,s,d,u,c,v,m=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[m]&&null!=e&&e[m].drmEnabled){f.isDrmEnabled=!0;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;f.licenseUrl=p;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];f.licenseToken=w}var h=(null==e||null===(i=e[m])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";f.contentType=h;var g=null==e||null===(r=e[m])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=g;var y=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=y;var b=null==e||null===(d=e[m])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return f.mediaImage=b,f.subTitles=n,f.DVR=(null==e||null===(c=e[m])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(X,e,n)}}),Q),ce=V(i,ue,function(){var e=t(n.mark((function e(){var t,o,r,u,c,v,m,f,p,w,h,g,y,T,I,k,P,O,E,D,A,R,F,C;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ae(a),re&&s.resolve(De({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:X}:{response:X})),window.initialise(ce),window.firstFrame(ce),"white"!==window.controlsColor&&ke(window.controlsColor,ce),/Android/i.test(navigator.userAgent)&&(V.options.vhs.overrideNative=!0),T=null===(t=X)||void 0===t||null===(o=t[ne])||void 0===o?void 0:o.drmEnabled,I=null===(r=X)||void 0===r||null===(u=r[ne])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!T&&!le){e.next=21;break}if("Safari"!==l()){e.next=14;break}return e.next=12,Ee();case 12:e.next=21;break;case 14:if("caliente"!=(null===(k=window)||void 0===k?void 0:k.siteName)){e.next=19;break}return e.next=17,Ee();case 17:e.next=21;break;case 19:return e.next=21,Oe();case 21:oe&&se(i,I),!de||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||H(i,de,X),(P=j(X,i))?b(i,P):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:X}),d(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=X)||void 0===m||null===(f=m[ne])||void 0===f||null===(p=f.contentDetails)||void 0===p||null===(w=p.closedCaptions)||void 0===w?void 0:w.length)>0||(null===(h=X)||void 0===h||null===(g=h[ne])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(C=(null===(E=X)||void 0===E||null===(D=E[ne])||void 0===D||null===(A=D.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null===(R=X)||void 0===R||null===(F=R[ne])||void 0===F?void 0:F.closedCaptions),O=C.filter((function(e){return"VTT"===e.format})),N(i,O)),null!=a&&a.disableControls?S(i):be(i,De(De(De({},a),ue),{},{liveVideo:re,isDvrEnabled:oe,res:X,sres:$})),ye(i,De(De(De({},a),ue),{},{liveVideo:re}),s,{res:X,sres:$});case 28:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};function Re(){return{loadVideoInstantly:p,onTimeUpdate:U,getVideoDuration:W,onVideoEnded:q,init:function(e){return new Promise((function(t,n){var i,o,r,a,s,d,u,v,p,w,h;if(!T(null==e?void 0:e.playerId)){var g=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,y=null==e?void 0:e.videoId,b=(null==e||null===(o=e.series)||void 0===o?void 0:o.enable)||!1;window.videoId=y;var I=null==e?void 0:e.token;if(D().set(null==e?void 0:e.refreshToken),I&&!A(I)){Pe=JSON.parse(atob(I.split(".")[1])),window.siteId=null===(r=Pe)||void 0===r?void 0:r.siteId,window.siteName=null===(a=Pe)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=Pe)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=Pe)||void 0===d?void 0:d.site)||null,e.userId=(null===(u=Pe)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(v=Pe)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",I);var k=null==e?void 0:e.playerId,P=e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId,O=null==e?void 0:e.airplay,E=null==e?void 0:e.apiBaseUrl,j=(null==e||null===(p=e.analytics)||void 0===p?void 0:p.gaId)||null,S=null==e?void 0:e.errors;S&&(window.customErrors=S),window.customData=null==e?void 0:e.customData,Q(null==e||null===(w=e.customData)||void 0===w?void 0:w.localisation),E&&(window.playerEntitlementUrl=E),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!R(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return je})).then((function(e){e.importIMA()})),!P||null!=e&&e.series||Promise.resolve().then((function(){return je})).then((function(e){e.importChromecast()})),O&&"Safari"==l()&&Promise.resolve().then((function(){return je})).then((function(e){e.importAirplay()})),j&&Te("https://www.googletagmanager.com/gtag/js?id=".concat(j)).then((function(){return e=j,window.dataLayer=window.dataLayer||[],Y("js",new Date),void Y("config",e);var e})).catch((function(e){}));var _=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(k));if(_&&_.addEventListener("contextmenu",(function(e){return e.preventDefault()})),b){var H,N=null==e||null===(H=e.series)||void 0===H?void 0:H.id;F(N,I).then((function(i){var o,r,l,a=i.data,s=i.data.seasons;L(s);var d=y||(null==s||null===(o=s[0])||void 0===o||null===(r=o.episodes)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.id);!function(e,t){var n=new Map;m({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),f(n)})).catch((function(e){return console.log(e)}))}(N,I),C(d,I).then((function(i){var o,r,l;window.contentType=null==i||null===(o=i.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,c(i.data),Ae(k,{res:null==i?void 0:i.data,sres:a},e,{resolve:t,reject:n})})).catch((function(e){x(e,k,n,y)}))})).catch((function(e){x(e,k,n)}))}else if(g){var V=null==e?void 0:e.epg;B(V,I).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",Ae(k,{res:o},e,{resolve:t,reject:n})})).catch((function(e){x(e,k,n,y)}))}else C(y,I).then((function(i){var o,r,l,a;window.contentType=null==i||null===(o=i.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,c(null==i?void 0:i.data);var s=null==i?void 0:i.data;null!=e&&e.watchHistory&&null!=e&&null!==(a=e.watchHistory)&&void 0!==a&&a.enable?M(y,I).then((function(i){var o,r,l,a,d,u;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==i?void 0:i.data)),e.watchHistoryResumeTime=(null==i||null===(d=i.data)||void 0===d?void 0:d.watchedTime)||null,e.watchedPercentage=(null==i||null===(u=i.data)||void 0===u?void 0:u.watchedPercentage)||null,s.contentType="video",Ae(k,{res:s},e,{resolve:t,reject:n})})).catch((function(i){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(i)),Ae(k,{res:s},e,{resolve:t,reject:n})})):Ae(k,{res:s},e,{resolve:t,reject:n})})).catch((function(e){x(e,k,n,y)}))}else n({status:!1,msg:"".concat(I?"Token is expired !":"Missing Authorization Token"),response:{token:I}})}}))},getRenditions:J,skip:w,getPlayer:r,play:h,pause:g,detectBrowser:l,rewind:y,loadVideo:b,seekToTimeStamp:z,isPlayerInitialised:T,load:I,dispose:k,enableCaptions:P,disableCaptions:O,getCaptions:E,playSelectedResolution:K,getSource:j,setVolume:pe,getVolume:we,disableControls:S,setPlaybackSpeed:G}}export{Re as default};
1
+ import"video.js/dist/video-js.min.css";import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import i from"axios";import{g as o,d as r,a as l,s as a,c as s,h as d,b as u,e as c,f as v,i as m,j as f,l as p,k as w,p as h,m as g,r as y,n as b,o as T,q as k,t as I,u as P,v as O,w as j,x as S,y as E,z as D,A,B as R,C as F,D as x,E as C,F as B,G as M,H as _,I as H,J as N,K as L}from"./generic-7c12a59f.js";import V from"video.js";import{o as U,g as W,a as q,s as z,b as G}from"./util-b0bc7e61.js";import{g as J}from"./renditions-29c48da7.js";import{playSelectedResolution as K}from"./resolution-8bf5df58.js";import{s as Q}from"./localisation-0bf399a1.js";import"js-cookie";import"ua-parser-js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/assertThisInitialized";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";function Y(){var e,t;null===(e=window)||void 0===e||null===(t=e.dataLayer)||void 0===t||t.push(arguments)}function X(e,t){Y("event",e,t)}function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function $(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Z(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Z(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function ee(){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}function te(){var e=window.sessionStorage.getItem("uid");return e||(e=ee(),window.sessionStorage.setItem("uid",e),e)}function ne(){return ie.apply(this,arguments)}function ie(){return ie=t(n.mark((function e(){var t,i;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o();case 2:if(t=e.sent,null==(i=JSON.parse(atob(t.split(".")[1])))||!i.anonymousId){e.next=8;break}return e.abrupt("return","guest-user");case 8:return e.abrupt("return",null==i?void 0:i.userId);case 9:case"end":return e.stop()}}),e)}))),ie.apply(this,arguments)}window.initialise=function(e){window.sid=ee(),window.environment="production",window.platform="WEBSITE",streamFailures(e),buffering(e),ads(e),ping(e)},window.streamFailures=function(e){var t=Math.floor(e.currentTime());e.on("error",(function(){var n,i,o,r=Math.floor(e.currentTime());X(r?"FAILED_TO_START":"DROPPED_STREAM",$({pfm:window.platform,uid:te(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(n=window)||void 0===n||null===(i=n.customData)||void 0===i||null===(o=i.beacon)||void 0===o?void 0:o.params)),fireEvent({eventName:t===r?"FAILED_TO_START":"DROPPED_STREAM",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})}))},window.firstFrame=function(e){e.one("play",tryCatch((function(){var t,n,i;window.ttFirstFrame=0,window.ttFirstFrameTimer=setInterval((function(){window.ttFirstFrame=window.handleBufferTimer(window.ttFirstFrame,e)}),100),X("PLAY",$({pfm:window.platform,uid:te(),vid:window.videoId,videoPosition:Math.floor(e.currentTime())},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"PLAY",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1})})))},window.buffering=function(e){e.on("waiting",tryCatch((function(){window.ttFirstFrameTimer||(e.currentTime(),clearInterval(window.bufferingTimer),window.bufferingTimer=setInterval((function(){e.el_.className.includes("vjs-waiting")&&!e.paused()?window.totalBufferTime=handleBufferTimer(window.totalBufferTime,e):clearInterval(window.bufferingTimer)}),100))})))},window.handleBufferTimer=function(e,t){var n,i;if(t.el_){var o,r,l,a=e+.1;if(+a.toFixed(2)%5==0&&null!=t&&null!==(n=t.el_)&&void 0!==n&&null!==(i=n.className)&&void 0!==i&&i.includes("vjs-waiting"))X("BUFFERING",$({pfm:window.platform,uid:te(),vid:window.videoId,videoPosition:t.el_&&Math.floor(t.currentTime())},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"BUFFERING",videoPosition:t.el_&&Math.floor(t.currentTime()),isAdEvent:!1});return a}clearInterval(window.ttFirstFrameTimer)},window.endFirstFrame=function(e){e.one("timeupdate",(function(){var t,n,i;clearInterval(window.ttFirstFrameTimer),clearInterval(window.bufferingTimer),window.ttFirstFrameTimer=null,window.totalBufferTime=window.ttFirstFrame||0,X("FIRST_FRAME",$({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:te(),vid:window.videoId},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"FIRST_FRAME",videoPosition:Math.floor(e.currentTime()),isAdEvent:!1,ttFirstFrame:window.ttFirstFrame,bufferHealth:window.getRemainingBufferTime(e)})}))},window.ads=function(e){e.on("adsready",(function(){e.ima.addEventListener(window.google.ima.AdEvent.Type.STARTED,(function(){var t,n,i,o,r,l;X("AD_REQUEST",$({eventName:"AD_REQUEST",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:te(),vid:window.videoId,resHeight:e.videoHeight(),resWidth:e.videoWidth()},null===(t=window)||void 0===t||null===(n=t.customData)||void 0===n||null===(i=n.beacon)||void 0===i?void 0:i.params)),fireEvent({eventName:"AD_REQUEST",videoPosition:Math.ceil(e.currentTime()),isAdEvent:!0,resHeight:e.videoHeight(),resWidth:e.videoWidth(),adPosition:1}),X("AD_IMPRESSION",$({eventName:"AD_IMPRESSION",videoPosition:Math.floor(e.currentTime()),isAdEvent:!0,bufferHealth:window.getRemainingBufferTime(e),pfm:window.platform,uid:te(),resHeight:e.videoHeight(),resWidth:e.videoWidth(),vid:window.videoId},null===(o=window)||void 0===o||null===(r=o.customData)||void 0===r||null===(l=r.beacon)||void 0===l?void 0:l.params)),fireEvent({eventName:"AD_IMPRESSION",videoPosition:Math.ceil(e.currentTime()),resHeight:e.videoHeight(),resWidth:e.videoWidth(),isAdEvent:!0,adPosition:1})})),e.ima.addEventListener(window.google.ima.AdEvent.Type.SKIPPED,(function(){window.ttFirstFrame=0})),e.ima.addEventListener(window.google.ima.AdEvent.Type.COMPLETE,(function(){window.ttFirstFrame=0}))}))},window.ping=function(e){var t=[];e.on("timeupdate",(function(){var n=Math.floor(e.currentTime());n>=30&&n%30==0&&!t.includes(n)&&(t.push(n),fireEvent({eventName:"PING",videoPosition:n,isAdEvent:!1,duration:30,resHeight:e.videoHeight(),resWidth:e.videoWidth(),bufferHealth:window.getRemainingBufferTime(e),bitrate:e.tech_.vhs&&window.getBitrate(e)}))}))},window.getBitrate=function(e){return Math.round(e.tech_.vhs.selectPlaylist().attributes.BANDWIDTH/1e3)},window.getRemainingBufferTime=function(e){return tryCatch((function(){for(var t=e.currentTime(),n=e.duration(),i=e.buffered(),o=0;o<i.length;o++){var r=i.start(o),l=i.end(o);if(oe(t,r,l)){var a=Math.round(n-l);if(isFinite(a))return a}}}))()};var oe=function(e,t,n){return e>=t&&e<=n};window.fireEvent=function(){var e=t(n.mark((function e(t){var r,l,a,s,d,u,c,v,m,f,p;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=$,e.t1=$,e.t2=$({aid:window.siteName,cid:window.siteId,pfm:window.platform},null===(r=window)||void 0===r||null===(l=r.customData)||void 0===l||null===(a=l.beacon)||void 0===a?void 0:a.params),e.t3={},e.t4=te(),e.t5=window.videoId,e.t6=t.url||document.location.href,e.t7=t.ref||document.referrer,e.t8=t.eventName,e.t9=t.videoPosition,e.t10=window.environment,e.t11=t.dp1||"",e.t12=t.dp2||"",e.t13=t.dp3||"",e.t14=t.dp4||"",e.t15=t.dp5||"",e.t16=!0===t.isAdEvent?t.videoPosition:"",e.t17=!0===t.isAdEvent?(n=t.adPosition)?String(n):"":"",e.next=20,ne();case 20:return e.t18=e.sent,e.t19=t.playerType||"native",e.t20=t.mediaType||"VIDEO",e.t21=window.sid,e.t22=t.ttFirstFrame,e.t23=t.bitrate,e.t24=t.resHeight,e.t25=t.resWidth,e.t26=t.bufferHealth,e.t27={uid:e.t4,vid:e.t5,url:e.t6,ref:e.t7,pa:e.t8,vpos:e.t9,environment:e.t10,dp1:e.t11,dp2:e.t12,dp3:e.t13,dp4:e.t14,dp5:e.t15,apos:e.t16,apod:e.t17,profid:e.t18,player:e.t19,media_type:e.t20,stream_id:e.t21,embedurl:"",ttfirstframe:e.t22,bitrate:e.t23,connectionspeed:"",resolutionheight:e.t24,resolutionwidth:e.t25,bufferhealth:e.t26},e.t28=(null==t?void 0:t.duration)&&{duration:t.duration},e.t29=(0,e.t1)(e.t2,e.t3,e.t27,e.t28),e.t30=null===(s=window)||void 0===s||null===(d=s.customData)||void 0===d||null===(u=d.beacon)||void 0===u?void 0:u.params,e.t31=(0,e.t0)(e.t29,e.t30),f=[e.t31],e.next=37,o();case 37:p=e.sent,i({url:(null===(c=window)||void 0===c||null===(v=c.customData)||void 0===v||null===(m=v.beacon)||void 0===m?void 0:m.url)||"https://1a7ahu122g.execute-api.us-east-1.amazonaws.com/production_beacon/firehouse-proxy",method:"post",headers:{Authorization:p},contentType:"application/x-www-form-urlencoded",dataType:"text",data:f}).catch((function(e){console.error(e)}));case 39:case"end":return e.stop()}var n}),e)})));return function(t){return e.apply(this,arguments)}}(),window.tryCatch=function(e){return function(){try{return e.apply(window,arguments)}catch(e){return console.error(e),null}}};var re,le,ae=function(e){return new Promise((function(t,n){if(se(e))n("".concat(e," is alread initialised"));else{var i=document.createElement("script");i.async=!0,i.src=e,i.onload=function(){t()},i.onerror=function(t){n("Error while loading script ".concat(e," : ").concat(t))},document.head.appendChild(i)}}))},se=function(e){return document.querySelectorAll('script[src="'.concat(e,'"]')).length>0},de=function(){var e=t(n.mark((function e(t){var i,o,a;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=l(null==t?void 0:t.playerId),null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable||null==t||!t.chromecastReceiverId){e.next=12;break}return e.next=4,import("@silvermine/videojs-chromecast");case 4:return a=e.sent,e.next=7,ae("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");case 7:a.default(V),window.__onGCastApiAvailable=function(){null==o||o.chromecast({receiverAppID:null==t?void 0:t.chromecastReceiverId,addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5,addCastLabelToButton:!0})},e.next=13;break;case 12:console.log("Chromecast plugin is not available");case 13:null!=t&&t.airplay&&"Safari"==r()?null==o||o.airPlay({addButtonToControlBar:"default"==t.skin||"defaultV2"==t.skin,buttonPositionIndex:-5}):console.log("AirPlay plugin is not available");case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ue=function(e,t){var n=l(e);n&&t&&n.controlBar&&n.controlBar.progressControl.seekBar.on("click",(function(t){var n,i,o,r,l,a=this.el(),s=V.dom.getPointerPosition(a,t).x;V.getPlayer(e).controlBar.durationDisplay.options_.playerOptions.disableRemotePlayback=!1;var d=window.cast&&window.cast.framework&&window.cast.framework.CastSession,u=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S;if(console.log(d),d&&"CONNECTED"===u){window.cast.framework.RemotePlayer.canSeek=!0;var c=new window.cast.framework.RemotePlayerController(window.cast.framework.RemotePlayer),v=c.h.media[0].liveSeekableRange.end;c.getSeekPosition(),window.cast.framework.RemotePlayer.currentTime=v*s,c.seek()}}))};function ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ve(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ce(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ce(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var me=[],fe=0,pe=null;function we(e,t,n){var i,o,r,l,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];le=(null==t||null===(i=t.watchHistory)||void 0===i?void 0:i.apiVersion)||"v1";var d=null==t||null===(o=t.watchHistory)||void 0===o?void 0:o.profileId,u=Math.floor(e.currentTime()),c=Math.floor(e.duration()),v=null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.xapiKey,m=(null==t||null===(l=t.video)||void 0===l?void 0:l.originalObjectId)||null,f={};"v1"==le?f={videoId:re,watchedTime:Math.floor(e.currentTime()),watchedPercentage:Math.floor(u/c*100),siteOwner:t.siteOwner,userId:t.userId,xApiKey:v}:"v2"==le&&(f=ve(ve({videoId:re,watchedTime:Math.floor(e.currentTime()),watchedPercentage:s?100:Math.floor(u/c*100),doneWatching:s,profileId:d},pe&&{seriesId:pe}),m&&{originalObjectId:m})),a(f,le).then((function(e){})).catch((function(e){})),fe=u+n}var he=function(e,t,n){var i=l(e);if(i)if(t>=0&&t<=100){i.muted()&&i.muted(!1);var o=parseFloat(t)/100;i.volume(o),n&&n({status:!0,msg:"Volume set to ".concat(t,"%")})}else n&&n({status:!1,msg:"Please enter a valid volume percentage (0 ≥ V ≤ 100)"});else n({status:!1,msg:"Cannot find player with id: '".concat(e,"'")})},ge=function(e){var t=l(e);return t?parseInt(100*t.volume())+"%":"Cannot find player with id: '".concat(e,"'")};function ye(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function be(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ye(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ye(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Te=function(e,t,n,i){var o,r,a=i.res,m=i.sres,f=l(e),p=(null==a?void 0:a.contentType)||"video",w=(null==a||null===(o=a[p])||void 0===o||null===(r=o.streamingInfo)||void 0===r?void 0:r.isLiveStream)||!1;c(a),f.on("loadstart",(function(){w&&n.resolve({status:!0,msg:"Video Loaded",response:a})})),f.on("loadeddata",(function(){var i;(null==f||!f.muted())&&he(e,sessionStorage.getItem("volume")||"100");var o=u();if(s(),n.resolve(be({status:!0,msg:"Player Initialised"},m?{seriesResponse:m,response:a}:{response:a})),null!=t&&t.watchHistory&&null!=t&&null!==(i=t.watchHistory)&&void 0!==i&&i.enable&&!t.isAnonymousUser){var r,d,c=be(be({},t),a);!function(e,t,n){var i,o,r;null!=t&&t.series&&null!=t&&null!==(i=t.series)&&void 0!==i&&i.enable&&(pe=null==t||null===(o=t.series)||void 0===o?void 0:o.id),me=[],fe=0,re=n;var a=(null==t||null===(r=t.watchHistory)||void 0===r?void 0:r.interval)||30,s=l(e);s&&(s.on("timeupdate",(function(){var e=Math.floor(s.currentTime());me.includes(fe)||(e==fe?(me.push(e),we(s,t,a)):e>fe&&(fe=e+a))})),s.one("ended",(function(){we(s,t,a,!0)})))}(e,c,null==o||null===(r=o.video)||void 0===r||null===(d=r.gist)||void 0===d?void 0:d.id)}})),f.textTracks().on("change",(function(e){var t=this.tracks_.filter((function(e){if("subtitles"===e.kind&&"showing"===e.mode)return!0}))[0];f.trigger("subtitlechanged",t)})),f.on("subtitlechanged",(function(e,t){var n,i,o,r,l,a,s,d,u,c,v=window.cast&&window.cast.framework&&window.cast.framework.CastSession,m=null===(n=window)||void 0===n||null===(i=n.cast)||void 0===i||null===(o=i.framework)||void 0===o||null===(r=o.CastContext)||void 0===r||null===(l=r.getInstance())||void 0===l?void 0:l.S,f=null===(a=window)||void 0===a||null===(s=a.cast)||void 0===s||null===(d=s.framework)||void 0===d||null===(u=d.CastContext)||void 0===u||null===(c=u.getInstance())||void 0===c?void 0:c.getCurrentSession();if(v&&"CONNECTED"===m){var p,w=f.getMediaSession(),h=w.media.tracks.filter((function(e){return"TEXT"==e.type}));p=t?new chrome.cast.media.EditTracksInfoRequest([h[0].trackId]):new chrome.cast.media.EditTracksInfoRequest([]),w.editTracksInfo(p)}})),f.on("loadedmetadata",(function(){window.endFirstFrame(f)})),f.one("error",(function(){var t,i;d(e,(null==f||null===(t=f.error())||void 0===t?void 0:t.message)||"Some error occured"),n.reject({status:!1,msg:(null==f||null===(i=f.error())||void 0===i?void 0:i.message)||"Some error occured"})})),f.one("play",(function(){var e;if(null!=t&&null!==(e=t.series)&&void 0!==e&&e.enable){var n,i,o,r=null===(n=u())||void 0===n||null===(i=n.video)||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.id,l=v().get(r)||{t:0,p:0},a=l.t,s=l.p;a&&s<95&&setTimeout((function(){f.currentTime(a)}),0)}else null!=t&&t.watchHistoryResumeTime&&(null==t?void 0:t.watchedPercentage)<95&&setTimeout((function(){f.currentTime(null==t?void 0:t.watchHistoryResumeTime)}),0)})),f.on("volumechange",(function(){var e=100*f.volume().toFixed(2);f.muted()?sessionStorage.setItem("volume",0):sessionStorage.setItem("volume",e)})),f.on("chromecastDisconnected",(function(){if(w){console.log('chromecast-disconnected,"2"',w),console.log("resetting source",f.currentType(),f.currentSource());for(var e=f.currentSource(),t=f.textTracks(),n=t.length-1;n>=0;n--)f.removeRemoteTextTrack(t[n]);f.src(e)}}))},ke=function(e,t){var n=null==t?void 0:t.skin;"live"==n?import("./skin-027b5fcd.js").then((function(n){n.initialiseSkin(e,t)})):"default"==n?import("./skin-7e32fcd2.js").then((function(n){n.initialiseSkin(e,t)})):"carousel"==n?import("./skin-84d9a239.js").then((function(t){t.initaliseSkin(e)})):"defaultV2"==n?import("./skin-6a551937.js").then((function(n){n.initialiseSkin(e,t)})):"multiplayer"==n&&import("./skin-79f86718.js").then((function(n){n.initialiseSkin(e,t)}))},Ie=function(e,t){t.controlBar.el_.style.color=e,t.controlBar.el_.querySelector(".vjs-play-progress")&&(t.controlBar.el_.querySelector(".vjs-play-progress").style.backgroundColor=e),t.controlBar.el_.querySelector(".vjs-volume-level")&&(t.controlBar.el_.querySelector(".vjs-volume-level").style.backgroundColor=e)};var Pe,Oe=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-dash");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),je=function(){var e=t(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,import("videojs-contrib-eme");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Se=Object.freeze({__proto__:null,importChromecast:function(){import("@silvermine/videojs-chromecast").then((function(e){ae("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1").then((function(){e.default(V)})).catch((function(e){console.log(e)}))}))},importAirplay:function(){import("@silvermine/videojs-airplay").then((function(e){e.default(V)}))},importIMA:function(){import("videojs-contrib-ads"),import("videojs-ima"),ae("https://imasdk.googleapis.com/js/sdkloader/ima3.js").then((function(){})).catch((function(e){return console.log(e)}))},loadDashLibrary:Oe,loadEMELibrary:je});function Ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function De(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Ee(Object(i),!0).forEach((function(n){e(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ee(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Ae=function(i,o,a,s){var u,c,v,m,f,p,w,h,g,y,T,k,I,P,O,j,D,A,R,F,x,C,B,M,L,U,W,q,z,G,J,K,Q,Y=o.res,X=void 0===Y?null:Y,Z=o.sres,$=void 0===Z?null:Z;null===(u=window)||void 0===u||null===(c=u.cast)||void 0===c||null===(v=c.framework)||void 0===v||null===(m=v.CastContext)||void 0===m||null===(f=m.getInstance())||void 0===f||f.S;var ee=null!=a&&a.chromecastReceiverId?["chromecast","html5"]:["html5"],te=(null===(p=X)||void 0===p?void 0:p.contentType)||"video",ne=_(null===(w=X)||void 0===w||null===(h=w[te])||void 0===h||null===(g=h.gist)||void 0===g?void 0:g.videoImageUrl)||_(null===(y=X)||void 0===y||null===(T=y[te])||void 0===T||null===(k=T.gist)||void 0===k||null===(I=k.imageGist)||void 0===I?void 0:I.r16x9),ie=(null===(P=X)||void 0===P||null===(O=P[te])||void 0===O||null===(j=O.liveDetails)||void 0===j?void 0:j.isDvrEnabled)||!1,oe=(null===(D=X)||void 0===D||null===(A=D[te])||void 0===A||null===(R=A.streamingInfo)||void 0===R?void 0:R.isLiveStream)||!1,re=(null==a?void 0:a.drmLibrary)||!1,le=(null===(F=X)||void 0===F||null===(x=F.ads)||void 0===x||null===(C=x.preRoll)||void 0===C||null===(B=C.adTags)||void 0===B||null===(M=B.web)||void 0===M?void 0:M.active)&&(null===(L=X)||void 0===L||null===(U=L.ads)||void 0===U||null===(W=U.preRoll)||void 0===W||null===(q=W.adTags)||void 0===q||null===(z=q.web)||void 0===z?void 0:z.url);X=De(De({},X),{},{audioAssetSource:null==a?void 0:a.audioAssetSource});var ae=(Q={controls:0!=(null==a?void 0:a.controls),playsinline:!0,fluid:!0,aspectRatio:"16:9",muted:(null==a?void 0:a.muted)||!1,autoplay:(null==a?void 0:a.autoplay)||!1,controlBar:{volumePanel:("default"==a.skin||"defaultV2"==a.skin||"live"==(null==a?void 0:a.skin))&&{inline:!1},fullscreenToggle:"default"==a.skin||"defaultV2"==a.skin,audioTrackButton:!1,pictureInPictureToggle:(a.skin,!1)},muteToggle:"multiplayer"==a.skin,liveui:ie},e(Q,"autoplay",null==a?void 0:a.autoplay),e(Q,"normalizeAutoplay",(null==a?void 0:a.autoplay)&&!le),e(Q,"loop",(null==a?void 0:a.loop)||!1),e(Q,"audioPosterMode",null==a?void 0:a.audioPosterMode),e(Q,"html5",De(De({dash:De(De({},!V.browser.IS_SAFARI&&{useTTML:!0}),{},{updateSettings:{streaming:{delay:{liveDelay:localStorage.getItem("LATENCY")||5},liveCatchup:{maxDrift:0,playbackRate:{min:-.1,max:.1}},abr:{additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0}}}}}),vhs:De(De({experimentalLLHLS:(null==a?void 0:a.lowLatency)||!1,limitRenditionByPlayerDimensions:!0,useDevicePixelRatio:!0,useNetworkInformationApi:!0},(null==a||null===(G=a.customData)||void 0===G?void 0:G.overrideNative)&&{overrideNative:!0}),{},{enableLowInitialPlaylist:(null==a?void 0:a.enableLowInitialPlaylist)||!1,experimentalBufferBasedABR:(null==a?void 0:a.experimentalBufferBasedABR)||!1})},0==(null==a||null===(J=a.customData)||void 0===J?void 0:J.nativeAudioTracks)&&{nativeAudioTracks:!1}),0==(null==a||null===(K=a.customData)||void 0===K?void 0:K.nativeVideoTracks)&&{nativeVideoTracks:!1})),e(Q,"poster",ne),e(Q,"techOrder",ee),e(Q,"chromecast",{requestCustomDataFn:function(e){var t=l(i),n=((null==t?void 0:t.textTracksJson_)||t.textTracks().tracks_).filter((function(e){return"captions"==e.kind||"subtitles"==e.kind}));return function(e,t,n){var i,o,r,l,a,s,d,u,c,v,m=(null==e?void 0:e.contentType)||"video",f={};if(e&&null!=e&&e[m]&&null!=e&&e[m].drmEnabled){f.isDrmEnabled=!0;var p=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.serverURL;f.licenseUrl=p;var w=t.keySystemOptions&&t.keySystemOptions[0]&&t.keySystemOptions[0].options&&t.keySystemOptions[0].options.httpRequestHeaders["X-AxDRM-Message"];f.licenseToken=w}var h=(null==e||null===(i=e[m])||void 0===i||null===(o=i.gist)||void 0===o?void 0:o.contentType)||"VIDEO";f.contentType=h;var g=null==e||null===(r=e[m])||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.runtime;f.duration=g;var y=null==e||null===(a=e[m])||void 0===a||null===(s=a.gist)||void 0===s?void 0:s.title;f.mediaTitle=y;var b=null==e||null===(d=e[m])||void 0===d||null===(u=d.gist)||void 0===u?void 0:u.videoImageUrl;return f.mediaImage=b,f.subTitles=n,f.DVR=(null==e||null===(c=e[m])||void 0===c||null===(v=c.liveDetails)||void 0===v?void 0:v.isDvrEnabled)||!1,console.log(f),f}(X,e,n)}}),Q),se=V(i,ae,function(){var e=t(n.mark((function e(){var t,o,l,u,c,v,m,f,p,w,h,g,y,T,k,I,P,O,j,D,A,R,F,x;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,de(a);case 2:if(oe&&s.resolve(De({status:!0,msg:"Player Initialised"},$?{seriesResponse:$,response:X}:{response:X})),window.initialise(se),window.firstFrame(se),"white"!==window.controlsColor&&Ie(window.controlsColor,se),/Android/i.test(navigator.userAgent)&&(V.options.vhs.overrideNative=!0),T=null===(t=X)||void 0===t||null===(o=t[te])||void 0===o?void 0:o.drmEnabled,k=null===(l=X)||void 0===l||null===(u=l[te])||void 0===u||null===(c=u.liveDetails)||void 0===c?void 0:c.startOverTime,!T&&!re){e.next=22;break}if("Safari"!==r()){e.next=15;break}return e.next=13,je();case 13:e.next=22;break;case 15:if("caliente"!=(null===(I=window)||void 0===I?void 0:I.siteName)){e.next=20;break}return e.next=18,je();case 18:e.next=22;break;case 20:return e.next=22,Oe();case 22:ie&&ue(i,k),!le||null!=a&&null!==(v=a.customData)&&void 0!==v&&v.disableAds||H(i,le,X),(P=S(X,i))?b(i,P):(s.reject({status:!1,msg:"Incompatible Source, only hls,mp4,drm content is allowed",response:X}),d(i,"Incompatible Source, only hls,mp4,drm content is allowed")),((null===(m=X)||void 0===m||null===(f=m[te])||void 0===f||null===(p=f.contentDetails)||void 0===p||null===(w=p.closedCaptions)||void 0===w?void 0:w.length)>0||(null===(h=X)||void 0===h||null===(g=h[te])||void 0===g||null===(y=g.closedCaptions)||void 0===y?void 0:y.length)>0)&&(x=(null===(j=X)||void 0===j||null===(D=j[te])||void 0===D||null===(A=D.contentDetails)||void 0===A?void 0:A.closedCaptions)||(null===(R=X)||void 0===R||null===(F=R[te])||void 0===F?void 0:F.closedCaptions),O=x.filter((function(e){return"VTT"===e.format})),N(i,O)),null!=a&&a.disableControls?E(i):ke(i,De(De(De({},a),ae),{},{liveVideo:oe,isDvrEnabled:ie,res:X,sres:$})),Te(i,De(De(De({},a),ae),{},{liveVideo:oe}),s,{res:X,sres:$});case 29:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}())};function Re(){return{loadVideoInstantly:p,onTimeUpdate:U,getVideoDuration:W,onVideoEnded:q,init:function(e){return new Promise((function(t,n){var i,o,l,a,s,d,u,v,p,w,h;if(!T(null==e?void 0:e.playerId)){var g=(null==e||null===(i=e.epg)||void 0===i?void 0:i.enable)||!1,y=null==e?void 0:e.videoId,b=(null==e||null===(o=e.series)||void 0===o?void 0:o.enable)||!1;window.videoId=y;var k=null==e?void 0:e.token;if(D().set(null==e?void 0:e.refreshToken),k&&!A(k)){Pe=JSON.parse(atob(k.split(".")[1])),window.siteId=null===(l=Pe)||void 0===l?void 0:l.siteId,window.siteName=null===(a=Pe)||void 0===a?void 0:a.site,e.isAnonymousUser=!(null===(s=Pe)||void 0===s||!s.anonymousId),e.siteOwner=(null===(d=Pe)||void 0===d?void 0:d.site)||null,e.userId=(null===(u=Pe)||void 0===u?void 0:u.userId)||null,window.sessionStorage.setItem("uid",null===(v=Pe)||void 0===v?void 0:v.userId),window.watchHistory=e.watchHistory||null,sessionStorage.setItem("vlp_token",k);var I=null==e?void 0:e.playerId;e.chromecastReceiverId=null!=e&&e.series?null:null==e?void 0:e.chromecastReceiverId;var P=null==e?void 0:e.airplay,O=null==e?void 0:e.apiBaseUrl,j=(null==e||null===(p=e.analytics)||void 0===p?void 0:p.gaId)||null,S=null==e?void 0:e.errors;S&&(window.customErrors=S),window.customData=null==e?void 0:e.customData,Q(null==e||null===(w=e.customData)||void 0===w?void 0:w.localisation),O&&(window.playerEntitlementUrl=O),window.controlsColor=(null==e?void 0:e.controlsColor)||"white",null!=e&&e.skin&&!R(e.skin)||(e.skin="defaultV2"),Promise.resolve().then((function(){return Se})).then((function(e){e.importIMA()})),P&&"Safari"==r()&&Promise.resolve().then((function(){return Se})).then((function(e){e.importAirplay()})),j&&ae("https://www.googletagmanager.com/gtag/js?id=".concat(j)).then((function(){return e=j,window.dataLayer=window.dataLayer||[],Y("js",new Date),void Y("config",e);var e})).catch((function(e){}));var E=null===(h=document)||void 0===h?void 0:h.getElementById("".concat(I));if(E&&E.addEventListener("contextmenu",(function(e){return e.preventDefault()})),b){var _,H=null==e||null===(_=e.series)||void 0===_?void 0:_.id;F(H,k).then((function(i){var o,r,l,a=i.data,s=i.data.seasons;L(s);var d=y||(null==s||null===(o=s[0])||void 0===o||null===(r=o.episodes)||void 0===r||null===(l=r[0])||void 0===l?void 0:l.id);!function(e,t){var n=new Map;m({videoId:e,token:t}).then((function(e){e.data.map((function(e){n.set(e.videoId,{t:e.watchedTime,p:e.watchedPercentage})})),f(n)})).catch((function(e){return console.log(e)}))}(H,k),x(d,k).then((function(i){var o,r,l;window.contentType=null==i||null===(o=i.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,c(i.data),Ae(I,{res:null==i?void 0:i.data,sres:a},e,{resolve:t,reject:n})})).catch((function(e){C(e,I,n,y)}))})).catch((function(e){C(e,I,n)}))}else if(g){var N=null==e?void 0:e.epg;B(N,k).then((function(i){var o=null==i?void 0:i.data;o.contentType="linearchannel",Ae(I,{res:o},e,{resolve:t,reject:n})})).catch((function(e){C(e,I,n,y)}))}else x(y,k).then((function(i){var o,r,l,a;window.contentType=null==i||null===(o=i.data)||void 0===o||null===(r=o.video)||void 0===r||null===(l=r.gist)||void 0===l?void 0:l.contentType,c(null==i?void 0:i.data);var s=null==i?void 0:i.data;null!=e&&e.watchHistory&&null!=e&&null!==(a=e.watchHistory)&&void 0!==a&&a.enable?M(y,k).then((function(i){var o,r,l,a,d,u;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(null==i?void 0:i.data)),e.watchHistoryResumeTime=(null==i||null===(d=i.data)||void 0===d?void 0:d.watchedTime)||null,e.watchedPercentage=(null==i||null===(u=i.data)||void 0===u?void 0:u.watchedPercentage)||null,s.contentType="video",Ae(I,{res:s},e,{resolve:t,reject:n})})).catch((function(i){var o,r,l,a;null!==(o=window)&&void 0!==o&&null!==(r=o.watchHistory)&&void 0!==r&&r.cb&&(null===(l=window)||void 0===l||null===(a=l.watchHistory)||void 0===a||a.cb(i)),Ae(I,{res:s},e,{resolve:t,reject:n})})):Ae(I,{res:s},e,{resolve:t,reject:n})})).catch((function(e){C(e,I,n,y)}))}else n({status:!1,msg:"".concat(k?"Token is expired !":"Missing Authorization Token"),response:{token:k}})}}))},getRenditions:J,skip:w,getPlayer:l,play:h,pause:g,detectBrowser:r,rewind:y,loadVideo:b,seekToTimeStamp:z,isPlayerInitialised:T,load:k,dispose:I,enableCaptions:P,disableCaptions:O,getCaptions:j,playSelectedResolution:K,getSource:S,setVolume:he,getVolume:ge,disableControls:E,setPlaybackSpeed:G}}export{Re as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewlift/player-backup",
3
- "version": "1.0.70-backup",
3
+ "version": "1.0.72-backup",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "amdName": "_playerCore",
6
6
  "dependencies": {