@viewlift/player-backup 2.0.347-backup → 2.0.349-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.
@@ -1 +0,0 @@
1
- "use strict";var e=require("./features-caccb092.js"),l=require("./skin-66dce245.js"),i=require("./index-ae34b733.js"),r=require("./index-7ec7d20b.js"),n=require("./browser-3670a923.js");require("videojs-contrib-quality-menu");var o=require("./relatedVideosManager-0a220d05.js"),t=require("video.js"),u=require("./generic-13b8debd.js"),a=require("./icons-eb807ef0.js");require("@babel/runtime/helpers/defineProperty"),require("@babel/runtime/helpers/classCallCheck"),require("@babel/runtime/helpers/createClass"),require("@babel/runtime/helpers/inherits"),require("@babel/runtime/helpers/possibleConstructorReturn"),require("@babel/runtime/helpers/getPrototypeOf"),require("./renditions-627bdfad.js"),require("./localisation-56e0a999.js"),require("@babel/runtime/helpers/toConsumableArray"),require("./autoNextVideo-edc097a1.js"),require("./index-a5a5f19f.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/slicedToArray"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("axios"),require("md5"),require("js-cookie"),require("./captions-4dfe293a.js"),require("@viewlift/comscore/index.js");function d(t,u){var a,d=l.getPlayer(t),v=(null==u||null===(a=u.res)||void 0===a?void 0:a.siteId)||"";d&&(d.on("loadeddata",function(){var e,a,d,s,c,p,b,g;!function(e){var i=l.getPlayer(e);i&&(null==i||i.qualityMenu,i.qualityMenu({useResolutionLabels:!0}))}(t);var y=(null===(e=o.relatedVideosManager.get())||void 0===e||null===(a=e.content)||void 0===a?void 0:a.length)>0;if(!(null!=u&&null!==(d=u.series)&&void 0!==d&&d.enable||null!==(s=window)&&void 0!==s&&null!==(c=s.app_data)&&void 0!==c&&null!==(p=c.appcmsMain)&&void 0!==p&&null!==(b=p.features)&&void 0!==b&&b.auto_play||y)||null!=u&&u.liveVideo){if(!(null!=u&&u.liveVideo||null!=u&&null!==(g=u.series)&&void 0!==g&&g.enable)){var m;m=o.relatedVideosManager.subscribe(function(e){var l;(null==e||null===(l=e.content)||void 0===l?void 0:l.length)>0&&(i.addNextEpPreview(t,u),m&&m())})}}else i.addNextEpPreview(t,u);null!=u&&u.liveVideo||n.isMobile()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===v||r.initiateTrickplay(t)}),d.one("play",function(){var l,i,r,n;null!==(l=window)&&void 0!==l&&null!==(i=l.customData)&&void 0!==i&&i.iframeOverlayUrl&&e.addOutputtingOverlay(t,null===(r=window)||void 0===r||null===(n=r.customData)||void 0===n?void 0:n.iframeOverlayUrl)}))}var v=function(e,i){var r,n,o,u,a,d,v,s,c,p,b,g,y=l.getPlayer(e),m=(null==i?void 0:i.theme)||{},q=t.dom.$(".vjs-play-progress"),h=t.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");h&&(h.style.color="".concat(null===(r=window)||void 0===r||null===(n=r.app_data)||void 0===n||null===(o=n.appcmsMain)||void 0===o||null===(u=o.brand)||void 0===u||null===(a=u.cta)||void 0===a||null===(d=a.primary)||void 0===d?void 0:d.backgroundColor)),q&&(q.style.background="".concat(null===(v=window)||void 0===v||null===(s=v.app_data)||void 0===s||null===(c=s.appcmsMain)||void 0===c||null===(p=c.brand)||void 0===p||null===(b=p.cta)||void 0===b||null===(g=b.primary)||void 0===g?void 0:g.backgroundColor));var f=y.getChild("BigPlayButton")||null;(null==m?void 0:m.progressBarColor)&&q&&(q.style.background=m.progressBarColor),(null==m?void 0:m.playButtonBackgroundColor)&&f&&(f.el().style.background=m.playButtonBackgroundColor),(null==m?void 0:m.playButtonColor)&&h&&(h.style.color=m.playButtonColor),(null==m?void 0:m.playButtonType)&&("square"==(null==m?void 0:m.playButtonType)?f.el().style.borderRadius=".3em":f.el().style.borderRadius="1.3em")};exports.initialiseSkin=function(r,n){l.getPlayer(r).addClass("skin_vlone"),d(r,n),function(r,n){var t,d,v,s,c,p,b,g=l.getPlayer(r),y=(null==n?void 0:n.liveVideo)||!1,m=(null==n||null===(t=n.res)||void 0===t?void 0:t.contentType)||"video",q=(null==n||null===(d=n.res)||void 0===d||null===(v=d[m])||void 0===v?void 0:v.isSSAIEnabled)||!1,h=u.getSource(null==n?void 0:n.res,r)||{};h.src;var f=(null==n?void 0:n.skin_settings)||{},k=(null==n||null===(s=n.customData)||void 0===s?void 0:s.ads)||{};if(y&&(null==n||!n.liveui)){var j,w=null==g||null===(j=g.controlBar)||void 0===j?void 0:j.getChild("LiveDisplay"),C=(null==w?void 0:w.el())||null,S=null==C?void 0:C.querySelector(".vjs-live-display");if(C&&S){var V,T,B=document.createElement("button");B.type="button",B.className="vjs-live-display",B.setAttribute("aria-label","live"),B.textContent="LIVE";var M=function(){try{var e;null==g||null===(e=g.liveTracker)||void 0===e||e.seekToLiveEdge()}catch(e){console.log(e,"Cannot seek to LE")}};B.addEventListener("click",M),S.replaceWith(B),w&&(w.contentEl_=B);var A=live_button_el.querySelector(".vjs-live-display")||live_button_el,P=function(){var e,l,i,r=null===(e=null==g||null===(l=g.liveTracker)||void 0===l||null===(i=l.atLiveEdge)||void 0===i?void 0:i.call(l))||void 0===e||e;A.classList.toggle("vjs-behind-live",!r)};null==g||null===(V=g.liveTracker)||void 0===V||null===(T=V.on)||void 0===T||T.call(V,"liveedgechange",P),P(),C.removeAttribute("tabindex"),C.removeAttribute("role"),C.removeAttribute("aria-label")}}null!=f&&f.skipBtn&&0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)&&e.addSkipButton(r,"VL_ONE",a.SkipSvgV2());(null!=f&&f.rewindBtn&&0==(null==n?void 0:n.liveVideo)&&0==(null==n?void 0:n.liveui)||1==(null==n?void 0:n.liveui))&&e.addRewindButton(r,"VL_ONE",a.RewindSvgV2());var E,_=o.relatedVideosManager.get();(null==_||null===(c=_.content)||void 0===c?void 0:c.length)>0&&e.addVideoSelector(r,_);E=o.relatedVideosManager.subscribe(function(i){var n,o,t=l.getPlayer(r);(null==t||null===(n=t.controlBar)||void 0===n||!n.getChild("videoSelector"))&&(null==i||null===(o=i.content)||void 0===o?void 0:o.length)>0&&(e.addVideoSelector(r,i),E&&E())}),null!=n&&null!==(p=n.series)&&void 0!==p&&p.enable&&e.addSeriesSelectorV2(r,n);(null==n||null===(b=n.streams)||void 0===b?void 0:b.length)>1&&e.addMulticamSelector(r,null==n?void 0:n.streams);if(i.addTVProviderImage(r,n),u.initialiseKeyboardEvents(r,n),q&&y&&"TRANSMIT"==(null==k?void 0:k.liveAdSticherProvider)&&!(null==k||!k.liveAdClientSideTracking))u.initializeTransmit(r,n);else if("MEDIA_TAILOR"==(null==k?void 0:k.vodAdSticherProvider)&&null!=k&&k.vodAdClientSideTracking&&q)if(y)u.setupAdvertisementMarkersForLinear(r);else{var L,x=null;if(null!=n&&null!==(L=n.series)&&void 0!==L&&L.enable){var R,O,I,N,D,H=null===(R=u.getCurrentVideo())||void 0===R||null===(O=R.video)||void 0===O||null===(I=O.gist)||void 0===I?void 0:I.id,F=u.getSeriesWatchMap(),G=(null==F?void 0:F.get(H))||{t:0,p:0},U=G.t,W=G.p;"function"==typeof(null===(N=window)||void 0===N||null===(D=N.watchHistory)||void 0===D?void 0:D.cb)&&window.watchHistory.cb({watchedTime:U}),W<95&&(x=U)}else{var $=n.watchHistoryResumeTime;n.watchedPercentage<95&&(x=$)}u.setupAdvertisementMarkers(r,x)}}(r,n),v(r,n)};
@@ -1 +0,0 @@
1
- import{h as l,d as e,e as i,o,p as n,q as t}from"./features-631b5f6c.js";import{g as r}from"./skin-3653c5b3.js";import{a,b as d}from"./index-f09a905c.js";import{i as u}from"./index-796a5d7b.js";import{a as v}from"./browser-de5f6a74.js";import"videojs-contrib-quality-menu";import{r as s}from"./relatedVideosManager-81661348.js";import c from"video.js";import{f as p,a3 as m,a7 as b,a8 as y,e as f,a9 as g,m as h}from"./generic-0618f730.js";import{c as j,d as k}from"./icons-262bef63.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"./renditions-620d93b3.js";import"./localisation-0bf399a1.js";import"@babel/runtime/helpers/toConsumableArray";import"./autoNextVideo-0a43d4ba.js";import"./index-10e9934f.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/slicedToArray";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"axios";import"md5";import"js-cookie";import"./captions-1f931e14.js";import"@viewlift/comscore/index.js";function w(e,i){var o,n=r(e),t=(null==i||null===(o=i.res)||void 0===o?void 0:o.siteId)||"";n&&(n.on("loadeddata",function(){var l,o,n,d,c,p,m,b;!function(l){var e=r(l);e&&(null==e||e.qualityMenu,e.qualityMenu({useResolutionLabels:!0}))}(e);var y=(null===(l=s.get())||void 0===l||null===(o=l.content)||void 0===o?void 0:o.length)>0;if(!(null!=i&&null!==(n=i.series)&&void 0!==n&&n.enable||null!==(d=window)&&void 0!==d&&null!==(c=d.app_data)&&void 0!==c&&null!==(p=c.appcmsMain)&&void 0!==p&&null!==(m=p.features)&&void 0!==m&&m.auto_play||y)||null!=i&&i.liveVideo){if(!(null!=i&&i.liveVideo||null!=i&&null!==(b=i.series)&&void 0!==b&&b.enable)){var f;f=s.subscribe(function(l){var o;(null==l||null===(o=l.content)||void 0===o?void 0:o.length)>0&&(a(e,i),f&&f())})}}else a(e,i);null!=i&&i.liveVideo||v()||"b13633d9-f778-40c6-a5ea-c330617cdf55"===t||u(e)}),n.one("play",function(){var i,o,n,t;null!==(i=window)&&void 0!==i&&null!==(o=i.customData)&&void 0!==o&&o.iframeOverlayUrl&&l(e,null===(n=window)||void 0===n||null===(t=n.customData)||void 0===t?void 0:t.iframeOverlayUrl)}))}function C(l,a){r(l).addClass("skin_vlone"),w(l,a),function(l,a){var u,v,c,w,C,B,T,A=r(l),_=(null==a?void 0:a.liveVideo)||!1,E=(null==a||null===(u=a.res)||void 0===u?void 0:u.contentType)||"video",L=(null==a||null===(v=a.res)||void 0===v||null===(c=v[E])||void 0===c?void 0:c.isSSAIEnabled)||!1,V=p(null==a?void 0:a.res,l)||{};V.src;var S=(null==a?void 0:a.skin_settings)||{},x=(null==a||null===(w=a.customData)||void 0===w?void 0:w.ads)||{};if(_&&(null==a||!a.liveui)){var q,M=null==A||null===(q=A.controlBar)||void 0===q?void 0:q.getChild("LiveDisplay"),R=(null==M?void 0:M.el())||null,I=null==R?void 0:R.querySelector(".vjs-live-display");if(R&&I){var O,P,D=document.createElement("button");D.type="button",D.className="vjs-live-display",D.setAttribute("aria-label","live"),D.textContent="LIVE";var N=function(){try{var l;null==A||null===(l=A.liveTracker)||void 0===l||l.seekToLiveEdge()}catch(l){console.log(l,"Cannot seek to LE")}};D.addEventListener("click",N),I.replaceWith(D),M&&(M.contentEl_=D);var H=live_button_el.querySelector(".vjs-live-display")||live_button_el,G=function(){var l,e,i,o=null===(l=null==A||null===(e=A.liveTracker)||void 0===e||null===(i=e.atLiveEdge)||void 0===i?void 0:i.call(e))||void 0===l||l;H.classList.toggle("vjs-behind-live",!o)};null==A||null===(O=A.liveTracker)||void 0===O||null===(P=O.on)||void 0===P||P.call(O,"liveedgechange",G),G(),R.removeAttribute("tabindex"),R.removeAttribute("role"),R.removeAttribute("aria-label")}}null!=S&&S.skipBtn&&0==(null==a?void 0:a.liveVideo)&&0==(null==a?void 0:a.liveui)&&e(l,"VL_ONE",j());(null!=S&&S.rewindBtn&&0==(null==a?void 0:a.liveVideo)&&0==(null==a?void 0:a.liveui)||1==(null==a?void 0:a.liveui))&&i(l,"VL_ONE",k());var U,$=s.get();(null==$||null===(C=$.content)||void 0===C?void 0:C.length)>0&&o(l,$);U=s.subscribe(function(e){var i,n,t=r(l);(null==t||null===(i=t.controlBar)||void 0===i||!i.getChild("videoSelector"))&&(null==e||null===(n=e.content)||void 0===n?void 0:n.length)>0&&(o(l,e),U&&U())}),null!=a&&null!==(B=a.series)&&void 0!==B&&B.enable&&n(l,a);(null==a||null===(T=a.streams)||void 0===T?void 0:T.length)>1&&t(l,null==a?void 0:a.streams);if(d(l,a),m(l,a),L&&_&&"TRANSMIT"==(null==x?void 0:x.liveAdSticherProvider)&&!(null==x||!x.liveAdClientSideTracking))b(l,a);else if("MEDIA_TAILOR"==(null==x?void 0:x.vodAdSticherProvider)&&null!=x&&x.vodAdClientSideTracking&&L)if(_)y(l);else{var F,W=null;if(null!=a&&null!==(F=a.series)&&void 0!==F&&F.enable){var z,J,K,Q,X,Y=null===(z=f())||void 0===z||null===(J=z.video)||void 0===J||null===(K=J.gist)||void 0===K?void 0:K.id,Z=h(),ll=(null==Z?void 0:Z.get(Y))||{t:0,p:0},el=ll.t,il=ll.p;"function"==typeof(null===(Q=window)||void 0===Q||null===(X=Q.watchHistory)||void 0===X?void 0:X.cb)&&window.watchHistory.cb({watchedTime:el}),il<95&&(W=el)}else{var ol=a.watchHistoryResumeTime;a.watchedPercentage<95&&(W=ol)}g(l,W)}}(l,a),B(l,a)}var B=function(l,e){var i,o,n,t,a,d,u,v,s,p,m,b,y=r(l),f=(null==e?void 0:e.theme)||{},g=c.dom.$(".vjs-play-progress"),h=c.dom.$(".video-js .vjs-big-play-button .vjs-icon-placeholder");h&&(h.style.color="".concat(null===(i=window)||void 0===i||null===(o=i.app_data)||void 0===o||null===(n=o.appcmsMain)||void 0===n||null===(t=n.brand)||void 0===t||null===(a=t.cta)||void 0===a||null===(d=a.primary)||void 0===d?void 0:d.backgroundColor)),g&&(g.style.background="".concat(null===(u=window)||void 0===u||null===(v=u.app_data)||void 0===v||null===(s=v.appcmsMain)||void 0===s||null===(p=s.brand)||void 0===p||null===(m=p.cta)||void 0===m||null===(b=m.primary)||void 0===b?void 0:b.backgroundColor));var j=y.getChild("BigPlayButton")||null;(null==f?void 0:f.progressBarColor)&&g&&(g.style.background=f.progressBarColor),(null==f?void 0:f.playButtonBackgroundColor)&&j&&(j.el().style.background=f.playButtonBackgroundColor),(null==f?void 0:f.playButtonColor)&&h&&(h.style.color=f.playButtonColor),(null==f?void 0:f.playButtonType)&&("square"==(null==f?void 0:f.playButtonType)?j.el().style.borderRadius=".3em":j.el().style.borderRadius="1.3em")};export{C as initialiseSkin};