@wistia/wistia-player-react 0.8.1 → 0.8.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @wistia/wistia-player-react
2
2
 
3
+ ## 0.8.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 8f5d62e: Quality labels in the settings menu now name a video's full-resolution rendition by its real size, so videos that aren't exactly widescreen (such as 4:3, 5:4, 16:10 or tall vertical) can show their top quality, and vertical videos are named by their width so each quality option is distinct. Labels for standard-width widescreen renditions are unchanged.
8
+ - Updated dependencies [8f5d62e]
9
+ - @wistia/wistia-player@0.8.4
10
+
11
+ ## 0.8.3
12
+
13
+ ### Patch Changes
14
+
15
+ - 9d45dfe: The published types now include the `captionsBackgroundColor`, `captionsFontFamily`, `captionsTextColor` and `captionsTextSize` attributes. How the player applies captions styling settings is unchanged.
16
+ - Updated dependencies [9d45dfe]
17
+ - @wistia/wistia-player@0.8.3
18
+
19
+ ## 0.8.2
20
+
21
+ ### Patch Changes
22
+
23
+ - f7b478c: The captions display no longer throws an error when the player's controls re-render after the captions plugin has gone away.
24
+ - a64187e: Screen readers now announce each item in a CTA carousel as "Seek to <heading>" instead of only its heading, so it is clear the button moves the video.
25
+ - 1e89f30: Fixed the CTA carousel highlighting the previous card after a seek to the exact start of a card while the video is paused. The card that starts at the new time is now highlighted, matching the link shown on the player.
26
+ - dfe21fe: The player's emoji reactions bar now cleans up the `emojiList` option before showing it: entries that aren't a single emoji are skipped, repeats are dropped, and only the first six are kept.
27
+ - a299276: Fixed an error when replacing a video whose stream had already failed to load. The swap now goes through without the player throwing.
28
+ - 64c4eb2: Transcripts for password-protected media now wait for the player to be unlocked. Until then the transcript embed shows a short locked message instead of the text, and once the viewer enters the password it loads without a page refresh. Transcript requests and the transcript download links, including the one in the audio player, send the password the player was unlocked with.
29
+ - Updated dependencies [f7b478c]
30
+ - Updated dependencies [a64187e]
31
+ - Updated dependencies [1e89f30]
32
+ - Updated dependencies [dfe21fe]
33
+ - Updated dependencies [a299276]
34
+ - Updated dependencies [64c4eb2]
35
+ - @wistia/wistia-player@0.8.2
36
+
3
37
  ## 0.8.1
4
38
 
5
39
  ### Patch Changes
@@ -7629,8 +7629,8 @@ var init_wistia_player = __esm({
7629
7629
  const PROD_SSL_EMBED_HOST = "embed-ssl.wistia.com";
7630
7630
  const PROD_FASTLY_SSL_HOST = "embed-fastly.wistia.com";
7631
7631
  const SSL_EMBED_HOST = "embed-ssl.wistia.com";
7632
- const TAGGED_VERSION = "0.8.1";
7633
- const CURRENT_SHA = "c78c98d62de05b49e2415ee676b30c075b0800bb";
7632
+ const TAGGED_VERSION = "0.8.4";
7633
+ const CURRENT_SHA = "c4d23790ab87519b4a5dfd0240c6d9275e27ed64";
7634
7634
  const DEFAULT_PROTOCOL = (() => {
7635
7635
  if (typeof window !== "undefined" && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z === window && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.location) {
7636
7636
  return utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.location.protocol;
@@ -8701,38 +8701,33 @@ var init_wistia_player = __esm({
8701
8701
  }
8702
8702
  });
8703
8703
  };
8704
+ const HORIZONTAL_LADDER_WIDTHS = [400, 640, 960, 1280, 1920, 2560, 3200, 3840];
8705
+ const VERTICAL_LADDER_WIDTHS = [240, 360, 540, 720, 1080, 1440, 1800, 2160];
8706
+ const SNAP_TIERS = [[2160, 3740, 2104], [1800, 3100, 1744], [1440, 2460, 1384], [1080, 1820, 1024], [720, 1180, 664], [540, 860, 484], [360, 540, 304]];
8704
8707
  const numericSizeSnapped = (width, height) => {
8705
- if (height > width) {
8708
+ if (width === 0 || height === 0) {
8709
+ return 0;
8710
+ }
8711
+ const vertical = height > width;
8712
+ if (vertical) {
8706
8713
  const tmpWidth = width;
8707
8714
  width = height;
8708
8715
  height = tmpWidth;
8709
8716
  }
8710
8717
  const aspectRatio = width / height;
8711
- if (aspectRatio < 1.05) {
8718
+ const square = aspectRatio < 1.05;
8719
+ const offLadder = vertical ? !VERTICAL_LADDER_WIDTHS.includes(height) : !HORIZONTAL_LADDER_WIDTHS.includes(width);
8720
+ const byLongSide = square || !vertical || offLadder;
8721
+ const byShortSide = square || vertical || offLadder;
8722
+ if (square) {
8712
8723
  width = height * (16 / 9);
8713
8724
  }
8714
- if (width >= 3740) {
8715
- return 2160;
8716
- }
8717
- if (width >= 3100) {
8718
- return 1800;
8719
- }
8720
- if (width >= 2460) {
8721
- return 1440;
8722
- }
8723
- if (width >= 1820) {
8724
- return 1080;
8725
- }
8726
- if (width >= 1180) {
8727
- return 720;
8728
- }
8729
- if (width >= 860) {
8730
- return 540;
8731
- }
8732
- if (width >= 540) {
8733
- return 360;
8725
+ const tier = SNAP_TIERS.find(([, minLong, minShort]) => byLongSide && width >= minLong || byShortSide && height >= minShort);
8726
+ if (tier) {
8727
+ return tier[0];
8734
8728
  }
8735
- return height;
8729
+ const lowestLabel = SNAP_TIERS[SNAP_TIERS.length - 1][0];
8730
+ return height < lowestLabel ? height : Math.round(width * 9 / 16);
8736
8731
  };
8737
8732
  const findClosestAssetByQuality = (assets, quality) => {
8738
8733
  let height;
@@ -8,7 +8,7 @@ import {
8
8
  import { forwardRef, Suspense, lazy, Fragment } from "react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  var WistiaPlayerWrapper = lazy(
11
- async () => import("./WistiaPlayerWrapper-EMO5P7JE.mjs").then((module) => ({
11
+ async () => import("./WistiaPlayerWrapper-SIXM5N4B.mjs").then((module) => ({
12
12
  default: module.WistiaPlayerWrapper
13
13
  }))
14
14
  );
@@ -37,7 +37,7 @@ var WistiaPlayerWrapper = forwardRef(
37
37
  setSwatchAspectRatio(ratio);
38
38
  });
39
39
  }
40
- void import("./wistia-player-2WHP2WYF.mjs");
40
+ void import("./wistia-player-ACX2IWXC.mjs");
41
41
  void customElements.whenDefined("wistia-player").then(() => {
42
42
  setIsWistiaPlayerDefined(true);
43
43
  });
@@ -6982,8 +6982,8 @@ var __webpack_modules__ = {
6982
6982
  const PROD_SSL_EMBED_HOST = "embed-ssl.wistia.com";
6983
6983
  const PROD_FASTLY_SSL_HOST = "embed-fastly.wistia.com";
6984
6984
  const SSL_EMBED_HOST = "embed-ssl.wistia.com";
6985
- const TAGGED_VERSION = "0.8.1";
6986
- const CURRENT_SHA = "c78c98d62de05b49e2415ee676b30c075b0800bb";
6985
+ const TAGGED_VERSION = "0.8.4";
6986
+ const CURRENT_SHA = "c4d23790ab87519b4a5dfd0240c6d9275e27ed64";
6987
6987
  const DEFAULT_PROTOCOL = (() => {
6988
6988
  if (typeof window !== "undefined" && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z === window && utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.location) {
6989
6989
  return utilities_root_js__WEBPACK_IMPORTED_MODULE_0__.z.location.protocol;
@@ -8054,38 +8054,33 @@ var __webpack_modules__ = {
8054
8054
  }
8055
8055
  });
8056
8056
  };
8057
+ const HORIZONTAL_LADDER_WIDTHS = [400, 640, 960, 1280, 1920, 2560, 3200, 3840];
8058
+ const VERTICAL_LADDER_WIDTHS = [240, 360, 540, 720, 1080, 1440, 1800, 2160];
8059
+ const SNAP_TIERS = [[2160, 3740, 2104], [1800, 3100, 1744], [1440, 2460, 1384], [1080, 1820, 1024], [720, 1180, 664], [540, 860, 484], [360, 540, 304]];
8057
8060
  const numericSizeSnapped = (width, height) => {
8058
- if (height > width) {
8061
+ if (width === 0 || height === 0) {
8062
+ return 0;
8063
+ }
8064
+ const vertical = height > width;
8065
+ if (vertical) {
8059
8066
  const tmpWidth = width;
8060
8067
  width = height;
8061
8068
  height = tmpWidth;
8062
8069
  }
8063
8070
  const aspectRatio = width / height;
8064
- if (aspectRatio < 1.05) {
8071
+ const square = aspectRatio < 1.05;
8072
+ const offLadder = vertical ? !VERTICAL_LADDER_WIDTHS.includes(height) : !HORIZONTAL_LADDER_WIDTHS.includes(width);
8073
+ const byLongSide = square || !vertical || offLadder;
8074
+ const byShortSide = square || vertical || offLadder;
8075
+ if (square) {
8065
8076
  width = height * (16 / 9);
8066
8077
  }
8067
- if (width >= 3740) {
8068
- return 2160;
8069
- }
8070
- if (width >= 3100) {
8071
- return 1800;
8072
- }
8073
- if (width >= 2460) {
8074
- return 1440;
8075
- }
8076
- if (width >= 1820) {
8077
- return 1080;
8078
- }
8079
- if (width >= 1180) {
8080
- return 720;
8081
- }
8082
- if (width >= 860) {
8083
- return 540;
8084
- }
8085
- if (width >= 540) {
8086
- return 360;
8078
+ const tier = SNAP_TIERS.find(([, minLong, minShort]) => byLongSide && width >= minLong || byShortSide && height >= minShort);
8079
+ if (tier) {
8080
+ return tier[0];
8087
8081
  }
8088
- return height;
8082
+ const lowestLabel = SNAP_TIERS[SNAP_TIERS.length - 1][0];
8083
+ return height < lowestLabel ? height : Math.round(width * 9 / 16);
8089
8084
  };
8090
8085
  const findClosestAssetByQuality = (assets, quality) => {
8091
8086
  let height;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wistia/wistia-player-react",
3
- "version": "0.8.1",
3
+ "version": "0.8.4",
4
4
  "packageManager": "yarn@4.18.0",
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": [
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@wistia/utils": "^1.0.1",
49
- "@wistia/wistia-player": "0.8.1"
49
+ "@wistia/wistia-player": "0.8.4"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "react": ">=18.0.0 <20.0.0",