@wistia/wistia-player-react 0.0.95 → 0.0.96

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.
@@ -9738,14 +9738,51 @@ var init_wistia_player = __esm({
9738
9738
  }
9739
9739
  return [screenWidth, screenWidth * 2 / 3];
9740
9740
  };
9741
+ var normalScaleHeightRange = function normalScaleHeightRange2(media) {
9742
+ var onMobile = detect.iphone || detect.ipad || detect.android;
9743
+ if (!onMobile) {
9744
+ return [340, 860];
9745
+ }
9746
+ if (media !== null && media !== void 0 && media.isAudio()) {
9747
+ return [500, 960];
9748
+ }
9749
+ var viewport = parseMetaViewport();
9750
+ var screenHeight;
9751
+ if (viewport.height) {
9752
+ if (typeof viewport.height === "number") {
9753
+ screenHeight = 0 + viewport.height;
9754
+ } else {
9755
+ screenHeight = screen.height || window.innerHeight;
9756
+ }
9757
+ var scale = Math.max(viewport["minimum-scale"] || 0, Math.min(viewport["maximum-scale"] || 10, viewport["initial-scale"] || 1));
9758
+ if (scale < 1) {
9759
+ screenHeight /= scale;
9760
+ }
9761
+ } else {
9762
+ screenHeight = window.innerWidth;
9763
+ }
9764
+ return [screenHeight, screenHeight * 2 / 3];
9765
+ };
9741
9766
  var controlMultiplierBasedOnVideo = function controlMultiplierBasedOnVideo2(video, normalRange) {
9742
9767
  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;
9768
+ var vidHeight = video.videoHeight();
9769
+ var aspect = vidWidth / vidHeight;
9770
+ if (aspect < 1) {
9771
+ var _normalScaleHeightRan = normalScaleHeightRange(video), _normalScaleHeightRan2 = _slicedToArray2(_normalScaleHeightRan, 2), lowerCutoff = _normalScaleHeightRan2[0], upperCutoff = _normalScaleHeightRan2[1];
9772
+ if (vidHeight <= lowerCutoff) {
9773
+ return vidHeight / lowerCutoff;
9774
+ }
9775
+ if (vidHeight > upperCutoff) {
9776
+ return vidHeight / upperCutoff;
9777
+ }
9778
+ } else {
9779
+ var _ref = normalRange || normalScaleWidthRange(video), _ref2 = _slicedToArray2(_ref, 2), _lowerCutoff = _ref2[0], _upperCutoff = _ref2[1];
9780
+ if (vidWidth <= _lowerCutoff) {
9781
+ return vidWidth / _lowerCutoff;
9782
+ }
9783
+ if (vidWidth > _upperCutoff) {
9784
+ return vidWidth / _upperCutoff;
9785
+ }
9749
9786
  }
9750
9787
  return 1;
9751
9788
  };
@@ -9880,7 +9917,7 @@ var init_wistia_player = __esm({
9880
9917
  var PROD_SSL_EMBED_HOST = "embed-ssl.wistia.com";
9881
9918
  var PROD_FASTLY_SSL_HOST = "embed-fastly.wistia.com";
9882
9919
  var SSL_EMBED_HOST = "embed-ssl.wistia.com";
9883
- var TAGGED_VERSION = "0.0.95";
9920
+ var TAGGED_VERSION = "0.0.96";
9884
9921
  var DEFAULT_PROTOCOL = function() {
9885
9922
  if (typeof window !== "undefined" && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z === window && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.location) {
9886
9923
  return utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.location.protocol;
@@ -10967,14 +11004,15 @@ var init_wistia_player = __esm({
10967
11004
  )
10968
11005
  /* harmony export */
10969
11006
  });
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);
11007
+ var wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__3(5509);
11008
+ var utilities_root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__3(8176);
11009
+ var utilities_obj_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__3(731);
11010
+ var utilities_wlog_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__3(6637);
11011
+ var utilities_script_utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__3(159);
11012
+ var utilities_remote_data_cache_ts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__3(3411);
11013
+ var utilities_hosts_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__3(5857);
11014
+ var utilities_media_data_transforms_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__3(3917);
11015
+ var utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__3(1161);
10978
11016
  function ownKeys2(e, r) {
10979
11017
  var t = Object.keys(e);
10980
11018
  if (Object.getOwnPropertySymbols) {
@@ -11061,18 +11099,20 @@ var init_wistia_player = __esm({
11061
11099
  };
11062
11100
  var mediaDataUrl = function mediaDataUrl2(hashedId) {
11063
11101
  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");
11102
+ var host = (0, utilities_hosts_js__WEBPACK_IMPORTED_MODULE_6__.Dd)(options);
11103
+ return "".concat((0, utilities_hosts_js__WEBPACK_IMPORTED_MODULE_6__.v9)(), "//").concat(host, "/embed/medias/").concat(hashedId, ".json");
11066
11104
  };
11067
11105
  var mediaDataScriptRegExp = function mediaDataScriptRegExp2(hashedId) {
11068
11106
  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\\??"));
11107
+ 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
11108
  };
11071
11109
  var cacheMedia = function cacheMedia2(hashedId, data) {
11072
11110
  return cacheMediaData(hashedId, data);
11073
11111
  };
11074
11112
  var uncacheMedia = function uncacheMedia2(hashedId) {
11113
+ var _Wistia$uncacheCaptio;
11075
11114
  uncacheMediaData(hashedId);
11115
+ (_Wistia$uncacheCaptio = Wistia.uncacheCaptions) === null || _Wistia$uncacheCaptio === void 0 ? void 0 : _Wistia$uncacheCaptio.call(Wistia, hashedId);
11076
11116
  removeSpeedDemonScriptAndData(hashedId);
11077
11117
  };
11078
11118
  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-4NGSV42Y.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-SYWHRHVD.mjs");
26
26
  void customElements.whenDefined("wistia-player").then(() => {
27
27
  setIsWistiaPlayerDefined(true);
28
28
  });
@@ -8816,14 +8816,51 @@ var __webpack_modules__ = {
8816
8816
  }
8817
8817
  return [screenWidth, screenWidth * 2 / 3];
8818
8818
  };
8819
+ var normalScaleHeightRange = function normalScaleHeightRange2(media) {
8820
+ var onMobile = detect.iphone || detect.ipad || detect.android;
8821
+ if (!onMobile) {
8822
+ return [340, 860];
8823
+ }
8824
+ if (media !== null && media !== void 0 && media.isAudio()) {
8825
+ return [500, 960];
8826
+ }
8827
+ var viewport = parseMetaViewport();
8828
+ var screenHeight;
8829
+ if (viewport.height) {
8830
+ if (typeof viewport.height === "number") {
8831
+ screenHeight = 0 + viewport.height;
8832
+ } else {
8833
+ screenHeight = screen.height || window.innerHeight;
8834
+ }
8835
+ var scale = Math.max(viewport["minimum-scale"] || 0, Math.min(viewport["maximum-scale"] || 10, viewport["initial-scale"] || 1));
8836
+ if (scale < 1) {
8837
+ screenHeight /= scale;
8838
+ }
8839
+ } else {
8840
+ screenHeight = window.innerWidth;
8841
+ }
8842
+ return [screenHeight, screenHeight * 2 / 3];
8843
+ };
8819
8844
  var controlMultiplierBasedOnVideo = function controlMultiplierBasedOnVideo2(video, normalRange) {
8820
8845
  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;
8846
+ var vidHeight = video.videoHeight();
8847
+ var aspect = vidWidth / vidHeight;
8848
+ if (aspect < 1) {
8849
+ var _normalScaleHeightRan = normalScaleHeightRange(video), _normalScaleHeightRan2 = _slicedToArray2(_normalScaleHeightRan, 2), lowerCutoff = _normalScaleHeightRan2[0], upperCutoff = _normalScaleHeightRan2[1];
8850
+ if (vidHeight <= lowerCutoff) {
8851
+ return vidHeight / lowerCutoff;
8852
+ }
8853
+ if (vidHeight > upperCutoff) {
8854
+ return vidHeight / upperCutoff;
8855
+ }
8856
+ } else {
8857
+ var _ref = normalRange || normalScaleWidthRange(video), _ref2 = _slicedToArray2(_ref, 2), _lowerCutoff = _ref2[0], _upperCutoff = _ref2[1];
8858
+ if (vidWidth <= _lowerCutoff) {
8859
+ return vidWidth / _lowerCutoff;
8860
+ }
8861
+ if (vidWidth > _upperCutoff) {
8862
+ return vidWidth / _upperCutoff;
8863
+ }
8827
8864
  }
8828
8865
  return 1;
8829
8866
  };
@@ -8958,7 +8995,7 @@ var __webpack_modules__ = {
8958
8995
  var PROD_SSL_EMBED_HOST = "embed-ssl.wistia.com";
8959
8996
  var PROD_FASTLY_SSL_HOST = "embed-fastly.wistia.com";
8960
8997
  var SSL_EMBED_HOST = "embed-ssl.wistia.com";
8961
- var TAGGED_VERSION = "0.0.95";
8998
+ var TAGGED_VERSION = "0.0.96";
8962
8999
  var DEFAULT_PROTOCOL = function() {
8963
9000
  if (typeof window !== "undefined" && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z === window && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.location) {
8964
9001
  return utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.location.protocol;
@@ -10045,14 +10082,15 @@ var __webpack_modules__ = {
10045
10082
  )
10046
10083
  /* harmony export */
10047
10084
  });
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);
10085
+ var wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__3(5509);
10086
+ var utilities_root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__3(8176);
10087
+ var utilities_obj_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__3(731);
10088
+ var utilities_wlog_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__3(6637);
10089
+ var utilities_script_utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__3(159);
10090
+ var utilities_remote_data_cache_ts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__3(3411);
10091
+ var utilities_hosts_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__3(5857);
10092
+ var utilities_media_data_transforms_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__3(3917);
10093
+ var utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__3(1161);
10056
10094
  function ownKeys2(e, r) {
10057
10095
  var t = Object.keys(e);
10058
10096
  if (Object.getOwnPropertySymbols) {
@@ -10139,18 +10177,20 @@ var __webpack_modules__ = {
10139
10177
  };
10140
10178
  var mediaDataUrl = function mediaDataUrl2(hashedId) {
10141
10179
  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");
10180
+ var host = (0, utilities_hosts_js__WEBPACK_IMPORTED_MODULE_6__.Dd)(options);
10181
+ return "".concat((0, utilities_hosts_js__WEBPACK_IMPORTED_MODULE_6__.v9)(), "//").concat(host, "/embed/medias/").concat(hashedId, ".json");
10144
10182
  };
10145
10183
  var mediaDataScriptRegExp = function mediaDataScriptRegExp2(hashedId) {
10146
10184
  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\\??"));
10185
+ 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
10186
  };
10149
10187
  var cacheMedia = function cacheMedia2(hashedId, data) {
10150
10188
  return cacheMediaData(hashedId, data);
10151
10189
  };
10152
10190
  var uncacheMedia = function uncacheMedia2(hashedId) {
10191
+ var _Wistia$uncacheCaptio;
10153
10192
  uncacheMediaData(hashedId);
10193
+ (_Wistia$uncacheCaptio = Wistia.uncacheCaptions) === null || _Wistia$uncacheCaptio === void 0 ? void 0 : _Wistia$uncacheCaptio.call(Wistia, hashedId);
10154
10194
  removeSpeedDemonScriptAndData(hashedId);
10155
10195
  };
10156
10196
  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.96",
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,7 +45,7 @@
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.96"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@babel/core": "^7.26.0",