@remotion/player 3.0.20 → 3.0.21

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 (2) hide show
  1. package/dist/PlayerUI.js +30 -3
  2. package/package.json +3 -3
package/dist/PlayerUI.js CHANGED
@@ -1,7 +1,30 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  const jsx_runtime_1 = require("react/jsx-runtime");
4
- const react_1 = require("react");
27
+ const react_1 = __importStar(require("react"));
5
28
  const remotion_1 = require("remotion");
6
29
  const calculate_scale_1 = require("./calculate-scale");
7
30
  const error_boundary_1 = require("./error-boundary");
@@ -15,6 +38,11 @@ const calculate_player_size_1 = require("./utils/calculate-player-size");
15
38
  const is_node_1 = require("./utils/is-node");
16
39
  const use_click_prevention_on_double_click_1 = require("./utils/use-click-prevention-on-double-click");
17
40
  const use_element_size_1 = require("./utils/use-element-size");
41
+ const reactVersion = react_1.default.version.split('.')[0];
42
+ if (reactVersion === '0') {
43
+ throw new Error(`Version ${reactVersion} of "react" is not supported by Remotion`);
44
+ }
45
+ const doesReactVersionSupportSuspense = parseInt(reactVersion, 10) >= 18;
18
46
  const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps, clickToPlay, showVolumeControls, mediaVolume, mediaMuted, doubleClickToFullscreen, setMediaMuted, setMediaVolume, spaceKeyToPlayOrPause, errorFallback, playbackRate, renderLoading, }, ref) => {
19
47
  var _a, _b, _c;
20
48
  const config = remotion_1.Internals.useUnsafeVideoConfig();
@@ -251,8 +279,7 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
251
279
  return null;
252
280
  }
253
281
  const content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: outer, onClick: clickToPlay ? handleClick : undefined, onDoubleClick: doubleClickToFullscreen ? handleDoubleClick : undefined, children: (0, jsx_runtime_1.jsx)("div", { style: containerStyle, className: player_css_classname_1.PLAYER_CSS_CLASSNAME, children: VideoComponent ? ((0, jsx_runtime_1.jsx)(error_boundary_1.ErrorBoundary, { onError: onError, errorFallback: errorFallback, children: (0, jsx_runtime_1.jsx)(VideoComponent, { ...((_b = video === null || video === void 0 ? void 0 : video.defaultProps) !== null && _b !== void 0 ? _b : {}), ...((_c = inputProps) !== null && _c !== void 0 ? _c : {}) }) })) : null }) }), controls ? ((0, jsx_runtime_1.jsx)(PlayerControls_1.Controls, { fps: config.fps, durationInFrames: config.durationInFrames, hovered: hovered, player: player, onFullscreenButtonClick: onFullscreenButtonClick, isFullscreen: isFullscreen, allowFullscreen: allowFullscreen, showVolumeControls: showVolumeControls, onExitFullscreenButtonClick: onExitFullscreenButtonClick, spaceKeyToPlayOrPause: spaceKeyToPlayOrPause })) : null] }));
254
- // Don't render suspense on Node.js
255
- if (is_node_1.IS_NODE) {
282
+ if (is_node_1.IS_NODE && !doesReactVersionSupportSuspense) {
256
283
  return ((0, jsx_runtime_1.jsx)("div", { ref: container, style: outerStyle, children: content }));
257
284
  }
258
285
  const loadingMarkup = renderLoading
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/player",
3
- "version": "3.0.20",
3
+ "version": "3.0.21",
4
4
  "description": "Remotion Player",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -28,7 +28,7 @@
28
28
  ],
29
29
  "license": "SEE LICENSE IN LICENSE.md",
30
30
  "dependencies": {
31
- "remotion": "3.0.20"
31
+ "remotion": "3.0.21"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "react": ">=16.8.0",
@@ -63,5 +63,5 @@
63
63
  "publishConfig": {
64
64
  "access": "public"
65
65
  },
66
- "gitHead": "0652aafea4415577e6259a9d334aba785c911e7e"
66
+ "gitHead": "1a31b6d28d7b1cf84d6c84f6ea2d3e1eb1e65bda"
67
67
  }