@wistia/wistia-player 0.0.114 → 0.1.0

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.
Files changed (34) hide show
  1. package/dist/types/embeds/carousel/CarouseItemsList.d.ts +14 -0
  2. package/dist/types/embeds/carousel/CarouseItemsList.d.ts.map +1 -0
  3. package/dist/types/embeds/carousel/WistiaCarousel.d.ts +2 -1
  4. package/dist/types/embeds/carousel/WistiaCarousel.d.ts.map +1 -1
  5. package/dist/types/embeds/carousel/{CarouselMedia.d.ts → channelCarousel/CarouselMedia.d.ts} +2 -2
  6. package/dist/types/embeds/carousel/channelCarousel/CarouselMedia.d.ts.map +1 -0
  7. package/dist/types/embeds/carousel/channelCarousel/ChannelCarousel.d.ts +8 -0
  8. package/dist/types/embeds/carousel/channelCarousel/ChannelCarousel.d.ts.map +1 -0
  9. package/dist/types/embeds/carousel/header/CarouselHeader.d.ts +8 -0
  10. package/dist/types/embeds/carousel/header/CarouselHeader.d.ts.map +1 -0
  11. package/dist/types/embeds/carousel/header/NextIcon.d.ts.map +1 -0
  12. package/dist/types/embeds/carousel/header/PreviousIcon.d.ts.map +1 -0
  13. package/dist/types/embeds/playlist/WistiaPlaylist.d.ts.map +1 -1
  14. package/dist/types/embeds/shared/components/HardWall/HardWall.d.ts +2 -1
  15. package/dist/types/embeds/shared/components/HardWall/HardWall.d.ts.map +1 -1
  16. package/dist/types/embeds/shared/components/HardWall/HardWallWithPasswordForm.d.ts +2 -1
  17. package/dist/types/embeds/shared/components/HardWall/HardWallWithPasswordForm.d.ts.map +1 -1
  18. package/dist/types/embeds/shared/components/HardWall/PasswordForm.d.ts +2 -1
  19. package/dist/types/embeds/shared/components/HardWall/PasswordForm.d.ts.map +1 -1
  20. package/dist/types/embeds/wistiaPlayer/WistiaPlayer.d.ts +6 -0
  21. package/dist/types/embeds/wistiaPlayer/WistiaPlayer.d.ts.map +1 -1
  22. package/dist/types/types/player-api-types.d.ts +32 -8
  23. package/dist/types/types/player-api-types.d.ts.map +1 -1
  24. package/dist/types/utilities/sentryUtils.d.ts.map +1 -1
  25. package/dist/wistia-player.js +185 -116
  26. package/dist/wistia-player.js.map +1 -1
  27. package/package.json +2 -2
  28. package/dist/types/embeds/carousel/CarouselComponent.d.ts +0 -10
  29. package/dist/types/embeds/carousel/CarouselComponent.d.ts.map +0 -1
  30. package/dist/types/embeds/carousel/CarouselMedia.d.ts.map +0 -1
  31. package/dist/types/embeds/carousel/NextIcon.d.ts.map +0 -1
  32. package/dist/types/embeds/carousel/PreviousIcon.d.ts.map +0 -1
  33. /package/dist/types/embeds/carousel/{NextIcon.d.ts → header/NextIcon.d.ts} +0 -0
  34. /package/dist/types/embeds/carousel/{PreviousIcon.d.ts → header/PreviousIcon.d.ts} +0 -0
@@ -2426,6 +2426,7 @@ var standardSvgAttrs = function standardSvgAttrs(_ref) {
2426
2426
 
2427
2427
 
2428
2428
  var generateAudioJsonLd = function generateAudioJsonLd(mediaData) {
2429
+ var _embedOptions;
2429
2430
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2430
2431
  var videoWidth = options.videoWidth,
2431
2432
  videoHeight = options.videoHeight;
@@ -2444,7 +2445,7 @@ var generateAudioJsonLd = function generateAudioJsonLd(mediaData) {
2444
2445
  protocol: 'https:',
2445
2446
  videoWidth: videoWidth,
2446
2447
  videoHeight: videoHeight,
2447
- embedHost: embedOptions.embedHost
2448
+ embedHost: (_embedOptions = embedOptions) === null || _embedOptions === void 0 ? void 0 : _embedOptions.embedHost
2448
2449
  }),
2449
2450
  contentUrl: generateContentUrl(mediaData),
2450
2451
  embedUrl: generateEmbedUrl(mediaData, embedOptions),
@@ -2491,12 +2492,14 @@ var generateContentUrl = function generateContentUrl(mediaData) {
2491
2492
  return url.absolute();
2492
2493
  };
2493
2494
  var generateVideoJsonLd = function generateVideoJsonLd(mediaData) {
2495
+ var _embedOptions2;
2494
2496
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2495
2497
  var videoWidth = options.videoWidth,
2496
2498
  videoHeight = options.videoHeight;
2497
2499
  var embedOptions = options.embedOptions;
2498
2500
  if (!embedOptions) {
2499
- embedOptions = (0,utilities_obj_js__WEBPACK_IMPORTED_MODULE_0__/* .cast */ .wg)((0,utilities_obj_js__WEBPACK_IMPORTED_MODULE_0__/* .clone */ .o8)(mediaData.embedOptions));
2501
+ var _cast;
2502
+ embedOptions = (_cast = (0,utilities_obj_js__WEBPACK_IMPORTED_MODULE_0__/* .cast */ .wg)((0,utilities_obj_js__WEBPACK_IMPORTED_MODULE_0__/* .clone */ .o8)(mediaData.embedOptions))) !== null && _cast !== void 0 ? _cast : {};
2500
2503
  }
2501
2504
  var obj = {
2502
2505
  '@context': 'http://schema.org/',
@@ -2509,7 +2512,7 @@ var generateVideoJsonLd = function generateVideoJsonLd(mediaData) {
2509
2512
  protocol: 'https:',
2510
2513
  videoWidth: videoWidth,
2511
2514
  videoHeight: videoHeight,
2512
- embedHost: embedOptions.embedHost
2515
+ embedHost: (_embedOptions2 = embedOptions) === null || _embedOptions2 === void 0 ? void 0 : _embedOptions2.embedHost
2513
2516
  }),
2514
2517
  embedUrl: generateEmbedUrl(mediaData, embedOptions),
2515
2518
  uploadDate: new Date(mediaData.createdAt * 1000).toISOString(),
@@ -2634,7 +2637,7 @@ var getSampleRatesByProductType = function getSampleRatesByProductType(productTy
2634
2637
  case 'channel':
2635
2638
  case 'form':
2636
2639
  case 'transcript':
2637
- return 0.25;
2640
+ return 1;
2638
2641
  case 'mediaPlayback':
2639
2642
  // These errors don't seem terribly useful for us, and it's not clear they are actionable.
2640
2643
  // Let's set a low sample rate for them.
@@ -2643,7 +2646,7 @@ var getSampleRatesByProductType = function getSampleRatesByProductType(productTy
2643
2646
  case 'other':
2644
2647
  case 'player':
2645
2648
  default:
2646
- return 0.1;
2649
+ return 1;
2647
2650
  }
2648
2651
  /* eslint-enable @typescript-eslint/no-magic-numbers */
2649
2652
  };
@@ -2746,6 +2749,7 @@ var reportError = function reportError(product, error, details) {
2746
2749
  Wistia._sentryScope.clear();
2747
2750
  Wistia._sentryScope.setTag('pillar', 'publish');
2748
2751
  Wistia._sentryScope.setTag('product', product);
2752
+ Wistia._sentryScope.setTag('url', window.location.href);
2749
2753
  if (isNonEmptyRecord(details)) {
2750
2754
  Wistia._sentryScope.setTags(details);
2751
2755
  }
@@ -6804,8 +6808,8 @@ var PROD_EMBED_HOST = 'embed.wistia.com';
6804
6808
  var PROD_SSL_EMBED_HOST = 'embed-ssl.wistia.com';
6805
6809
  var PROD_FASTLY_SSL_HOST = 'embed-fastly.wistia.com';
6806
6810
  var SSL_EMBED_HOST = "embed-ssl.wistia.com";
6807
- var TAGGED_VERSION = "0.0.114" || 0;
6808
- var CURRENT_SHA = (/* unused pure expression or super */ null && ("ea7e4e9f9355af36c1d3a1d44641681d64e3d999" || 0));
6811
+ var TAGGED_VERSION = "0.1.0" || 0;
6812
+ var CURRENT_SHA = (/* unused pure expression or super */ null && ("a062b9c1581bb369cb526202cc8df207cd923ef3" || 0));
6809
6813
  var DEFAULT_PROTOCOL = function () {
6810
6814
  if (typeof window !== 'undefined' && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__/* .root */ .z === window && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__/* .root */ .z.location) {
6811
6815
  return utilities_root_js__WEBPACK_IMPORTED_MODULE_0__/* .root */ .z.location.protocol;
@@ -14823,7 +14827,7 @@ var WistiaPlayer = /*#__PURE__*/function (_HTMLElement) {
14823
14827
  _this2.uniqueId = _assertClassBrand(_WistiaPlayer_brand, _this2, _generateUniqueId).call(_this2, event.detail.mediaId);
14824
14828
 
14825
14829
  // When we replace, we're getting new media data, and the function we return
14826
- // is based of the current media data.
14830
+ // is based off the current media data.
14827
14831
  _classPrivateFieldSet(_cachedRemapTime, _this2, undefined);
14828
14832
  });
14829
14833
  _classPrivateFieldInitSpec(_this2, _handlePreloadThumbnailClick, function () {
@@ -16976,8 +16980,8 @@ var WistiaPlayer = /*#__PURE__*/function (_HTMLElement) {
16976
16980
  case 0:
16977
16981
  return _context12.abrupt("return", new Promise(function (resolve, reject) {
16978
16982
  var _classPrivateFieldGet80;
16979
- if ((_classPrivateFieldGet80 = _classPrivateFieldGet(_api, _this7)) !== null && _classPrivateFieldGet80 !== void 0 && _classPrivateFieldGet80.plugin(name)) {
16980
- resolve(_classPrivateFieldGet(_api, _this7).plugin(name));
16983
+ if ((_classPrivateFieldGet80 = _classPrivateFieldGet(_api, _this7)) !== null && _classPrivateFieldGet80 !== void 0 && _classPrivateFieldGet80.plugin && name in _classPrivateFieldGet(_api, _this7).plugin) {
16984
+ resolve(_classPrivateFieldGet(_api, _this7).plugin[name]);
16981
16985
  }
16982
16986
  reject(new Error("plugin ".concat(name, " is not defined")));
16983
16987
  }));
@@ -17420,32 +17424,61 @@ var WistiaPlayer = /*#__PURE__*/function (_HTMLElement) {
17420
17424
  return _showPopover.apply(this, arguments);
17421
17425
  }
17422
17426
  return showPopover;
17423
- }())
17427
+ }()
17428
+ /**
17429
+ * Updates the embed options for the player.
17430
+ * @param {Partial<EmbedOptions>} options - The new embed options to set.
17431
+ * @returns {Promise<EmbedOptions>} The updated embed options.
17432
+ */
17433
+ )
17424
17434
  }, {
17425
- key: "whenApiReady",
17426
- value: function () {
17427
- var _whenApiReady = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
17435
+ key: "updateEmbedOptions",
17436
+ value: (function () {
17437
+ var _updateEmbedOptions = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24(options) {
17428
17438
  var _this13 = this;
17429
17439
  return _regeneratorRuntime().wrap(function _callee24$(_context24) {
17430
17440
  while (1) switch (_context24.prev = _context24.next) {
17431
17441
  case 0:
17432
17442
  return _context24.abrupt("return", new Promise(function (resolve) {
17433
- if (_classPrivateFieldGet(_api, _this13)) {
17434
- _classPrivateFieldGet(_api, _this13).ready(function () {
17443
+ _assertClassBrand(_WistiaPlayer_brand, _this13, _setMultipleSyncedEmbedOptions).call(_this13, options);
17444
+ resolve(_this13.embedOptions);
17445
+ }));
17446
+ case 1:
17447
+ case "end":
17448
+ return _context24.stop();
17449
+ }
17450
+ }, _callee24);
17451
+ }));
17452
+ function updateEmbedOptions(_x18) {
17453
+ return _updateEmbedOptions.apply(this, arguments);
17454
+ }
17455
+ return updateEmbedOptions;
17456
+ }())
17457
+ }, {
17458
+ key: "whenApiReady",
17459
+ value: function () {
17460
+ var _whenApiReady = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
17461
+ var _this14 = this;
17462
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
17463
+ while (1) switch (_context25.prev = _context25.next) {
17464
+ case 0:
17465
+ return _context25.abrupt("return", new Promise(function (resolve) {
17466
+ if (_classPrivateFieldGet(_api, _this14)) {
17467
+ _classPrivateFieldGet(_api, _this14).ready(function () {
17435
17468
  resolve();
17436
17469
  });
17437
17470
  }
17438
17471
  var _handler2 = function handler() {
17439
- _this13.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .API_READY_EVENT */ .c5, _handler2);
17472
+ _this14.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .API_READY_EVENT */ .c5, _handler2);
17440
17473
  resolve();
17441
17474
  };
17442
- _this13.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .API_READY_EVENT */ .c5, _handler2);
17475
+ _this14.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .API_READY_EVENT */ .c5, _handler2);
17443
17476
  }));
17444
17477
  case 1:
17445
17478
  case "end":
17446
- return _context24.stop();
17479
+ return _context25.stop();
17447
17480
  }
17448
- }, _callee24);
17481
+ }, _callee25);
17449
17482
  }));
17450
17483
  function whenApiReady() {
17451
17484
  return _whenApiReady.apply(this, arguments);
@@ -17455,33 +17488,33 @@ var WistiaPlayer = /*#__PURE__*/function (_HTMLElement) {
17455
17488
  }, {
17456
17489
  key: "whenControlMounted",
17457
17490
  value: function () {
17458
- var _whenControlMounted = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25(handle) {
17491
+ var _whenControlMounted = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee26(handle) {
17459
17492
  var _classPrivateFieldGet92;
17460
17493
  var control;
17461
- return _regeneratorRuntime().wrap(function _callee25$(_context25) {
17462
- while (1) switch (_context25.prev = _context25.next) {
17494
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
17495
+ while (1) switch (_context26.prev = _context26.next) {
17463
17496
  case 0:
17464
- _context25.next = 2;
17497
+ _context26.next = 2;
17465
17498
  return this.whenApiReady();
17466
17499
  case 2:
17467
- _context25.next = 4;
17500
+ _context26.next = 4;
17468
17501
  return (_classPrivateFieldGet92 = _classPrivateFieldGet(_api, this)) === null || _classPrivateFieldGet92 === void 0 ? void 0 : _classPrivateFieldGet92.whenControlMounted(handle);
17469
17502
  case 4:
17470
- control = _context25.sent;
17503
+ control = _context26.sent;
17471
17504
  if (control) {
17472
- _context25.next = 7;
17505
+ _context26.next = 7;
17473
17506
  break;
17474
17507
  }
17475
17508
  throw new Error('Control not found');
17476
17509
  case 7:
17477
- return _context25.abrupt("return", control);
17510
+ return _context26.abrupt("return", control);
17478
17511
  case 8:
17479
17512
  case "end":
17480
- return _context25.stop();
17513
+ return _context26.stop();
17481
17514
  }
17482
- }, _callee25, this);
17515
+ }, _callee26, this);
17483
17516
  }));
17484
- function whenControlMounted(_x18) {
17517
+ function whenControlMounted(_x19) {
17485
17518
  return _whenControlMounted.apply(this, arguments);
17486
17519
  }
17487
17520
  return whenControlMounted;
@@ -17535,7 +17568,7 @@ var WistiaPlayer = /*#__PURE__*/function (_HTMLElement) {
17535
17568
  key: "connectedCallback",
17536
17569
  value: function connectedCallback() {
17537
17570
  var _window$wistiaOptions,
17538
- _this14 = this,
17571
+ _this15 = this,
17539
17572
  _this$embedHost;
17540
17573
  if (_classPrivateFieldGet(_hasElementConnectedToDOM, this)) {
17541
17574
  return;
@@ -17577,7 +17610,7 @@ var WistiaPlayer = /*#__PURE__*/function (_HTMLElement) {
17577
17610
  // Gather any attributes set on the element and save them so the public api can use them
17578
17611
  _assertClassBrand(_WistiaPlayer_brand, this, _saveInitialAttributesFromDomOptions).call(this);
17579
17612
  var resizeCallback = function resizeCallback() {
17580
- _assertClassBrand(_WistiaPlayer_brand, _this14, _renderPreloadThumbnail).call(_this14);
17613
+ _assertClassBrand(_WistiaPlayer_brand, _this15, _renderPreloadThumbnail).call(_this15);
17581
17614
  };
17582
17615
  _classPrivateFieldSet(_resizeObserver, this, new ResizeObserver(resizeCallback));
17583
17616
  _classPrivateFieldGet(_resizeObserver, this).observe(this);
@@ -17592,16 +17625,16 @@ var WistiaPlayer = /*#__PURE__*/function (_HTMLElement) {
17592
17625
  return;
17593
17626
  }
17594
17627
  var mediaData = mediaDataOrError;
17595
- _this14.mediaId = (_mediaData$hashedId = mediaData.hashedId) !== null && _mediaData$hashedId !== void 0 ? _mediaData$hashedId : _this14.mediaId;
17596
- _classPrivateFieldGet(_playerData, _this14).setMediaDataSource(mediaData);
17597
- _this14.dispatchEvent(new CustomEvent(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .LOADED_MEDIA_DATA_EVENT */ .rO, {
17628
+ _this15.mediaId = (_mediaData$hashedId = mediaData.hashedId) !== null && _mediaData$hashedId !== void 0 ? _mediaData$hashedId : _this15.mediaId;
17629
+ _classPrivateFieldGet(_playerData, _this15).setMediaDataSource(mediaData);
17630
+ _this15.dispatchEvent(new CustomEvent(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .LOADED_MEDIA_DATA_EVENT */ .rO, {
17598
17631
  detail: {
17599
- mediaData: _classPrivateFieldGet(_playerData, _this14).mediaData
17632
+ mediaData: _classPrivateFieldGet(_playerData, _this15).mediaData
17600
17633
  }
17601
17634
  }));
17602
- _assertClassBrand(_WistiaPlayer_brand, _this14, _initPlayerEmbed).call(_this14, {
17603
- container: _this14.uniqueId,
17604
- mediaData: _classPrivateFieldGet(_playerData, _this14).mediaData
17635
+ _assertClassBrand(_WistiaPlayer_brand, _this15, _initPlayerEmbed).call(_this15, {
17636
+ container: _this15.uniqueId,
17637
+ mediaData: _classPrivateFieldGet(_playerData, _this15).mediaData
17605
17638
  });
17606
17639
  }).catch(function (error) {
17607
17640
  (0,_utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_16__/* .countMetric */ .WO)('player/failure/init-failed');
@@ -17793,21 +17826,21 @@ function _initPlayerEmbed(_ref23) {
17793
17826
  * @param {EmbedOptions | PublicApiOptions | undefined} options - The public api options
17794
17827
  * @returns {Promise<void>}
17795
17828
  */
17796
- function _initPublicApi(_x22, _x23) {
17829
+ function _initPublicApi(_x23, _x24) {
17797
17830
  return _initPublicApi2.apply(this, arguments);
17798
17831
  }
17799
17832
  function _initPublicApi2() {
17800
- _initPublicApi2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28(mediaId, options) {
17801
- var _this20 = this;
17833
+ _initPublicApi2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29(mediaId, options) {
17834
+ var _this22 = this;
17802
17835
  var embeddedCallback;
17803
- return _regeneratorRuntime().wrap(function _callee28$(_context28) {
17804
- while (1) switch (_context28.prev = _context28.next) {
17836
+ return _regeneratorRuntime().wrap(function _callee29$(_context29) {
17837
+ while (1) switch (_context29.prev = _context29.next) {
17805
17838
  case 0:
17806
- _context28.next = 2;
17839
+ _context29.next = 2;
17807
17840
  return _classPrivateFieldGet(_publicApiScript, this);
17808
17841
  case 2:
17809
17842
  if (_wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_2__/* .Wistia */ .s.PublicApi) {
17810
- _context28.next = 5;
17843
+ _context29.next = 5;
17811
17844
  break;
17812
17845
  }
17813
17846
  (0,_utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_16__/* .countMetric */ .WO)('player/failure/init-failed');
@@ -17815,17 +17848,17 @@ function _initPublicApi2() {
17815
17848
  case 5:
17816
17849
  embeddedCallback = function embeddedCallback() {
17817
17850
  var _classPrivateFieldGet103;
17818
- void _assertClassBrand(_WistiaPlayer_brand, _this20, _maybeInitializeMux).call(_this20);
17819
- _assertClassBrand(_WistiaPlayer_brand, _this20, _renderEmbedTemplate).call(_this20);
17820
- (_classPrivateFieldGet103 = _classPrivateFieldGet(_resizeObserver, _this20)) === null || _classPrivateFieldGet103 === void 0 ? void 0 : _classPrivateFieldGet103.disconnect();
17821
- _classPrivateFieldSet(_resizeObserver, _this20, null);
17822
- if (_classPrivateFieldGet(_playPending, _this20)) {
17823
- void _this20.play();
17851
+ void _assertClassBrand(_WistiaPlayer_brand, _this22, _maybeInitializeMux).call(_this22);
17852
+ _assertClassBrand(_WistiaPlayer_brand, _this22, _renderEmbedTemplate).call(_this22);
17853
+ (_classPrivateFieldGet103 = _classPrivateFieldGet(_resizeObserver, _this22)) === null || _classPrivateFieldGet103 === void 0 ? void 0 : _classPrivateFieldGet103.disconnect();
17854
+ _classPrivateFieldSet(_resizeObserver, _this22, null);
17855
+ if (_classPrivateFieldGet(_playPending, _this22)) {
17856
+ void _this22.play();
17824
17857
  }
17825
17858
  };
17826
17859
  this.addEventListener('embedded', embeddedCallback);
17827
17860
  _classPrivateFieldGet(_removeEventListeners, this).push(function () {
17828
- _this20.removeEventListener('embedded', embeddedCallback);
17861
+ _this22.removeEventListener('embedded', embeddedCallback);
17829
17862
  });
17830
17863
 
17831
17864
  // Initialize!
@@ -17833,46 +17866,46 @@ function _initPublicApi2() {
17833
17866
  this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .BEFORE_REPLACE_EVENT */ .kY, _classPrivateFieldGet(_handleBeforeReplace, this));
17834
17867
  this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .AFTER_REPLACE_EVENT */ .$1, _classPrivateFieldGet(_handleAfterReplace, this));
17835
17868
  _classPrivateFieldGet(_removeEventListeners, this).push(function () {
17836
- _this20.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .BEFORE_REPLACE_EVENT */ .kY, _classPrivateFieldGet(_handleBeforeReplace, _this20));
17837
- _this20.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .AFTER_REPLACE_EVENT */ .$1, _classPrivateFieldGet(_handleAfterReplace, _this20));
17869
+ _this22.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .BEFORE_REPLACE_EVENT */ .kY, _classPrivateFieldGet(_handleBeforeReplace, _this22));
17870
+ _this22.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .AFTER_REPLACE_EVENT */ .$1, _classPrivateFieldGet(_handleAfterReplace, _this22));
17838
17871
  });
17839
17872
  _classPrivateFieldGet(_api, this).ready(function () {
17840
17873
  var _classPrivateFieldGet104;
17841
- (_classPrivateFieldGet104 = _classPrivateFieldGet(_preloadThumbnailRoot, _this20)) === null || _classPrivateFieldGet104 === void 0 ? void 0 : _classPrivateFieldGet104.remove();
17842
- _this20.removeEventListener('click', _classPrivateFieldGet(_handlePreloadThumbnailClick, _this20));
17874
+ (_classPrivateFieldGet104 = _classPrivateFieldGet(_preloadThumbnailRoot, _this22)) === null || _classPrivateFieldGet104 === void 0 ? void 0 : _classPrivateFieldGet104.remove();
17875
+ _this22.removeEventListener('click', _classPrivateFieldGet(_handlePreloadThumbnailClick, _this22));
17843
17876
  // event for public consumption, exposed on our event types
17844
- _this20.dispatchEvent(new CustomEvent(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .API_READY_EVENT */ .c5, {
17877
+ _this22.dispatchEvent(new CustomEvent(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .API_READY_EVENT */ .c5, {
17845
17878
  detail: {
17846
17879
  mediaId: mediaId
17847
17880
  }
17848
17881
  }));
17849
17882
 
17850
17883
  // event for internal consumption, not exposed on our event types
17851
- _this20.dispatchEvent(new CustomEvent(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .INTERNAL_API_ON_FIND_EVENT */ .iP, {
17884
+ _this22.dispatchEvent(new CustomEvent(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .INTERNAL_API_ON_FIND_EVENT */ .iP, {
17852
17885
  detail: {
17853
17886
  mediaId: mediaId,
17854
- api: _classPrivateFieldGet(_api, _this20)
17887
+ api: _classPrivateFieldGet(_api, _this22)
17855
17888
  }
17856
17889
  }));
17857
17890
 
17858
17891
  // Sync embed options from the public api back to the embed config
17859
- if (_classPrivateFieldGet(_impl, _this20)) {
17860
- Object.entries(_classPrivateFieldGet(_impl, _this20)._attrs).forEach(function (_ref29) {
17892
+ if (_classPrivateFieldGet(_impl, _this22)) {
17893
+ Object.entries(_classPrivateFieldGet(_impl, _this22)._attrs).forEach(function (_ref29) {
17861
17894
  var _ref30 = _slicedToArray(_ref29, 2),
17862
17895
  key = _ref30[0],
17863
17896
  value = _ref30[1];
17864
- _classPrivateFieldGet(_playerData, _this20).updateEmbedOptionOverrides(_defineProperty({}, key, value));
17897
+ _classPrivateFieldGet(_playerData, _this22).updateEmbedOptionOverrides(_defineProperty({}, key, value));
17865
17898
  });
17866
17899
  }
17867
17900
 
17868
17901
  // Updates our PlayerDataProvider and re-renders the thumbnail with the new embed options
17869
- _assertClassBrand(_WistiaPlayer_brand, _this20, _renderPreloadThumbnail).call(_this20);
17902
+ _assertClassBrand(_WistiaPlayer_brand, _this22, _renderPreloadThumbnail).call(_this22);
17870
17903
  });
17871
17904
  case 13:
17872
17905
  case "end":
17873
- return _context28.stop();
17906
+ return _context29.stop();
17874
17907
  }
17875
- }, _callee28, this);
17908
+ }, _callee29, this);
17876
17909
  }));
17877
17910
  return _initPublicApi2.apply(this, arguments);
17878
17911
  }
@@ -17892,29 +17925,29 @@ function _maybeInitializeMux() {
17892
17925
  return _maybeInitializeMux2.apply(this, arguments);
17893
17926
  }
17894
17927
  function _maybeInitializeMux2() {
17895
- _maybeInitializeMux2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
17896
- var _this21 = this;
17928
+ _maybeInitializeMux2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
17929
+ var _this23 = this;
17897
17930
  var shouldRandomEnableMux, shouldEnableMuxForPlayer, embedType, mux;
17898
- return _regeneratorRuntime().wrap(function _callee29$(_context29) {
17899
- while (1) switch (_context29.prev = _context29.next) {
17931
+ return _regeneratorRuntime().wrap(function _callee30$(_context30) {
17932
+ while (1) switch (_context30.prev = _context30.next) {
17900
17933
  case 0:
17901
17934
  if (_classPrivateFieldGet(_api, this)) {
17902
- _context29.next = 2;
17935
+ _context30.next = 2;
17903
17936
  break;
17904
17937
  }
17905
- return _context29.abrupt("return");
17938
+ return _context30.abrupt("return");
17906
17939
  case 2:
17907
17940
  shouldRandomEnableMux = (0,_utilities_coinFlip_ts__WEBPACK_IMPORTED_MODULE_33__/* .didWinCoinFlip */ .k)(_utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_34__/* .MUX_PERCENTAGE_TO_ENABLE */ ._);
17908
17941
  shouldEnableMuxForPlayer = (0,_utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_34__/* .shouldEnableMux */ .J)(_classPrivateFieldGet(_api, this), shouldRandomEnableMux) && (0,_utilities_trackingConsentApi_js__WEBPACK_IMPORTED_MODULE_17__/* .isVisitorTrackingEnabled */ .D5)();
17909
17942
  embedType = this.useWebComponent ? 'translated-web-component' : 'web-component';
17910
17943
  if (!shouldEnableMuxForPlayer) {
17911
- _context29.next = 11;
17944
+ _context30.next = 11;
17912
17945
  break;
17913
17946
  }
17914
- _context29.next = 8;
17947
+ _context30.next = 8;
17915
17948
  return (0,_utilities_dynamicImport_ts__WEBPACK_IMPORTED_MODULE_8__/* .dynamicImport */ .$)('assets/external/wistia-mux.js');
17916
17949
  case 8:
17917
- mux = _context29.sent;
17950
+ mux = _context30.sent;
17918
17951
  mux.init(_classPrivateFieldGet(_api, this), {
17919
17952
  embedType: embedType
17920
17953
  });
@@ -17922,14 +17955,14 @@ function _maybeInitializeMux2() {
17922
17955
  var isTrackingEnabled = event.detail.isTrackingEnabled;
17923
17956
  if (!isTrackingEnabled) {
17924
17957
  var _classPrivateFieldGet106, _classPrivateFieldGet107;
17925
- (_classPrivateFieldGet106 = _classPrivateFieldGet(_api, _this21)) === null || _classPrivateFieldGet106 === void 0 ? void 0 : (_classPrivateFieldGet107 = _classPrivateFieldGet106.mux) === null || _classPrivateFieldGet107 === void 0 ? void 0 : _classPrivateFieldGet107.destroy();
17958
+ (_classPrivateFieldGet106 = _classPrivateFieldGet(_api, _this23)) === null || _classPrivateFieldGet106 === void 0 ? void 0 : (_classPrivateFieldGet107 = _classPrivateFieldGet106.mux) === null || _classPrivateFieldGet107 === void 0 ? void 0 : _classPrivateFieldGet107.destroy();
17926
17959
  }
17927
17960
  });
17928
17961
  case 11:
17929
17962
  case "end":
17930
- return _context29.stop();
17963
+ return _context30.stop();
17931
17964
  }
17932
- }, _callee29, this);
17965
+ }, _callee30, this);
17933
17966
  }));
17934
17967
  return _maybeInitializeMux2.apply(this, arguments);
17935
17968
  }
@@ -17963,7 +17996,7 @@ function _maybeSetupEmbedOptionsFromIframe() {
17963
17996
  */
17964
17997
  function _renderEmbedTemplate() {
17965
17998
  var _this$embedHost2,
17966
- _this15 = this;
17999
+ _this16 = this;
17967
18000
  if (!_classPrivateFieldGet(_preactRoot, this)) {
17968
18001
  return;
17969
18002
  }
@@ -18014,7 +18047,7 @@ function _renderEmbedTemplate() {
18014
18047
  "aria-hidden": "true"
18015
18048
  })))), (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", {
18016
18049
  ref: function ref(_ref24) {
18017
- _classPrivateFieldSet(_preloadThumbnailRoot, _this15, _ref24);
18050
+ _classPrivateFieldSet(_preloadThumbnailRoot, _this16, _ref24);
18018
18051
  }
18019
18052
  })), _classPrivateFieldGet(_preactRoot, this));
18020
18053
  }
@@ -18063,19 +18096,19 @@ function _renderPreloadThumbnail() {
18063
18096
  * @private
18064
18097
  */
18065
18098
  function _runMethodsFromAttributes() {
18066
- var _this16 = this;
18099
+ var _this17 = this;
18067
18100
  // We have to wait until the api is ready to set the current time
18068
18101
  if (_assertClassBrand(_WistiaPlayer_brand, this, _getValueFromAttribute).call(this, 'current-time') !== null) {
18069
18102
  this.whenApiReady().then(function () {
18070
18103
  var _ref25, _classPrivateFieldGet99, _classPrivateFieldGet100;
18071
- var newTime = Number(_assertClassBrand(_WistiaPlayer_brand, _this16, _getValueFromAttribute).call(_this16, 'current-time'));
18072
- var isClosedPopover = (_ref25 = ((_classPrivateFieldGet99 = _classPrivateFieldGet(_api, _this16)) === null || _classPrivateFieldGet99 === void 0 ? void 0 : _classPrivateFieldGet99.popover) && !_classPrivateFieldGet(_api, _this16).popover.isVisible()) !== null && _ref25 !== void 0 ? _ref25 : false;
18104
+ var newTime = Number(_assertClassBrand(_WistiaPlayer_brand, _this17, _getValueFromAttribute).call(_this17, 'current-time'));
18105
+ var isClosedPopover = (_ref25 = ((_classPrivateFieldGet99 = _classPrivateFieldGet(_api, _this17)) === null || _classPrivateFieldGet99 === void 0 ? void 0 : _classPrivateFieldGet99.popover) && !_classPrivateFieldGet(_api, _this17).popover.isVisible()) !== null && _ref25 !== void 0 ? _ref25 : false;
18073
18106
  var isMobile = (0,_utilities_detect_js__WEBPACK_IMPORTED_MODULE_7__/* .detectIsMobile */ .GS)();
18074
- var shouldDelayUntilPlay = _this16.state !== 'playing' && (isMobile || isClosedPopover);
18075
- void ((_classPrivateFieldGet100 = _classPrivateFieldGet(_impl, _this16)) === null || _classPrivateFieldGet100 === void 0 ? void 0 : _classPrivateFieldGet100.time(newTime, {
18107
+ var shouldDelayUntilPlay = _this17.state !== 'playing' && (isMobile || isClosedPopover);
18108
+ void ((_classPrivateFieldGet100 = _classPrivateFieldGet(_impl, _this17)) === null || _classPrivateFieldGet100 === void 0 ? void 0 : _classPrivateFieldGet100.time(newTime, {
18076
18109
  lazy: shouldDelayUntilPlay
18077
18110
  }));
18078
- _assertClassBrand(_WistiaPlayer_brand, _this16, _setSyncedEmbedOption).call(_this16, 'currentTime', newTime);
18111
+ _assertClassBrand(_WistiaPlayer_brand, _this17, _setSyncedEmbedOption).call(_this17, 'currentTime', newTime);
18079
18112
  })
18080
18113
  // eslint-disable-next-line @typescript-eslint/no-empty-function
18081
18114
  .catch(function (_error) {});
@@ -18086,9 +18119,9 @@ function _runMethodsFromAttributes() {
18086
18119
  if (_assertClassBrand(_WistiaPlayer_brand, this, _getValueFromAttribute).call(this, 'video-quality') !== null) {
18087
18120
  this.whenApiReady().then(function () {
18088
18121
  var _classPrivateFieldGet101;
18089
- var newQuality = _assertClassBrand(_WistiaPlayer_brand, _this16, _getValueFromAttribute).call(_this16, 'video-quality');
18090
- (_classPrivateFieldGet101 = _classPrivateFieldGet(_impl, _this16)) === null || _classPrivateFieldGet101 === void 0 ? void 0 : _classPrivateFieldGet101.setVideoQuality(newQuality);
18091
- _assertClassBrand(_WistiaPlayer_brand, _this16, _setSyncedEmbedOption).call(_this16, 'videoQuality', newQuality);
18122
+ var newQuality = _assertClassBrand(_WistiaPlayer_brand, _this17, _getValueFromAttribute).call(_this17, 'video-quality');
18123
+ (_classPrivateFieldGet101 = _classPrivateFieldGet(_impl, _this17)) === null || _classPrivateFieldGet101 === void 0 ? void 0 : _classPrivateFieldGet101.setVideoQuality(newQuality);
18124
+ _assertClassBrand(_WistiaPlayer_brand, _this17, _setSyncedEmbedOption).call(_this17, 'videoQuality', newQuality);
18092
18125
  })
18093
18126
  // eslint-disable-next-line @typescript-eslint/no-empty-function
18094
18127
  .catch(function (_error) {});
@@ -18100,17 +18133,53 @@ function _runMethodsFromAttributes() {
18100
18133
  * @private
18101
18134
  */
18102
18135
  function _saveInitialAttributesFromDomOptions() {
18103
- var _this17 = this;
18136
+ var _this18 = this;
18104
18137
  var domOptions = Object.fromEntries(Object.entries(this.attributes).map(function (_ref26) {
18105
18138
  var _ref27 = _slicedToArray(_ref26, 2),
18106
18139
  value = _ref27[1];
18107
- return [(0,_utilities_camelCaseToKebabCase_ts__WEBPACK_IMPORTED_MODULE_30__/* .kebabCaseToCamelCase */ .b)(value.name), _assertClassBrand(_WistiaPlayer_brand, _this17, _getValueFromAttribute).call(_this17, value.name)];
18140
+ return [(0,_utilities_camelCaseToKebabCase_ts__WEBPACK_IMPORTED_MODULE_30__/* .kebabCaseToCamelCase */ .b)(value.name), _assertClassBrand(_WistiaPlayer_brand, _this18, _getValueFromAttribute).call(_this18, value.name)];
18108
18141
  }));
18109
18142
  _classPrivateFieldGet(_playerData, this).setDomEmbedOptionSource(domOptions);
18110
18143
 
18111
18144
  // The public api uses this store when it gathers options from our many different sources
18112
18145
  (0,_utilities_embedOptionStore_ts__WEBPACK_IMPORTED_MODULE_9__/* .setEmbedOptionStore */ .gY)("__".concat(this.uniqueId, "_dom_options__"), _classPrivateFieldGet(_playerData, this).embedOptions);
18113
18146
  }
18147
+ /**
18148
+ * Takes an object of embed options and sets both the value of an
18149
+ * embed option from the public api and the value of an embed option
18150
+ * saved on this element.
18151
+ *
18152
+ * For now, the public api is the source of truth for embed options.
18153
+ * However, this will change in the future. We also need a non-public
18154
+ * api source for embed options so we can use them before the public
18155
+ * api is ready.
18156
+ * @param {Partial<EmbedOptions>} options - Object of embed options
18157
+ * @returns {void}
18158
+ */
18159
+ function _setMultipleSyncedEmbedOptions(options) {
18160
+ var _this19 = this;
18161
+ Object.entries(options).forEach(function (entry) {
18162
+ var _Object$getOwnPropert;
18163
+ var _entry = _slicedToArray(entry, 2),
18164
+ key = _entry[0],
18165
+ value = _entry[1];
18166
+ // The TypeScript compiler is complaining because it thinks the value can never be undefined
18167
+ // based on the type definition, but we're being defensive here
18168
+ if (value == null) {
18169
+ return;
18170
+ }
18171
+
18172
+ // If the embed option has a setter, use that. Our setters call #setSyncedEmbedOption
18173
+ // which will update the public api and the embed option store, and importantly they
18174
+ // *also* run any specific functions that are needed for that embed option.
18175
+ if ((_Object$getOwnPropert = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(_this19), key)) !== null && _Object$getOwnPropert !== void 0 && _Object$getOwnPropert.set) {
18176
+ _this19[key] = value;
18177
+ } else {
18178
+ // Otherwise, we'll just run #setSyncedEmbedOption directly
18179
+ _assertClassBrand(_WistiaPlayer_brand, _this19, _setSyncedEmbedOption).call(_this19, key, value);
18180
+ }
18181
+ });
18182
+ }
18114
18183
  /**
18115
18184
  * Sets both the value of an embed option from the public api
18116
18185
  * and the value of an embed option saved on this element.
@@ -18135,21 +18204,21 @@ function _setSyncedEmbedOption(key, value) {
18135
18204
  _assertClassBrand(_WistiaPlayer_brand, this, _renderPreloadThumbnail).call(this);
18136
18205
  }
18137
18206
  function _setupEventListeners() {
18138
- var _this18 = this;
18207
+ var _this20 = this;
18139
18208
  var loadedMediaDataCallback = function loadedMediaDataCallback(event) {
18140
18209
  var _ref28 = event.detail,
18141
18210
  mediaData = _ref28.mediaData;
18142
- _assertClassBrand(_WistiaPlayer_brand, _this18, _updateMediaData).call(_this18, mediaData);
18211
+ _assertClassBrand(_WistiaPlayer_brand, _this20, _updateMediaData).call(_this20, mediaData);
18143
18212
  };
18144
18213
  var implCreatedCallback = function implCreatedCallback(event) {
18145
- _classPrivateFieldSet(_impl, _this18, event.detail.impl);
18214
+ _classPrivateFieldSet(_impl, _this20, event.detail.impl);
18146
18215
  };
18147
18216
  this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .LOADED_MEDIA_DATA_EVENT */ .rO, loadedMediaDataCallback);
18148
18217
  this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .IMPL_CREATED_EVENT */ .dp, implCreatedCallback);
18149
18218
  _classPrivateFieldGet(_removeEventListeners, this).push(function () {
18150
- _this18.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .LOADED_MEDIA_DATA_EVENT */ .rO, loadedMediaDataCallback);
18219
+ _this20.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .LOADED_MEDIA_DATA_EVENT */ .rO, loadedMediaDataCallback);
18151
18220
  }, function () {
18152
- _this18.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .IMPL_CREATED_EVENT */ .dp, implCreatedCallback);
18221
+ _this20.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__/* .IMPL_CREATED_EVENT */ .dp, implCreatedCallback);
18153
18222
  });
18154
18223
  this.addEventListener('click', _classPrivateFieldGet(_handlePreloadThumbnailClick, this), {
18155
18224
  once: true
@@ -18171,10 +18240,10 @@ function _shouldDisplaySwatch() {
18171
18240
  * @private
18172
18241
  */
18173
18242
  function _updateEmail(email) {
18174
- var _this19 = this;
18243
+ var _this21 = this;
18175
18244
  (0,_utilities_wistiaLocalStorage_js__WEBPACK_IMPORTED_MODULE_19__/* .updateWistiaLocalStorage */ .$B)(function (localStorage) {
18176
18245
  // eslint-disable-next-line no-param-reassign
18177
- localStorage[_classPrivateGetter(_WistiaPlayer_brand, _this19, _get_pageUrl)] = _objectSpread(_objectSpread({}, localStorage[_classPrivateGetter(_WistiaPlayer_brand, _this19, _get_pageUrl)]), {}, {
18246
+ localStorage[_classPrivateGetter(_WistiaPlayer_brand, _this21, _get_pageUrl)] = _objectSpread(_objectSpread({}, localStorage[_classPrivateGetter(_WistiaPlayer_brand, _this21, _get_pageUrl)]), {}, {
18178
18247
  trackEmail: email
18179
18248
  });
18180
18249
  });
@@ -18201,24 +18270,24 @@ function _updateMediaData(mediaData) {
18201
18270
  _assertClassBrand(_WistiaPlayer_brand, this, _renderPreloadThumbnail).call(this);
18202
18271
  }
18203
18272
  var getSwatchMetaData = /*#__PURE__*/function () {
18204
- var _ref19 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee26(url) {
18273
+ var _ref19 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27(url) {
18205
18274
  var swatch;
18206
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
18207
- while (1) switch (_context26.prev = _context26.next) {
18275
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
18276
+ while (1) switch (_context27.prev = _context27.next) {
18208
18277
  case 0:
18209
18278
  swatch = new Image();
18210
18279
  swatch.src = url;
18211
- _context26.next = 4;
18280
+ _context27.next = 4;
18212
18281
  return swatch.decode();
18213
18282
  case 4:
18214
- return _context26.abrupt("return", swatch);
18283
+ return _context27.abrupt("return", swatch);
18215
18284
  case 5:
18216
18285
  case "end":
18217
- return _context26.stop();
18286
+ return _context27.stop();
18218
18287
  }
18219
- }, _callee26);
18288
+ }, _callee27);
18220
18289
  }));
18221
- return function getSwatchMetaData(_x19) {
18290
+ return function getSwatchMetaData(_x20) {
18222
18291
  return _ref19.apply(this, arguments);
18223
18292
  };
18224
18293
  }();
@@ -18230,28 +18299,28 @@ var getSwatchMetaData = /*#__PURE__*/function () {
18230
18299
  * @returns {Promise<HTMLStyleElement>}
18231
18300
  */
18232
18301
  var wistiaSwatchElement = /*#__PURE__*/function () {
18233
- var _ref20 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27(mediaId, embedHost) {
18302
+ var _ref20 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28(mediaId, embedHost) {
18234
18303
  var swatchUrl, swatchImg, naturalHeight, naturalWidth, ratio, style;
18235
- return _regeneratorRuntime().wrap(function _callee27$(_context27) {
18236
- while (1) switch (_context27.prev = _context27.next) {
18304
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
18305
+ while (1) switch (_context28.prev = _context28.next) {
18237
18306
  case 0:
18238
18307
  swatchUrl = getSwatchUrl(mediaId, embedHost);
18239
- _context27.next = 3;
18308
+ _context28.next = 3;
18240
18309
  return getSwatchMetaData(swatchUrl);
18241
18310
  case 3:
18242
- swatchImg = _context27.sent;
18311
+ swatchImg = _context28.sent;
18243
18312
  naturalHeight = swatchImg.naturalHeight, naturalWidth = swatchImg.naturalWidth;
18244
18313
  ratio = naturalHeight / naturalWidth * 100;
18245
18314
  style = document.createElement('style');
18246
18315
  style.innerHTML = "\n wistia-player[media-id='".concat(mediaId, "']:not(:defined) {\n padding: ").concat(ratio, "% 0 0 0;\n background: url(").concat(swatchUrl, ");\n background-size: contain;\n filter: blur(5px);\n display: block;\n }\n ");
18247
- return _context27.abrupt("return", style);
18316
+ return _context28.abrupt("return", style);
18248
18317
  case 9:
18249
18318
  case "end":
18250
- return _context27.stop();
18319
+ return _context28.stop();
18251
18320
  }
18252
- }, _callee27);
18321
+ }, _callee28);
18253
18322
  }));
18254
- return function wistiaSwatchElement(_x20, _x21) {
18323
+ return function wistiaSwatchElement(_x21, _x22) {
18255
18324
  return _ref20.apply(this, arguments);
18256
18325
  };
18257
18326
  }();