@beyondwords/player 0.1.41 → 0.1.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/es.js CHANGED
@@ -45,7 +45,7 @@ var Si = (t, e, i) => new Promise((n, o) => {
45
45
  }, a = (r) => r.done ? n(r.value) : Promise.resolve(r.value).then(s, l);
46
46
  a((i = i.apply(t, e)).next());
47
47
  });
48
- /*! version:"0.1.41" */
48
+ /*! version:"0.1.42" */
49
49
  function ee() {
50
50
  }
51
51
  const bu = (t) => t;
@@ -593,7 +593,7 @@ class we {
593
593
  }
594
594
  const xu = "4";
595
595
  typeof window != "undefined" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(xu);
596
- const Fu = "@beyondwords/player", Yo = "0.1.41", ci = (t, e) => {
596
+ const Fu = "@beyondwords/player", Yo = "0.1.42", ci = (t, e) => {
597
597
  t = [t].flat().join(`
598
598
  `);
599
599
  let i = `${Fu}:
@@ -18428,7 +18428,7 @@ function J2(t) {
18428
18428
  }
18429
18429
  function X2(t, e, i) {
18430
18430
  let n, o, s, l, a, r, u, c, g, v, _, m, w, y, A, S, C, T, I, M, R, Z, F, { playerApiUrl: U = "https://api.beyondwords.io/v1/projects/{id}/player" } = e, { projectId: ae = void 0 } = e, { contentId: ce = void 0 } = e, { playlistId: se = void 0 } = e, { sourceId: $ = void 0 } = e, { sourceUrl: Q = void 0 } = e, { playlist: re = [] } = e, { showUserInterface: de = !0 } = e, { showBottomWidget: Y = !1 } = e, { playerStyle: K = "standard" } = e, { playerTitle: te = void 0 } = e, { callToAction: b = void 0 } = e, { skipButtonStyle: P = "auto" } = e, { playlistStyle: j = "auto-5-4" } = e, { playlistToggle: L = "auto" } = e, { downloadFormats: Pe = [] } = e, { mediaSession: Ve = "auto" } = e, { content: Ue = [] } = e, { contentIndex: G = 0 } = e, { introsOutros: Te = [] } = e, { introsOutrosIndex: qe = -1 } = e, { adverts: Qe = [] } = e, { advertIndex: st = -1 } = e, { minDurationForMidroll: pt = 2 * 60 } = e, { minTimeUntilEndForMidroll: ut = 10 } = e, { persistentAdImage: Ye = !1 } = e, { persistentIndex: Re = -1 } = e, { duration: Ne = 0 } = e, { currentTime: gt = 0 } = e, { playbackState: ze = "stopped" } = e, { playbackRate: lt = 1 } = e, { playbackRates: $e = [0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 2, 2.5, 3] } = e, { widgetStyle: xe = "standard" } = e, { widgetPosition: jt = "auto" } = e, { widgetWidth: Je = "auto" } = e, { widgetTarget: Be = void 0 } = e, { textColor: We = "#111" } = e, { backgroundColor: Xe = "#f5f5f5" } = e, { iconColor: et = "rgba(0, 0, 0, 0.8)" } = e, { highlightColor: at = "#eee" } = e, { videoTextColor: Fe = "white" } = e, { videoBackgroundColor: Tt = "black" } = e, { videoIconColor: ft = "white" } = e, { logoIconEnabled: mt = !0 } = e, { highlightSections: He = "all" } = e, { clickableSections: Ze = "all" } = e, { segmentWidgetSections: tt = "body" } = e, { segmentWidgetPosition: H = "7-oclock" } = e, { currentSegment: Me = void 0 } = e, { hoveredSegment: je = void 0 } = e, { loadedMedia: ht = void 0 } = e, { advertConsent: St = "personalized" } = e, { analyticsConsent: Ge = "allowed" } = e, { analyticsCustomUrl: Ke = void 0 } = e, { analyticsDeviceType: It = "auto" } = e, { analyticsTag: rt = void 0 } = e, { writeToken: wt = void 0 } = e, { captureErrors: ct = !0 } = e, { onError: zt = () => {
18431
- } } = e, { transitions: Lt = [] } = e, { controlPanel: Dt = void 0 } = e, { clientSideIntegration: Pt = {} } = e;
18431
+ } } = e, { transitions: Lt = [] } = e, { controlPanel: Dt = void 0 } = e, { clientSideEnabled: Pt = !1 } = e;
18432
18432
  const _t = (...h) => ki.addEventListener(...h), _e = (...h) => ki.removeEventListener(...h);
18433
18433
  let { initialProps: k = {} } = e, { showMediaSession: V = !1 } = e, { metadataLoaded: ue = !1 } = e, { isFullScreen: Rt = !1 } = e, { mediaElement: Ht = void 0 } = e, { userInterface: di = void 0 } = e, { widgetInterface: Bt = void 0 } = e, { controller: ki = void 0 } = e, { logoImagePosition: si = void 0 } = e, { analyticsUrl: ln = void 0 } = e, { analyticsId: yt = void 0 } = e, { listenSessionId: Ci = void 0 } = e, { sessionCreatedAt: li = void 0 } = e, { companionAdvert: Ai = void 0 } = e, { isNewListen: Wt = !1 } = e, { prevPercentage: Nt = 0 } = e, { segmentWidgets: pi = [] } = e, { segmentContainers: Ot = new tl((h) => i(49, pi = h)) } = e, { segmentClickables: gi = new $s() } = e, { segmentHighlights: xt = new il() } = e;
18434
18434
  const zi = (h) => ki.processEvent(Kt({ emittedFrom: w }, h)), Yt = () => i(100, T = je);
@@ -18600,7 +18600,7 @@ function X2(t, e, i) {
18600
18600
  rt = h, i(44, rt);
18601
18601
  }
18602
18602
  return t.$$set = (h) => {
18603
- "playerApiUrl" in h && i(75, U = h.playerApiUrl), "projectId" in h && i(0, ae = h.projectId), "contentId" in h && i(1, ce = h.contentId), "playlistId" in h && i(2, se = h.playlistId), "sourceId" in h && i(3, $ = h.sourceId), "sourceUrl" in h && i(4, Q = h.sourceUrl), "playlist" in h && i(76, re = h.playlist), "showUserInterface" in h && i(5, de = h.showUserInterface), "showBottomWidget" in h && i(77, Y = h.showBottomWidget), "playerStyle" in h && i(6, K = h.playerStyle), "playerTitle" in h && i(24, te = h.playerTitle), "callToAction" in h && i(25, b = h.callToAction), "skipButtonStyle" in h && i(26, P = h.skipButtonStyle), "playlistStyle" in h && i(27, j = h.playlistStyle), "playlistToggle" in h && i(28, L = h.playlistToggle), "downloadFormats" in h && i(50, Pe = h.downloadFormats), "mediaSession" in h && i(29, Ve = h.mediaSession), "content" in h && i(51, Ue = h.content), "contentIndex" in h && i(7, G = h.contentIndex), "introsOutros" in h && i(52, Te = h.introsOutros), "introsOutrosIndex" in h && i(8, qe = h.introsOutrosIndex), "adverts" in h && i(53, Qe = h.adverts), "advertIndex" in h && i(9, st = h.advertIndex), "minDurationForMidroll" in h && i(78, pt = h.minDurationForMidroll), "minTimeUntilEndForMidroll" in h && i(79, ut = h.minTimeUntilEndForMidroll), "persistentAdImage" in h && i(30, Ye = h.persistentAdImage), "persistentIndex" in h && i(10, Re = h.persistentIndex), "duration" in h && i(31, Ne = h.duration), "currentTime" in h && i(11, gt = h.currentTime), "playbackState" in h && i(12, ze = h.playbackState), "playbackRate" in h && i(32, lt = h.playbackRate), "playbackRates" in h && i(54, $e = h.playbackRates), "widgetStyle" in h && i(13, xe = h.widgetStyle), "widgetPosition" in h && i(33, jt = h.widgetPosition), "widgetWidth" in h && i(34, Je = h.widgetWidth), "widgetTarget" in h && i(14, Be = h.widgetTarget), "textColor" in h && i(35, We = h.textColor), "backgroundColor" in h && i(36, Xe = h.backgroundColor), "iconColor" in h && i(37, et = h.iconColor), "highlightColor" in h && i(15, at = h.highlightColor), "videoTextColor" in h && i(38, Fe = h.videoTextColor), "videoBackgroundColor" in h && i(55, Tt = h.videoBackgroundColor), "videoIconColor" in h && i(39, ft = h.videoIconColor), "logoIconEnabled" in h && i(40, mt = h.logoIconEnabled), "highlightSections" in h && i(16, He = h.highlightSections), "clickableSections" in h && i(17, Ze = h.clickableSections), "segmentWidgetSections" in h && i(18, tt = h.segmentWidgetSections), "segmentWidgetPosition" in h && i(19, H = h.segmentWidgetPosition), "currentSegment" in h && i(20, Me = h.currentSegment), "hoveredSegment" in h && i(21, je = h.hoveredSegment), "loadedMedia" in h && i(80, ht = h.loadedMedia), "advertConsent" in h && i(41, St = h.advertConsent), "analyticsConsent" in h && i(42, Ge = h.analyticsConsent), "analyticsCustomUrl" in h && i(43, Ke = h.analyticsCustomUrl), "analyticsDeviceType" in h && i(81, It = h.analyticsDeviceType), "analyticsTag" in h && i(44, rt = h.analyticsTag), "writeToken" in h && i(82, wt = h.writeToken), "captureErrors" in h && i(83, ct = h.captureErrors), "onError" in h && i(84, zt = h.onError), "transitions" in h && i(85, Lt = h.transitions), "controlPanel" in h && i(22, Dt = h.controlPanel), "clientSideIntegration" in h && i(86, Pt = h.clientSideIntegration), "initialProps" in h && i(89, k = h.initialProps), "showMediaSession" in h && i(56, V = h.showMediaSession), "metadataLoaded" in h && i(23, ue = h.metadataLoaded), "isFullScreen" in h && i(57, Rt = h.isFullScreen), "mediaElement" in h && i(45, Ht = h.mediaElement), "userInterface" in h && i(46, di = h.userInterface), "widgetInterface" in h && i(47, Bt = h.widgetInterface), "controller" in h && i(90, ki = h.controller), "logoImagePosition" in h && i(58, si = h.logoImagePosition), "analyticsUrl" in h && i(91, ln = h.analyticsUrl), "analyticsId" in h && i(92, yt = h.analyticsId), "listenSessionId" in h && i(93, Ci = h.listenSessionId), "sessionCreatedAt" in h && i(94, li = h.sessionCreatedAt), "companionAdvert" in h && i(59, Ai = h.companionAdvert), "isNewListen" in h && i(95, Wt = h.isNewListen), "prevPercentage" in h && i(48, Nt = h.prevPercentage), "segmentWidgets" in h && i(49, pi = h.segmentWidgets), "segmentContainers" in h && i(96, Ot = h.segmentContainers), "segmentClickables" in h && i(97, gi = h.segmentClickables), "segmentHighlights" in h && i(98, xt = h.segmentHighlights);
18603
+ "playerApiUrl" in h && i(75, U = h.playerApiUrl), "projectId" in h && i(0, ae = h.projectId), "contentId" in h && i(1, ce = h.contentId), "playlistId" in h && i(2, se = h.playlistId), "sourceId" in h && i(3, $ = h.sourceId), "sourceUrl" in h && i(4, Q = h.sourceUrl), "playlist" in h && i(76, re = h.playlist), "showUserInterface" in h && i(5, de = h.showUserInterface), "showBottomWidget" in h && i(77, Y = h.showBottomWidget), "playerStyle" in h && i(6, K = h.playerStyle), "playerTitle" in h && i(24, te = h.playerTitle), "callToAction" in h && i(25, b = h.callToAction), "skipButtonStyle" in h && i(26, P = h.skipButtonStyle), "playlistStyle" in h && i(27, j = h.playlistStyle), "playlistToggle" in h && i(28, L = h.playlistToggle), "downloadFormats" in h && i(50, Pe = h.downloadFormats), "mediaSession" in h && i(29, Ve = h.mediaSession), "content" in h && i(51, Ue = h.content), "contentIndex" in h && i(7, G = h.contentIndex), "introsOutros" in h && i(52, Te = h.introsOutros), "introsOutrosIndex" in h && i(8, qe = h.introsOutrosIndex), "adverts" in h && i(53, Qe = h.adverts), "advertIndex" in h && i(9, st = h.advertIndex), "minDurationForMidroll" in h && i(78, pt = h.minDurationForMidroll), "minTimeUntilEndForMidroll" in h && i(79, ut = h.minTimeUntilEndForMidroll), "persistentAdImage" in h && i(30, Ye = h.persistentAdImage), "persistentIndex" in h && i(10, Re = h.persistentIndex), "duration" in h && i(31, Ne = h.duration), "currentTime" in h && i(11, gt = h.currentTime), "playbackState" in h && i(12, ze = h.playbackState), "playbackRate" in h && i(32, lt = h.playbackRate), "playbackRates" in h && i(54, $e = h.playbackRates), "widgetStyle" in h && i(13, xe = h.widgetStyle), "widgetPosition" in h && i(33, jt = h.widgetPosition), "widgetWidth" in h && i(34, Je = h.widgetWidth), "widgetTarget" in h && i(14, Be = h.widgetTarget), "textColor" in h && i(35, We = h.textColor), "backgroundColor" in h && i(36, Xe = h.backgroundColor), "iconColor" in h && i(37, et = h.iconColor), "highlightColor" in h && i(15, at = h.highlightColor), "videoTextColor" in h && i(38, Fe = h.videoTextColor), "videoBackgroundColor" in h && i(55, Tt = h.videoBackgroundColor), "videoIconColor" in h && i(39, ft = h.videoIconColor), "logoIconEnabled" in h && i(40, mt = h.logoIconEnabled), "highlightSections" in h && i(16, He = h.highlightSections), "clickableSections" in h && i(17, Ze = h.clickableSections), "segmentWidgetSections" in h && i(18, tt = h.segmentWidgetSections), "segmentWidgetPosition" in h && i(19, H = h.segmentWidgetPosition), "currentSegment" in h && i(20, Me = h.currentSegment), "hoveredSegment" in h && i(21, je = h.hoveredSegment), "loadedMedia" in h && i(80, ht = h.loadedMedia), "advertConsent" in h && i(41, St = h.advertConsent), "analyticsConsent" in h && i(42, Ge = h.analyticsConsent), "analyticsCustomUrl" in h && i(43, Ke = h.analyticsCustomUrl), "analyticsDeviceType" in h && i(81, It = h.analyticsDeviceType), "analyticsTag" in h && i(44, rt = h.analyticsTag), "writeToken" in h && i(82, wt = h.writeToken), "captureErrors" in h && i(83, ct = h.captureErrors), "onError" in h && i(84, zt = h.onError), "transitions" in h && i(85, Lt = h.transitions), "controlPanel" in h && i(22, Dt = h.controlPanel), "clientSideEnabled" in h && i(86, Pt = h.clientSideEnabled), "initialProps" in h && i(89, k = h.initialProps), "showMediaSession" in h && i(56, V = h.showMediaSession), "metadataLoaded" in h && i(23, ue = h.metadataLoaded), "isFullScreen" in h && i(57, Rt = h.isFullScreen), "mediaElement" in h && i(45, Ht = h.mediaElement), "userInterface" in h && i(46, di = h.userInterface), "widgetInterface" in h && i(47, Bt = h.widgetInterface), "controller" in h && i(90, ki = h.controller), "logoImagePosition" in h && i(58, si = h.logoImagePosition), "analyticsUrl" in h && i(91, ln = h.analyticsUrl), "analyticsId" in h && i(92, yt = h.analyticsId), "listenSessionId" in h && i(93, Ci = h.listenSessionId), "sessionCreatedAt" in h && i(94, li = h.sessionCreatedAt), "companionAdvert" in h && i(59, Ai = h.companionAdvert), "isNewListen" in h && i(95, Wt = h.isNewListen), "prevPercentage" in h && i(48, Nt = h.prevPercentage), "segmentWidgets" in h && i(49, pi = h.segmentWidgets), "segmentContainers" in h && i(96, Ot = h.segmentContainers), "segmentClickables" in h && i(97, gi = h.segmentClickables), "segmentHighlights" in h && i(98, xt = h.segmentHighlights);
18604
18604
  }, t.$$.update = () => {
18605
18605
  t.$$.dirty[0] & /*contentIndex*/
18606
18606
  128 | t.$$.dirty[1] & /*content*/
@@ -18899,7 +18899,7 @@ let Q2 = class extends we {
18899
18899
  onError: 84,
18900
18900
  transitions: 85,
18901
18901
  controlPanel: 22,
18902
- clientSideIntegration: 86,
18902
+ clientSideEnabled: 86,
18903
18903
  addEventListener: 87,
18904
18904
  removeEventListener: 88,
18905
18905
  initialProps: 89,
@@ -19294,11 +19294,11 @@ let Q2 = class extends we {
19294
19294
  set controlPanel(e) {
19295
19295
  this.$$set({ controlPanel: e }), d();
19296
19296
  }
19297
- get clientSideIntegration() {
19297
+ get clientSideEnabled() {
19298
19298
  return this.$$.ctx[86];
19299
19299
  }
19300
- set clientSideIntegration(e) {
19301
- this.$$set({ clientSideIntegration: e }), d();
19300
+ set clientSideEnabled(e) {
19301
+ this.$$set({ clientSideEnabled: e }), d();
19302
19302
  }
19303
19303
  get addEventListener() {
19304
19304
  return this.$$.ctx[87];
@@ -19436,15 +19436,8 @@ class $2 {
19436
19436
  Ae(this, yn);
19437
19437
  this.baseUrl = e == null ? void 0 : e.replace("{id}", i), this.headers = {
19438
19438
  "X-Referer": window.location.href,
19439
- "X-Import": n == null ? void 0 : n.enabled,
19440
- "X-Author": n == null ? void 0 : n.contentAuthor,
19441
- "X-Title": n == null ? void 0 : n.contentTitle,
19442
- "X-Publish-Date": n == null ? void 0 : n.publishDate,
19443
- "X-Published": n == null ? void 0 : n.published,
19444
- "X-Ads-Enabled": n == null ? void 0 : n.adsEnabled
19439
+ "X-Import": !!n
19445
19440
  };
19446
- for (const o of Object.keys(this.headers))
19447
- typeof this.headers[o] == "undefined" && delete this.headers[o];
19448
19441
  }
19449
19442
  byContentId(e) {
19450
19443
  return N(this, yn, zn).call(this, `by_content_id/${e}`);
@@ -19466,7 +19459,7 @@ yn = new WeakSet(), zn = function(e) {
19466
19459
  return vl(`${this.baseUrl}/${e}`, { headers: this.headers });
19467
19460
  };
19468
19461
  const ll = (t) => typeof t != "object" || t === null ? t : Array.isArray(t) ? t.map(ll) : Object.fromEntries(Object.entries(t).map(([e, i]) => [e.replace(/([A-Z])/g, (n) => `_${n.toLowerCase()}`), ll(i)])), Or = (t) => t === "dark" || t === "auto" && ev() ? "dark" : "light", ev = () => window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches, Ra = (t) => Si(void 0, null, function* () {
19469
- const e = new $2(t.playerApiUrl, t.projectId, t.clientSideIntegration);
19462
+ const e = new $2(t.playerApiUrl, t.projectId, t.clientSideEnabled);
19470
19463
  if (!t.playerApiUrl || !t.projectId)
19471
19464
  return;
19472
19465
  const i = tv(t);