@wistia/wistia-player-react 0.8.3 → 0.8.5

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,31 @@
1
1
  # @wistia/wistia-player-react
2
2
 
3
+ ## 0.8.5
4
+
5
+ ### Patch Changes
6
+
7
+ - d50c9ac: Removing a player just as its video loads no longer throws an error from the captions button.
8
+ - 6022455: Emoji reaction taps are now sent to Wistia with the player's other viewing stats, along with the time in the video they happened.
9
+ - f14cd7f: Viewers can now hide the emoji reactions other viewers left on the timeline, from a "Reactions" row in the player's settings menu. The choice is remembered with their other viewer preferences, and the reaction bar itself stays.
10
+ - 981e5e2: Reactions other viewers left on the video now show as small markers just above the playbar, one per stretch of the video. Hover or focus a marker to see which emoji were used, and click it to jump to that moment. The plugin's `reactions` option can supply that list instead.
11
+ - 8505132: Videos that need an access token to play now send that token when loading their captions and transcripts as well.
12
+ - 7d9f1be: The published types now include the `audioDescriptionControl` attribute and the legacy `audioDescriptionIsRequired` and `copyLinkAndThumbnailEnabled` embed options. How the player applies these settings is unchanged.
13
+ - Updated dependencies [d50c9ac]
14
+ - Updated dependencies [6022455]
15
+ - Updated dependencies [f14cd7f]
16
+ - Updated dependencies [981e5e2]
17
+ - Updated dependencies [8505132]
18
+ - Updated dependencies [7d9f1be]
19
+ - @wistia/wistia-player@0.8.5
20
+
21
+ ## 0.8.4
22
+
23
+ ### Patch Changes
24
+
25
+ - 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.
26
+ - Updated dependencies [8f5d62e]
27
+ - @wistia/wistia-player@0.8.4
28
+
3
29
  ## 0.8.3
4
30
 
5
31
  ### 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.3";
7633
- const CURRENT_SHA = "7e28a3678323b43bc66e7146d5e95a444ad30a5e";
7632
+ const TAGGED_VERSION = "0.8.5";
7633
+ const CURRENT_SHA = "1491adf963eae93a4a152b4cff04eda6bf8d1f0e";
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-DSM4BFDZ.mjs").then((module) => ({
11
+ async () => import("./WistiaPlayerWrapper-ILCBNBU4.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-465QVAAV.mjs");
40
+ void import("./wistia-player-DMLFUJWN.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.3";
6986
- const CURRENT_SHA = "7e28a3678323b43bc66e7146d5e95a444ad30a5e";
6985
+ const TAGGED_VERSION = "0.8.5";
6986
+ const CURRENT_SHA = "1491adf963eae93a4a152b4cff04eda6bf8d1f0e";
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.3",
3
+ "version": "0.8.5",
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.3"
49
+ "@wistia/wistia-player": "0.8.5"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "react": ">=18.0.0 <20.0.0",