@wistia/wistia-player-react 0.0.95 → 0.0.97

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.
@@ -8334,20 +8334,17 @@ var init_wistia_player = __esm({
8334
8334
  /* harmony export */
8335
8335
  });
8336
8336
  var utilities_root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__3(8176);
8337
- var _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__3(5509);
8338
- var _performance_ts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__3(267);
8337
+ var _performance_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__3(267);
8339
8338
  var na = navigator.userAgent;
8339
+ var _playerDetectCache = null;
8340
8340
  var rwebkit = /(webkit)[ /]([^\s]+)/i;
8341
8341
  var ropera = /OPR\/([^\s]+)/i;
8342
8342
  var redge = /(edge)\/(\d+(?:\.\d+)?)/i;
8343
8343
  var rmozilla = /(mozilla)(?:.*? rv:([^\s)]+))?/i;
8344
8344
  var randroid = /(android) ([^;]+)/i;
8345
8345
  var riphone = /(iphone)/i;
8346
- var ripad = /(ipad)/i;
8347
8346
  var rwinphone = /(Windows Phone OS (\d+(?:\.\d+)?))/;
8348
8347
  var rios = /OS (\d+)_(\d+)/i;
8349
- var rps3 = /(playstation 3)/i;
8350
- var rblackberry = /BlackBerry|BB10/i;
8351
8348
  var rfirefox = /(firefox)/i;
8352
8349
  var rgearvr = /Mobile VR/i;
8353
8350
  var riosVersion = /Version\/([^\s]+)/i;
@@ -8411,9 +8408,6 @@ var init_wistia_player = __esm({
8411
8408
  }
8412
8409
  return !touchScreen();
8413
8410
  };
8414
- var blackberry = function blackberry2() {
8415
- return rblackberry.test(na);
8416
- };
8417
8411
  var retina = function retina2() {
8418
8412
  return utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.devicePixelRatio != null && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.devicePixelRatio > 1;
8419
8413
  };
@@ -8423,14 +8417,6 @@ var init_wistia_player = __esm({
8423
8417
  var safari = function safari2() {
8424
8418
  return rwebkit.test(na) && !/chrome/i.test(na) && !ipad() && !iphone();
8425
8419
  };
8426
- var amazonSilk = function amazonSilk2() {
8427
- if (/Silk/.test(na)) {
8428
- return {
8429
- version: silkVersion()
8430
- };
8431
- }
8432
- return false;
8433
- };
8434
8420
  var chrome = function chrome2() {
8435
8421
  if (/Chrome/.test(na) && /Google Inc/.test(navigator.vendor)) {
8436
8422
  return {
@@ -8464,9 +8450,6 @@ var init_wistia_player = __esm({
8464
8450
  var windowsPhone = function windowsPhone2() {
8465
8451
  return rwinphone.test(na);
8466
8452
  };
8467
- var ps3 = function ps32() {
8468
- return rps3.test(na);
8469
- };
8470
8453
  var edge = function edge2() {
8471
8454
  return redge.test(na);
8472
8455
  };
@@ -8482,9 +8465,6 @@ var init_wistia_player = __esm({
8482
8465
  var mac = function mac2() {
8483
8466
  return /mac/i.test(navigator.platform);
8484
8467
  };
8485
- var linux = function linux2() {
8486
- return /linux/i.test(navigator.platform);
8487
- };
8488
8468
  var html5Video = function html5Video2() {
8489
8469
  var elem = document.createElement("video");
8490
8470
  var result = false;
@@ -8520,13 +8500,6 @@ var init_wistia_player = __esm({
8520
8500
  return false;
8521
8501
  }
8522
8502
  };
8523
- var json = function json2() {
8524
- return !!(utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.JSON && typeof JSON.parse === "function");
8525
- };
8526
- var backgroundSize = function backgroundSize2() {
8527
- var testEl = document.createElement("div");
8528
- return testEl.style.backgroundSize === "" || testEl.style.webkitBackgroundSize === "" || testEl.style.mozBackgroundSize === "" || testEl.style.oBackgroundSize === "";
8529
- };
8530
8503
  var fullscreenEnabled = function fullscreenEnabled2() {
8531
8504
  return document.fullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled;
8532
8505
  };
@@ -8541,9 +8514,12 @@ var init_wistia_player = __esm({
8541
8514
  }
8542
8515
  return null;
8543
8516
  };
8544
- var vulcanSupport = function vulcanSupport2() {
8517
+ var vulcanV2Support = function vulcanV2Support2() {
8545
8518
  var modernBrowser = /webkit|mozilla|edge/.test(browser());
8546
- return Boolean(!iphone() && !ipad() && !android() && !blackberry() && modernBrowser && html5Video().h264 && Object.defineProperties);
8519
+ if (iphone() || ipad() || android()) {
8520
+ return true;
8521
+ }
8522
+ return Boolean(modernBrowser && html5Video().h264 && Object.defineProperties);
8547
8523
  };
8548
8524
  var isPassiveSupported;
8549
8525
  var passiveSupported = function passiveSupported2() {
@@ -8580,15 +8556,14 @@ var init_wistia_player = __esm({
8580
8556
  return isChromeDesktopSupported || isChromeAndroidSupported || isFirefoxDesktopSupported || isFirefoxAndroidSupported || isEdgeSupported || isOperaSupported;
8581
8557
  };
8582
8558
  var cachedDetect2 = function cachedDetect3() {
8583
- if (_wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_1__.s._detectCache) {
8584
- return _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_1__.s._detectCache;
8559
+ if (_playerDetectCache) {
8560
+ return _playerDetectCache;
8585
8561
  }
8586
- _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_1__.s._detectCache = uncachedDetect();
8587
- return _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_1__.s._detectCache;
8562
+ _playerDetectCache = uncachedDetect();
8563
+ return _playerDetectCache;
8588
8564
  };
8589
8565
  var uncachedDetect = function uncachedDetect2() {
8590
8566
  var result = {
8591
- amazonSilk: amazonSilk(),
8592
8567
  browser: {
8593
8568
  version: browserVersion()
8594
8569
  },
@@ -8599,10 +8574,8 @@ var init_wistia_player = __esm({
8599
8574
  oldandroid: oldandroid(),
8600
8575
  iphone: iphone(),
8601
8576
  ipad: ipad(),
8602
- blackberry: blackberry(),
8603
8577
  safari: safari(),
8604
8578
  chrome: chrome(),
8605
- opera: opera(),
8606
8579
  winphone: {
8607
8580
  version: windowsPhone()[2]
8608
8581
  },
@@ -8611,30 +8584,26 @@ var init_wistia_player = __esm({
8611
8584
  },
8612
8585
  windows: windows(),
8613
8586
  mac: mac(),
8614
- linux: linux(),
8615
8587
  retina: retina(),
8616
8588
  hoverIsNatural: hoverIsNatural(),
8617
8589
  touchScreen: touchScreen(),
8618
- ps3: ps3(),
8619
8590
  video: html5Video(),
8620
8591
  mediaSource: mediaSource(),
8621
8592
  nativeHls: nativeHls(),
8622
8593
  localstorage: localStorage2(),
8623
- json: json(),
8624
- backgroundSize: backgroundSize(),
8625
8594
  fullscreenEnabled: fullscreenEnabled(),
8626
- vulcanSupport: vulcanSupport(),
8595
+ vulcanV2Support: vulcanV2Support(),
8627
8596
  mutationObserver: mutationObserver(),
8628
8597
  callingPlayRequiresEventContext: callingPlayRequiresEventContext(),
8629
8598
  passiveSupported: passiveSupported(),
8630
8599
  webp: webp(),
8631
- performanceMeasure: (0, _performance_ts__WEBPACK_IMPORTED_MODULE_2__.O)()
8600
+ performanceMeasure: (0, _performance_ts__WEBPACK_IMPORTED_MODULE_1__.O)()
8632
8601
  };
8633
8602
  result.browser[browser()] = true;
8634
8603
  return result;
8635
8604
  };
8636
8605
  var clearDetectCache = function clearDetectCache2() {
8637
- Wistia._detectCache = null;
8606
+ _playerDetectCache = null;
8638
8607
  };
8639
8608
  var detectIsMobile = function detectIsMobile2() {
8640
8609
  var isAndroid = android();
@@ -9738,14 +9707,51 @@ var init_wistia_player = __esm({
9738
9707
  }
9739
9708
  return [screenWidth, screenWidth * 2 / 3];
9740
9709
  };
9710
+ var normalScaleHeightRange = function normalScaleHeightRange2(media) {
9711
+ var onMobile = detect.iphone || detect.ipad || detect.android;
9712
+ if (!onMobile) {
9713
+ return [340, 860];
9714
+ }
9715
+ if (media !== null && media !== void 0 && media.isAudio()) {
9716
+ return [500, 960];
9717
+ }
9718
+ var viewport = parseMetaViewport();
9719
+ var screenHeight;
9720
+ if (viewport.height) {
9721
+ if (typeof viewport.height === "number") {
9722
+ screenHeight = 0 + viewport.height;
9723
+ } else {
9724
+ screenHeight = screen.height || window.innerHeight;
9725
+ }
9726
+ var scale = Math.max(viewport["minimum-scale"] || 0, Math.min(viewport["maximum-scale"] || 10, viewport["initial-scale"] || 1));
9727
+ if (scale < 1) {
9728
+ screenHeight /= scale;
9729
+ }
9730
+ } else {
9731
+ screenHeight = window.innerWidth;
9732
+ }
9733
+ return [screenHeight, screenHeight * 2 / 1.3];
9734
+ };
9741
9735
  var controlMultiplierBasedOnVideo = function controlMultiplierBasedOnVideo2(video, normalRange) {
9742
9736
  var vidWidth = video.videoWidth();
9743
- var _ref = normalRange || normalScaleWidthRange(video), _ref2 = _slicedToArray2(_ref, 2), lowerCutoff = _ref2[0], upperCutoff = _ref2[1];
9744
- if (vidWidth <= lowerCutoff) {
9745
- return vidWidth / lowerCutoff;
9746
- }
9747
- if (vidWidth > upperCutoff) {
9748
- return vidWidth / upperCutoff;
9737
+ var vidHeight = video.videoHeight();
9738
+ var aspect = vidWidth / vidHeight;
9739
+ if (aspect < 1) {
9740
+ var _normalScaleHeightRan = normalScaleHeightRange(video), _normalScaleHeightRan2 = _slicedToArray2(_normalScaleHeightRan, 2), lowerCutoff = _normalScaleHeightRan2[0], upperCutoff = _normalScaleHeightRan2[1];
9741
+ if (vidHeight <= lowerCutoff) {
9742
+ return vidHeight / lowerCutoff;
9743
+ }
9744
+ if (vidHeight > upperCutoff) {
9745
+ return vidHeight / upperCutoff;
9746
+ }
9747
+ } else {
9748
+ var _ref = normalRange || normalScaleWidthRange(video), _ref2 = _slicedToArray2(_ref, 2), _lowerCutoff = _ref2[0], _upperCutoff = _ref2[1];
9749
+ if (vidWidth <= _lowerCutoff) {
9750
+ return vidWidth / _lowerCutoff;
9751
+ }
9752
+ if (vidWidth > _upperCutoff) {
9753
+ return vidWidth / _upperCutoff;
9754
+ }
9749
9755
  }
9750
9756
  return 1;
9751
9757
  };
@@ -9880,7 +9886,7 @@ var init_wistia_player = __esm({
9880
9886
  var PROD_SSL_EMBED_HOST = "embed-ssl.wistia.com";
9881
9887
  var PROD_FASTLY_SSL_HOST = "embed-fastly.wistia.com";
9882
9888
  var SSL_EMBED_HOST = "embed-ssl.wistia.com";
9883
- var TAGGED_VERSION = "0.0.95";
9889
+ var TAGGED_VERSION = "0.0.97";
9884
9890
  var DEFAULT_PROTOCOL = function() {
9885
9891
  if (typeof window !== "undefined" && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z === window && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.location) {
9886
9892
  return utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.location.protocol;
@@ -10789,9 +10795,7 @@ var init_wistia_player = __esm({
10789
10795
  var supportedPlayers = function supportedPlayers2(context) {
10790
10796
  var detect = context.detect;
10791
10797
  var result = [NOT_PLAYABLE, PASSWORD_PROTECTED, EXTERNAL];
10792
- if (detect.vulcanSupport) {
10793
- result.push(VULCAN_V2);
10794
- } else if (detect.iphone || detect.ipad || detect.android) {
10798
+ if (detect.vulcanV2Support) {
10795
10799
  result.push(VULCAN_V2);
10796
10800
  }
10797
10801
  if (detect.video.h264) {
@@ -10967,14 +10971,15 @@ var init_wistia_player = __esm({
10967
10971
  )
10968
10972
  /* harmony export */
10969
10973
  });
10970
- var utilities_root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__3(8176);
10971
- var utilities_obj_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__3(731);
10972
- var utilities_wlog_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__3(6637);
10973
- var utilities_script_utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__3(159);
10974
- var utilities_remote_data_cache_ts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__3(3411);
10975
- var utilities_hosts_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__3(5857);
10976
- var utilities_media_data_transforms_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__3(3917);
10977
- var utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__3(1161);
10974
+ var wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__3(5509);
10975
+ var utilities_root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__3(8176);
10976
+ var utilities_obj_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__3(731);
10977
+ var utilities_wlog_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__3(6637);
10978
+ var utilities_script_utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__3(159);
10979
+ var utilities_remote_data_cache_ts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__3(3411);
10980
+ var utilities_hosts_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__3(5857);
10981
+ var utilities_media_data_transforms_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__3(3917);
10982
+ var utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__3(1161);
10978
10983
  function ownKeys2(e, r) {
10979
10984
  var t = Object.keys(e);
10980
10985
  if (Object.getOwnPropertySymbols) {
@@ -11061,18 +11066,20 @@ var init_wistia_player = __esm({
11061
11066
  };
11062
11067
  var mediaDataUrl = function mediaDataUrl2(hashedId) {
11063
11068
  var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
11064
- var host = (0, utilities_hosts_js__WEBPACK_IMPORTED_MODULE_5__.Dd)(options);
11065
- return "".concat((0, utilities_hosts_js__WEBPACK_IMPORTED_MODULE_5__.v9)(), "//").concat(host, "/embed/medias/").concat(hashedId, ".json");
11069
+ var host = (0, utilities_hosts_js__WEBPACK_IMPORTED_MODULE_6__.Dd)(options);
11070
+ return "".concat((0, utilities_hosts_js__WEBPACK_IMPORTED_MODULE_6__.v9)(), "//").concat(host, "/embed/medias/").concat(hashedId, ".json");
11066
11071
  };
11067
11072
  var mediaDataScriptRegExp = function mediaDataScriptRegExp2(hashedId) {
11068
11073
  var protocolMatch = location.protocol === "https:" ? "https" : "https?";
11069
- return new RegExp("^(".concat(protocolMatch, ":)?//((").concat((0, utilities_hosts_js__WEBPACK_IMPORTED_MODULE_5__.CX)().replace(".", "\\."), ")|(").concat((0, utilities_hosts_js__WEBPACK_IMPORTED_MODULE_5__.kh)().replace(".", "\\."), "))/embed/medias/").concat(hashedId, "\\.jsonp\\??"));
11074
+ return new RegExp("^(".concat(protocolMatch, ":)?//((").concat((0, utilities_hosts_js__WEBPACK_IMPORTED_MODULE_6__.CX)().replace(".", "\\."), ")|(").concat((0, utilities_hosts_js__WEBPACK_IMPORTED_MODULE_6__.kh)().replace(".", "\\."), "))/embed/medias/").concat(hashedId, "\\.jsonp\\??"));
11070
11075
  };
11071
11076
  var cacheMedia = function cacheMedia2(hashedId, data) {
11072
11077
  return cacheMediaData(hashedId, data);
11073
11078
  };
11074
11079
  var uncacheMedia = function uncacheMedia2(hashedId) {
11080
+ var _Wistia$uncacheCaptio;
11075
11081
  uncacheMediaData(hashedId);
11082
+ (_Wistia$uncacheCaptio = Wistia.uncacheCaptions) === null || _Wistia$uncacheCaptio === void 0 ? void 0 : _Wistia$uncacheCaptio.call(Wistia, hashedId);
11076
11083
  removeSpeedDemonScriptAndData(hashedId);
11077
11084
  };
11078
11085
  var removeSpeedDemonScriptAndData = function removeSpeedDemonScriptAndData2(hashedId) {
@@ -7,7 +7,7 @@ import {
7
7
  import { forwardRef, Suspense, lazy, Fragment } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  var WistiaPlayerWrapper = lazy(
10
- async () => import("./WistiaPlayerWrapper-NYDCWV7E.mjs").then((module) => ({
10
+ async () => import("./WistiaPlayerWrapper-N3R2DEYH.mjs").then((module) => ({
11
11
  default: module.WistiaPlayerWrapper
12
12
  }))
13
13
  );
@@ -22,7 +22,7 @@ var WistiaPlayerWrapper = forwardRef(
22
22
  setSwatchAspectRatio(ratio);
23
23
  });
24
24
  }
25
- void import("./wistia-player-XZCLOPFU.mjs");
25
+ void import("./wistia-player-54NOW66T.mjs");
26
26
  void customElements.whenDefined("wistia-player").then(() => {
27
27
  setIsWistiaPlayerDefined(true);
28
28
  });
@@ -7412,20 +7412,17 @@ var __webpack_modules__ = {
7412
7412
  /* harmony export */
7413
7413
  });
7414
7414
  var utilities_root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__3(8176);
7415
- var _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__3(5509);
7416
- var _performance_ts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__3(267);
7415
+ var _performance_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__3(267);
7417
7416
  var na = navigator.userAgent;
7417
+ var _playerDetectCache = null;
7418
7418
  var rwebkit = /(webkit)[ /]([^\s]+)/i;
7419
7419
  var ropera = /OPR\/([^\s]+)/i;
7420
7420
  var redge = /(edge)\/(\d+(?:\.\d+)?)/i;
7421
7421
  var rmozilla = /(mozilla)(?:.*? rv:([^\s)]+))?/i;
7422
7422
  var randroid = /(android) ([^;]+)/i;
7423
7423
  var riphone = /(iphone)/i;
7424
- var ripad = /(ipad)/i;
7425
7424
  var rwinphone = /(Windows Phone OS (\d+(?:\.\d+)?))/;
7426
7425
  var rios = /OS (\d+)_(\d+)/i;
7427
- var rps3 = /(playstation 3)/i;
7428
- var rblackberry = /BlackBerry|BB10/i;
7429
7426
  var rfirefox = /(firefox)/i;
7430
7427
  var rgearvr = /Mobile VR/i;
7431
7428
  var riosVersion = /Version\/([^\s]+)/i;
@@ -7489,9 +7486,6 @@ var __webpack_modules__ = {
7489
7486
  }
7490
7487
  return !touchScreen();
7491
7488
  };
7492
- var blackberry = function blackberry2() {
7493
- return rblackberry.test(na);
7494
- };
7495
7489
  var retina = function retina2() {
7496
7490
  return utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.devicePixelRatio != null && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.devicePixelRatio > 1;
7497
7491
  };
@@ -7501,14 +7495,6 @@ var __webpack_modules__ = {
7501
7495
  var safari = function safari2() {
7502
7496
  return rwebkit.test(na) && !/chrome/i.test(na) && !ipad() && !iphone();
7503
7497
  };
7504
- var amazonSilk = function amazonSilk2() {
7505
- if (/Silk/.test(na)) {
7506
- return {
7507
- version: silkVersion()
7508
- };
7509
- }
7510
- return false;
7511
- };
7512
7498
  var chrome = function chrome2() {
7513
7499
  if (/Chrome/.test(na) && /Google Inc/.test(navigator.vendor)) {
7514
7500
  return {
@@ -7542,9 +7528,6 @@ var __webpack_modules__ = {
7542
7528
  var windowsPhone = function windowsPhone2() {
7543
7529
  return rwinphone.test(na);
7544
7530
  };
7545
- var ps3 = function ps32() {
7546
- return rps3.test(na);
7547
- };
7548
7531
  var edge = function edge2() {
7549
7532
  return redge.test(na);
7550
7533
  };
@@ -7560,9 +7543,6 @@ var __webpack_modules__ = {
7560
7543
  var mac = function mac2() {
7561
7544
  return /mac/i.test(navigator.platform);
7562
7545
  };
7563
- var linux = function linux2() {
7564
- return /linux/i.test(navigator.platform);
7565
- };
7566
7546
  var html5Video = function html5Video2() {
7567
7547
  var elem = document.createElement("video");
7568
7548
  var result = false;
@@ -7598,13 +7578,6 @@ var __webpack_modules__ = {
7598
7578
  return false;
7599
7579
  }
7600
7580
  };
7601
- var json = function json2() {
7602
- return !!(utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.JSON && typeof JSON.parse === "function");
7603
- };
7604
- var backgroundSize = function backgroundSize2() {
7605
- var testEl = document.createElement("div");
7606
- return testEl.style.backgroundSize === "" || testEl.style.webkitBackgroundSize === "" || testEl.style.mozBackgroundSize === "" || testEl.style.oBackgroundSize === "";
7607
- };
7608
7581
  var fullscreenEnabled = function fullscreenEnabled2() {
7609
7582
  return document.fullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled;
7610
7583
  };
@@ -7619,9 +7592,12 @@ var __webpack_modules__ = {
7619
7592
  }
7620
7593
  return null;
7621
7594
  };
7622
- var vulcanSupport = function vulcanSupport2() {
7595
+ var vulcanV2Support = function vulcanV2Support2() {
7623
7596
  var modernBrowser = /webkit|mozilla|edge/.test(browser());
7624
- return Boolean(!iphone() && !ipad() && !android() && !blackberry() && modernBrowser && html5Video().h264 && Object.defineProperties);
7597
+ if (iphone() || ipad() || android()) {
7598
+ return true;
7599
+ }
7600
+ return Boolean(modernBrowser && html5Video().h264 && Object.defineProperties);
7625
7601
  };
7626
7602
  var isPassiveSupported;
7627
7603
  var passiveSupported = function passiveSupported2() {
@@ -7658,15 +7634,14 @@ var __webpack_modules__ = {
7658
7634
  return isChromeDesktopSupported || isChromeAndroidSupported || isFirefoxDesktopSupported || isFirefoxAndroidSupported || isEdgeSupported || isOperaSupported;
7659
7635
  };
7660
7636
  var cachedDetect2 = function cachedDetect3() {
7661
- if (_wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_1__.s._detectCache) {
7662
- return _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_1__.s._detectCache;
7637
+ if (_playerDetectCache) {
7638
+ return _playerDetectCache;
7663
7639
  }
7664
- _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_1__.s._detectCache = uncachedDetect();
7665
- return _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_1__.s._detectCache;
7640
+ _playerDetectCache = uncachedDetect();
7641
+ return _playerDetectCache;
7666
7642
  };
7667
7643
  var uncachedDetect = function uncachedDetect2() {
7668
7644
  var result = {
7669
- amazonSilk: amazonSilk(),
7670
7645
  browser: {
7671
7646
  version: browserVersion()
7672
7647
  },
@@ -7677,10 +7652,8 @@ var __webpack_modules__ = {
7677
7652
  oldandroid: oldandroid(),
7678
7653
  iphone: iphone(),
7679
7654
  ipad: ipad(),
7680
- blackberry: blackberry(),
7681
7655
  safari: safari(),
7682
7656
  chrome: chrome(),
7683
- opera: opera(),
7684
7657
  winphone: {
7685
7658
  version: windowsPhone()[2]
7686
7659
  },
@@ -7689,30 +7662,26 @@ var __webpack_modules__ = {
7689
7662
  },
7690
7663
  windows: windows(),
7691
7664
  mac: mac(),
7692
- linux: linux(),
7693
7665
  retina: retina(),
7694
7666
  hoverIsNatural: hoverIsNatural(),
7695
7667
  touchScreen: touchScreen(),
7696
- ps3: ps3(),
7697
7668
  video: html5Video(),
7698
7669
  mediaSource: mediaSource(),
7699
7670
  nativeHls: nativeHls(),
7700
7671
  localstorage: localStorage2(),
7701
- json: json(),
7702
- backgroundSize: backgroundSize(),
7703
7672
  fullscreenEnabled: fullscreenEnabled(),
7704
- vulcanSupport: vulcanSupport(),
7673
+ vulcanV2Support: vulcanV2Support(),
7705
7674
  mutationObserver: mutationObserver(),
7706
7675
  callingPlayRequiresEventContext: callingPlayRequiresEventContext(),
7707
7676
  passiveSupported: passiveSupported(),
7708
7677
  webp: webp(),
7709
- performanceMeasure: (0, _performance_ts__WEBPACK_IMPORTED_MODULE_2__.O)()
7678
+ performanceMeasure: (0, _performance_ts__WEBPACK_IMPORTED_MODULE_1__.O)()
7710
7679
  };
7711
7680
  result.browser[browser()] = true;
7712
7681
  return result;
7713
7682
  };
7714
7683
  var clearDetectCache = function clearDetectCache2() {
7715
- Wistia._detectCache = null;
7684
+ _playerDetectCache = null;
7716
7685
  };
7717
7686
  var detectIsMobile = function detectIsMobile2() {
7718
7687
  var isAndroid = android();
@@ -8816,14 +8785,51 @@ var __webpack_modules__ = {
8816
8785
  }
8817
8786
  return [screenWidth, screenWidth * 2 / 3];
8818
8787
  };
8788
+ var normalScaleHeightRange = function normalScaleHeightRange2(media) {
8789
+ var onMobile = detect.iphone || detect.ipad || detect.android;
8790
+ if (!onMobile) {
8791
+ return [340, 860];
8792
+ }
8793
+ if (media !== null && media !== void 0 && media.isAudio()) {
8794
+ return [500, 960];
8795
+ }
8796
+ var viewport = parseMetaViewport();
8797
+ var screenHeight;
8798
+ if (viewport.height) {
8799
+ if (typeof viewport.height === "number") {
8800
+ screenHeight = 0 + viewport.height;
8801
+ } else {
8802
+ screenHeight = screen.height || window.innerHeight;
8803
+ }
8804
+ var scale = Math.max(viewport["minimum-scale"] || 0, Math.min(viewport["maximum-scale"] || 10, viewport["initial-scale"] || 1));
8805
+ if (scale < 1) {
8806
+ screenHeight /= scale;
8807
+ }
8808
+ } else {
8809
+ screenHeight = window.innerWidth;
8810
+ }
8811
+ return [screenHeight, screenHeight * 2 / 1.3];
8812
+ };
8819
8813
  var controlMultiplierBasedOnVideo = function controlMultiplierBasedOnVideo2(video, normalRange) {
8820
8814
  var vidWidth = video.videoWidth();
8821
- var _ref = normalRange || normalScaleWidthRange(video), _ref2 = _slicedToArray2(_ref, 2), lowerCutoff = _ref2[0], upperCutoff = _ref2[1];
8822
- if (vidWidth <= lowerCutoff) {
8823
- return vidWidth / lowerCutoff;
8824
- }
8825
- if (vidWidth > upperCutoff) {
8826
- return vidWidth / upperCutoff;
8815
+ var vidHeight = video.videoHeight();
8816
+ var aspect = vidWidth / vidHeight;
8817
+ if (aspect < 1) {
8818
+ var _normalScaleHeightRan = normalScaleHeightRange(video), _normalScaleHeightRan2 = _slicedToArray2(_normalScaleHeightRan, 2), lowerCutoff = _normalScaleHeightRan2[0], upperCutoff = _normalScaleHeightRan2[1];
8819
+ if (vidHeight <= lowerCutoff) {
8820
+ return vidHeight / lowerCutoff;
8821
+ }
8822
+ if (vidHeight > upperCutoff) {
8823
+ return vidHeight / upperCutoff;
8824
+ }
8825
+ } else {
8826
+ var _ref = normalRange || normalScaleWidthRange(video), _ref2 = _slicedToArray2(_ref, 2), _lowerCutoff = _ref2[0], _upperCutoff = _ref2[1];
8827
+ if (vidWidth <= _lowerCutoff) {
8828
+ return vidWidth / _lowerCutoff;
8829
+ }
8830
+ if (vidWidth > _upperCutoff) {
8831
+ return vidWidth / _upperCutoff;
8832
+ }
8827
8833
  }
8828
8834
  return 1;
8829
8835
  };
@@ -8958,7 +8964,7 @@ var __webpack_modules__ = {
8958
8964
  var PROD_SSL_EMBED_HOST = "embed-ssl.wistia.com";
8959
8965
  var PROD_FASTLY_SSL_HOST = "embed-fastly.wistia.com";
8960
8966
  var SSL_EMBED_HOST = "embed-ssl.wistia.com";
8961
- var TAGGED_VERSION = "0.0.95";
8967
+ var TAGGED_VERSION = "0.0.97";
8962
8968
  var DEFAULT_PROTOCOL = function() {
8963
8969
  if (typeof window !== "undefined" && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z === window && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.location) {
8964
8970
  return utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.location.protocol;
@@ -9867,9 +9873,7 @@ var __webpack_modules__ = {
9867
9873
  var supportedPlayers = function supportedPlayers2(context) {
9868
9874
  var detect = context.detect;
9869
9875
  var result = [NOT_PLAYABLE, PASSWORD_PROTECTED, EXTERNAL];
9870
- if (detect.vulcanSupport) {
9871
- result.push(VULCAN_V2);
9872
- } else if (detect.iphone || detect.ipad || detect.android) {
9876
+ if (detect.vulcanV2Support) {
9873
9877
  result.push(VULCAN_V2);
9874
9878
  }
9875
9879
  if (detect.video.h264) {
@@ -10045,14 +10049,15 @@ var __webpack_modules__ = {
10045
10049
  )
10046
10050
  /* harmony export */
10047
10051
  });
10048
- var utilities_root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__3(8176);
10049
- var utilities_obj_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__3(731);
10050
- var utilities_wlog_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__3(6637);
10051
- var utilities_script_utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__3(159);
10052
- var utilities_remote_data_cache_ts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__3(3411);
10053
- var utilities_hosts_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__3(5857);
10054
- var utilities_media_data_transforms_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__3(3917);
10055
- var utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__3(1161);
10052
+ var wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__3(5509);
10053
+ var utilities_root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__3(8176);
10054
+ var utilities_obj_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__3(731);
10055
+ var utilities_wlog_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__3(6637);
10056
+ var utilities_script_utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__3(159);
10057
+ var utilities_remote_data_cache_ts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__3(3411);
10058
+ var utilities_hosts_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__3(5857);
10059
+ var utilities_media_data_transforms_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__3(3917);
10060
+ var utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__3(1161);
10056
10061
  function ownKeys2(e, r) {
10057
10062
  var t = Object.keys(e);
10058
10063
  if (Object.getOwnPropertySymbols) {
@@ -10139,18 +10144,20 @@ var __webpack_modules__ = {
10139
10144
  };
10140
10145
  var mediaDataUrl = function mediaDataUrl2(hashedId) {
10141
10146
  var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
10142
- var host = (0, utilities_hosts_js__WEBPACK_IMPORTED_MODULE_5__.Dd)(options);
10143
- return "".concat((0, utilities_hosts_js__WEBPACK_IMPORTED_MODULE_5__.v9)(), "//").concat(host, "/embed/medias/").concat(hashedId, ".json");
10147
+ var host = (0, utilities_hosts_js__WEBPACK_IMPORTED_MODULE_6__.Dd)(options);
10148
+ return "".concat((0, utilities_hosts_js__WEBPACK_IMPORTED_MODULE_6__.v9)(), "//").concat(host, "/embed/medias/").concat(hashedId, ".json");
10144
10149
  };
10145
10150
  var mediaDataScriptRegExp = function mediaDataScriptRegExp2(hashedId) {
10146
10151
  var protocolMatch = location.protocol === "https:" ? "https" : "https?";
10147
- return new RegExp("^(".concat(protocolMatch, ":)?//((").concat((0, utilities_hosts_js__WEBPACK_IMPORTED_MODULE_5__.CX)().replace(".", "\\."), ")|(").concat((0, utilities_hosts_js__WEBPACK_IMPORTED_MODULE_5__.kh)().replace(".", "\\."), "))/embed/medias/").concat(hashedId, "\\.jsonp\\??"));
10152
+ return new RegExp("^(".concat(protocolMatch, ":)?//((").concat((0, utilities_hosts_js__WEBPACK_IMPORTED_MODULE_6__.CX)().replace(".", "\\."), ")|(").concat((0, utilities_hosts_js__WEBPACK_IMPORTED_MODULE_6__.kh)().replace(".", "\\."), "))/embed/medias/").concat(hashedId, "\\.jsonp\\??"));
10148
10153
  };
10149
10154
  var cacheMedia = function cacheMedia2(hashedId, data) {
10150
10155
  return cacheMediaData(hashedId, data);
10151
10156
  };
10152
10157
  var uncacheMedia = function uncacheMedia2(hashedId) {
10158
+ var _Wistia$uncacheCaptio;
10153
10159
  uncacheMediaData(hashedId);
10160
+ (_Wistia$uncacheCaptio = Wistia.uncacheCaptions) === null || _Wistia$uncacheCaptio === void 0 ? void 0 : _Wistia$uncacheCaptio.call(Wistia, hashedId);
10154
10161
  removeSpeedDemonScriptAndData(hashedId);
10155
10162
  };
10156
10163
  var removeSpeedDemonScriptAndData = function removeSpeedDemonScriptAndData2(hashedId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wistia/wistia-player-react",
3
- "version": "0.0.95",
3
+ "version": "0.0.97",
4
4
  "packageManager": "yarn@4.5.3",
5
5
  "description": "An embeddable wistia-player web component and React wrapper to add responsive, lightweight, and SEO-friendly videos to your site.",
6
6
  "keywords": [
@@ -45,18 +45,18 @@
45
45
  "start:dev:yalc": "run build:react:dev --watch --yalc"
46
46
  },
47
47
  "dependencies": {
48
- "@wistia/wistia-player": "0.0.95"
48
+ "@wistia/wistia-player": "0.0.97"
49
49
  },
50
50
  "devDependencies": {
51
- "@babel/core": "^7.26.0",
51
+ "@babel/core": "^7.26.8",
52
52
  "@babel/plugin-proposal-class-properties": "^7.18.6",
53
53
  "@babel/plugin-proposal-optional-chaining": "^7.21.0",
54
- "@babel/preset-env": "^7.26.0",
54
+ "@babel/preset-env": "^7.26.8",
55
55
  "@babel/preset-react": "^7.25.9",
56
56
  "@babel/preset-typescript": "^7.26.0",
57
57
  "@types/react": "^18.3.12",
58
58
  "babel-plugin-transform-object-hasown": "^1.1.0",
59
- "esbuild": "^0.24.0",
59
+ "esbuild": "^0.25.0",
60
60
  "npm-run-all": "^4.1.5",
61
61
  "react": "^18.3.1",
62
62
  "read-package-json": "^7.0.1",