@remotion/player 4.0.233 → 4.0.235

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.
@@ -29,6 +29,7 @@ const remotion_1 = require("remotion");
29
29
  const PlayerControls_js_1 = require("./PlayerControls.js");
30
30
  const calculate_scale_js_1 = require("./calculate-scale.js");
31
31
  const error_boundary_js_1 = require("./error-boundary.js");
32
+ const license_blacklist_js_1 = require("./license-blacklist.js");
32
33
  const player_css_classname_js_1 = require("./player-css-classname.js");
33
34
  const use_playback_js_1 = require("./use-playback.js");
34
35
  const use_player_js_1 = require("./use-player.js");
@@ -417,11 +418,11 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
417
418
  showPosterWhenBuffering && showBufferIndicator && player.isPlaying(),
418
419
  ].some(Boolean);
419
420
  const { left, top, width, height, ...outerWithoutScale } = outer;
420
- const content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: outer, onPointerDown: clickToPlay ? handlePointerDown : undefined, onDoubleClick: doubleClickToFullscreen ? handleDoubleClick : undefined, children: (0, jsx_runtime_1.jsxs)("div", { style: containerStyle, className: (0, player_css_classname_js_1.playerCssClassname)(overrideInternalClassName), children: [VideoComponent ? ((0, jsx_runtime_1.jsx)(error_boundary_js_1.ErrorBoundary, { onError: onError, errorFallback: errorFallback, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.CurrentScaleContext.Provider, { value: currentScale, children: (0, jsx_runtime_1.jsx)(VideoComponent, { ...((_c = video === null || video === void 0 ? void 0 : video.props) !== null && _c !== void 0 ? _c : {}), ...(inputProps !== null && inputProps !== void 0 ? inputProps : {}) }) }) })) : null, shouldShowPoster && posterFillMode === 'composition-size' ? ((0, jsx_runtime_1.jsx)("div", { style: {
421
- ...outerWithoutScale,
422
- width: config.width,
423
- height: config.height,
424
- }, onPointerDown: clickToPlay ? handlePointerDown : undefined, onDoubleClick: doubleClickToFullscreen ? handleDoubleClick : undefined, children: poster })) : null] }) }), shouldShowPoster && posterFillMode === 'player-size' ? ((0, jsx_runtime_1.jsx)("div", { style: outer, onPointerDown: clickToPlay ? handlePointerDown : undefined, onDoubleClick: doubleClickToFullscreen ? handleDoubleClick : undefined, children: poster })) : null, controls ? ((0, jsx_runtime_1.jsx)(PlayerControls_js_1.Controls, { fps: config.fps, playing: player.playing, toggle: player.toggle, durationInFrames: config.durationInFrames, containerRef: container, onFullscreenButtonClick: onFullscreenButtonClick, isFullscreen: isFullscreen, allowFullscreen: allowFullscreen, showVolumeControls: showVolumeControls, onExitFullscreenButtonClick: onExitFullscreenButtonClick, spaceKeyToPlayOrPause: spaceKeyToPlayOrPause, onSeekEnd: onSeekEnd, onSeekStart: onSeekStart, inFrame: inFrame, outFrame: outFrame, initiallyShowControls: initiallyShowControls, canvasSize: canvasSize, renderFullscreenButton: renderFullscreenButton, renderPlayPauseButton: renderPlayPauseButton, alwaysShowControls: alwaysShowControls, showPlaybackRateControl: showPlaybackRateControl, buffering: showBufferIndicator, hideControlsWhenPointerDoesntMove: hideControlsWhenPointerDoesntMove, onDoubleClick: doubleClickToFullscreen ? handleDoubleClick : undefined, onPointerDown: clickToPlay
421
+ const content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: outer, onPointerDown: clickToPlay ? handlePointerDown : undefined, onDoubleClick: doubleClickToFullscreen ? handleDoubleClick : undefined, children: [(0, jsx_runtime_1.jsxs)("div", { style: containerStyle, className: (0, player_css_classname_js_1.playerCssClassname)(overrideInternalClassName), children: [VideoComponent ? ((0, jsx_runtime_1.jsx)(error_boundary_js_1.ErrorBoundary, { onError: onError, errorFallback: errorFallback, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.CurrentScaleContext.Provider, { value: currentScale, children: (0, jsx_runtime_1.jsx)(VideoComponent, { ...((_c = video === null || video === void 0 ? void 0 : video.props) !== null && _c !== void 0 ? _c : {}), ...(inputProps !== null && inputProps !== void 0 ? inputProps : {}) }) }) })) : null, shouldShowPoster && posterFillMode === 'composition-size' ? ((0, jsx_runtime_1.jsx)("div", { style: {
422
+ ...outerWithoutScale,
423
+ width: config.width,
424
+ height: config.height,
425
+ }, onPointerDown: clickToPlay ? handlePointerDown : undefined, onDoubleClick: doubleClickToFullscreen ? handleDoubleClick : undefined, children: poster })) : null] }), (0, jsx_runtime_1.jsx)(license_blacklist_js_1.RenderWarningIfBlacklist, {})] }), shouldShowPoster && posterFillMode === 'player-size' ? ((0, jsx_runtime_1.jsx)("div", { style: outer, onPointerDown: clickToPlay ? handlePointerDown : undefined, onDoubleClick: doubleClickToFullscreen ? handleDoubleClick : undefined, children: poster })) : null, controls ? ((0, jsx_runtime_1.jsx)(PlayerControls_js_1.Controls, { fps: config.fps, playing: player.playing, toggle: player.toggle, durationInFrames: config.durationInFrames, containerRef: container, onFullscreenButtonClick: onFullscreenButtonClick, isFullscreen: isFullscreen, allowFullscreen: allowFullscreen, showVolumeControls: showVolumeControls, onExitFullscreenButtonClick: onExitFullscreenButtonClick, spaceKeyToPlayOrPause: spaceKeyToPlayOrPause, onSeekEnd: onSeekEnd, onSeekStart: onSeekStart, inFrame: inFrame, outFrame: outFrame, initiallyShowControls: initiallyShowControls, canvasSize: canvasSize, renderFullscreenButton: renderFullscreenButton, renderPlayPauseButton: renderPlayPauseButton, alwaysShowControls: alwaysShowControls, showPlaybackRateControl: showPlaybackRateControl, buffering: showBufferIndicator, hideControlsWhenPointerDoesntMove: hideControlsWhenPointerDoesntMove, onDoubleClick: doubleClickToFullscreen ? handleDoubleClick : undefined, onPointerDown: clickToPlay
425
426
  ? handlePointerDown
426
427
  : undefined, renderMuteButton: renderMuteButton, renderVolumeSlider: renderVolumeSlider })) : null] }));
427
428
  if (is_node_js_1.IS_NODE && !doesReactVersionSupportSuspense) {
@@ -15,5 +15,5 @@ export declare class ErrorBoundary extends React.Component<{
15
15
  hasError: Error;
16
16
  };
17
17
  componentDidCatch(error: Error): void;
18
- render(): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | null | undefined;
18
+ render(): string | number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
19
19
  }
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const getHashOfDomain: () => Promise<string | null>;
3
+ export declare const RenderWarningIfBlacklist: React.FC;
@@ -0,0 +1,86 @@
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
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.RenderWarningIfBlacklist = exports.getHashOfDomain = void 0;
27
+ const jsx_runtime_1 = require("react/jsx-runtime");
28
+ const react_1 = __importStar(require("react"));
29
+ const getHashOfDomain = async () => {
30
+ if (typeof window === 'undefined') {
31
+ return null;
32
+ }
33
+ if (typeof window.crypto === 'undefined') {
34
+ return null;
35
+ }
36
+ if (typeof window.crypto.subtle === 'undefined') {
37
+ return null;
38
+ }
39
+ try {
40
+ const hashBuffer = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(window.location.hostname));
41
+ return Array.from(new Uint8Array(hashBuffer))
42
+ .map((b) => b.toString(16).padStart(2, '0'))
43
+ .join('');
44
+ }
45
+ catch (_a) {
46
+ return null;
47
+ }
48
+ };
49
+ exports.getHashOfDomain = getHashOfDomain;
50
+ const style = {
51
+ backgroundColor: 'red',
52
+ position: 'absolute',
53
+ padding: 12,
54
+ fontFamily: 'Arial',
55
+ };
56
+ const DOMAIN_BLACKLIST = [
57
+ '28d262b44cc61fa750f1686b16ad0604dabfe193fbc263eec05c89b7ad4c2cd6',
58
+ '4db1b0a94be33165dfefcb3ba03d04c7a2666dd27c496d3dc9fa41858e94925e',
59
+ 'fbc48530bbf245da790f63675e84e06bab38c3b114fab07eb350025119922bdc',
60
+ '7baf10a8932757b1b3a22b3fce10a048747ac2f8eaf638603487e3705b07eb83',
61
+ '8a6c21a598d8c667272b5207c051b85997bf5b45d5fb712378be3f27cd72c6a6',
62
+ 'a2f7aaac9c50a9255e7fc376110c4e0bfe153722dc66ed3c5d3bf2a135f65518',
63
+ ];
64
+ let ran = false;
65
+ const RenderWarningIfBlacklist = () => {
66
+ const [unlicensed, setUnlicensed] = react_1.default.useState(false);
67
+ (0, react_1.useEffect)(() => {
68
+ // Prevent firing twice in strict mode
69
+ if (ran) {
70
+ return;
71
+ }
72
+ ran = true;
73
+ (0, exports.getHashOfDomain)()
74
+ .then((hash) => {
75
+ if (hash && DOMAIN_BLACKLIST.includes(hash)) {
76
+ setUnlicensed(true);
77
+ }
78
+ })
79
+ .catch(() => { });
80
+ }, []);
81
+ if (!unlicensed) {
82
+ return null;
83
+ }
84
+ return ((0, jsx_runtime_1.jsx)("div", { style: style, children: (0, jsx_runtime_1.jsx)("a", { style: { color: 'white' }, href: "https://github.com/remotion-dev/remotion/pull/4589", children: "Remotion Unlicensed \u2013 Contact hi@remotion.dev" }) }));
85
+ };
86
+ exports.RenderWarningIfBlacklist = RenderWarningIfBlacklist;
@@ -1136,7 +1136,7 @@ var useElementSize = (ref, options) => {
1136
1136
  // src/Player.tsx
1137
1137
  import {
1138
1138
  forwardRef as forwardRef2,
1139
- useEffect as useEffect13,
1139
+ useEffect as useEffect14,
1140
1140
  useImperativeHandle as useImperativeHandle2,
1141
1141
  useLayoutEffect,
1142
1142
  useMemo as useMemo14,
@@ -1146,12 +1146,12 @@ import {
1146
1146
  import { Composition, Internals as Internals13 } from "remotion";
1147
1147
 
1148
1148
  // src/PlayerUI.tsx
1149
- import React9, {
1149
+ import React10, {
1150
1150
  Suspense,
1151
1151
  forwardRef,
1152
1152
  useCallback as useCallback11,
1153
1153
  useContext as useContext6,
1154
- useEffect as useEffect12,
1154
+ useEffect as useEffect13,
1155
1155
  useImperativeHandle,
1156
1156
  useMemo as useMemo12,
1157
1157
  useRef as useRef10,
@@ -2151,6 +2151,68 @@ class ErrorBoundary extends React8.Component {
2151
2151
  }
2152
2152
  }
2153
2153
 
2154
+ // src/license-blacklist.tsx
2155
+ import React9, { useEffect as useEffect12 } from "react";
2156
+ import { jsx as jsx11 } from "react/jsx-runtime";
2157
+ var getHashOfDomain = async () => {
2158
+ if (typeof window === "undefined") {
2159
+ return null;
2160
+ }
2161
+ if (typeof window.crypto === "undefined") {
2162
+ return null;
2163
+ }
2164
+ if (typeof window.crypto.subtle === "undefined") {
2165
+ return null;
2166
+ }
2167
+ try {
2168
+ const hashBuffer = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(window.location.hostname));
2169
+ return Array.from(new Uint8Array(hashBuffer)).map((b) => b.toString(16).padStart(2, "0")).join("");
2170
+ } catch {
2171
+ return null;
2172
+ }
2173
+ };
2174
+ var style = {
2175
+ backgroundColor: "red",
2176
+ position: "absolute",
2177
+ padding: 12,
2178
+ fontFamily: "Arial"
2179
+ };
2180
+ var DOMAIN_BLACKLIST = [
2181
+ "28d262b44cc61fa750f1686b16ad0604dabfe193fbc263eec05c89b7ad4c2cd6",
2182
+ "4db1b0a94be33165dfefcb3ba03d04c7a2666dd27c496d3dc9fa41858e94925e",
2183
+ "fbc48530bbf245da790f63675e84e06bab38c3b114fab07eb350025119922bdc",
2184
+ "7baf10a8932757b1b3a22b3fce10a048747ac2f8eaf638603487e3705b07eb83",
2185
+ "8a6c21a598d8c667272b5207c051b85997bf5b45d5fb712378be3f27cd72c6a6",
2186
+ "a2f7aaac9c50a9255e7fc376110c4e0bfe153722dc66ed3c5d3bf2a135f65518"
2187
+ ];
2188
+ var ran = false;
2189
+ var RenderWarningIfBlacklist = () => {
2190
+ const [unlicensed, setUnlicensed] = React9.useState(false);
2191
+ useEffect12(() => {
2192
+ if (ran) {
2193
+ return;
2194
+ }
2195
+ ran = true;
2196
+ getHashOfDomain().then((hash) => {
2197
+ if (hash && DOMAIN_BLACKLIST.includes(hash)) {
2198
+ setUnlicensed(true);
2199
+ }
2200
+ }).catch(() => {
2201
+ });
2202
+ }, []);
2203
+ if (!unlicensed) {
2204
+ return null;
2205
+ }
2206
+ return /* @__PURE__ */ jsx11("div", {
2207
+ style,
2208
+ children: /* @__PURE__ */ jsx11("a", {
2209
+ style: { color: "white" },
2210
+ href: "https://github.com/remotion-dev/remotion/pull/4589",
2211
+ children: "Remotion Unlicensed – Contact hi@remotion.dev"
2212
+ })
2213
+ });
2214
+ };
2215
+
2154
2216
  // src/player-css-classname.ts
2155
2217
  var playerCssClassname = (override) => {
2156
2218
  return override ?? "__remotion-player";
@@ -2252,15 +2314,15 @@ var useClickPreventionOnDoubleClick = (onClick, onDoubleClick, doubleClickToFull
2252
2314
  };
2253
2315
 
2254
2316
  // src/PlayerUI.tsx
2255
- import { jsx as jsx11, jsxs as jsxs9, Fragment as Fragment3 } from "react/jsx-runtime";
2256
- var reactVersion = React9.version.split(".")[0];
2317
+ import { jsx as jsx12, jsxs as jsxs9, Fragment as Fragment3 } from "react/jsx-runtime";
2318
+ var reactVersion = React10.version.split(".")[0];
2257
2319
  if (reactVersion === "0") {
2258
2320
  throw new Error(`Version ${reactVersion} of "react" is not supported by Remotion`);
2259
2321
  }
2260
2322
  var doesReactVersionSupportSuspense = parseInt(reactVersion, 10) >= 18;
2261
2323
  var PlayerUI = ({
2262
2324
  controls,
2263
- style,
2325
+ style: style2,
2264
2326
  loop,
2265
2327
  autoPlay,
2266
2328
  allowFullscreen,
@@ -2323,13 +2385,13 @@ var PlayerUI = ({
2323
2385
  getCurrentFrame: player.getCurrentFrame,
2324
2386
  browserMediaControlsBehavior
2325
2387
  });
2326
- useEffect12(() => {
2388
+ useEffect13(() => {
2327
2389
  if (hasPausedToResume && !player.playing) {
2328
2390
  setHasPausedToResume(false);
2329
2391
  player.play();
2330
2392
  }
2331
2393
  }, [hasPausedToResume, player]);
2332
- useEffect12(() => {
2394
+ useEffect13(() => {
2333
2395
  const { current } = container;
2334
2396
  if (!current) {
2335
2397
  return;
@@ -2371,7 +2433,7 @@ var PlayerUI = ({
2371
2433
  document.exitFullscreen();
2372
2434
  }
2373
2435
  }, []);
2374
- useEffect12(() => {
2436
+ useEffect13(() => {
2375
2437
  const { current } = container;
2376
2438
  if (!current) {
2377
2439
  return;
@@ -2409,7 +2471,7 @@ var PlayerUI = ({
2409
2471
  }, [canvasSize, config]);
2410
2472
  const scale = layout?.scale ?? 1;
2411
2473
  const initialScaleIgnored = useRef10(false);
2412
- useEffect12(() => {
2474
+ useEffect13(() => {
2413
2475
  if (!initialScaleIgnored.current) {
2414
2476
  initialScaleIgnored.current = true;
2415
2477
  return;
@@ -2418,17 +2480,17 @@ var PlayerUI = ({
2418
2480
  }, [player.emitter, scale]);
2419
2481
  const { setMediaVolume, setMediaMuted } = useContext6(Internals11.SetMediaVolumeContext);
2420
2482
  const { mediaMuted, mediaVolume } = useContext6(Internals11.MediaVolumeContext);
2421
- useEffect12(() => {
2483
+ useEffect13(() => {
2422
2484
  player.emitter.dispatchVolumeChange(mediaVolume);
2423
2485
  }, [player.emitter, mediaVolume]);
2424
2486
  const isMuted = mediaMuted || mediaVolume === 0;
2425
- useEffect12(() => {
2487
+ useEffect13(() => {
2426
2488
  player.emitter.dispatchMuteChange({
2427
2489
  isMuted
2428
2490
  });
2429
2491
  }, [player.emitter, isMuted]);
2430
2492
  const [showBufferIndicator, setShowBufferState] = useState11(false);
2431
- useEffect12(() => {
2493
+ useEffect13(() => {
2432
2494
  let timeout = null;
2433
2495
  let stopped = false;
2434
2496
  const onBuffer = () => {
@@ -2549,11 +2611,11 @@ var PlayerUI = ({
2549
2611
  return calculateOuterStyle({
2550
2612
  canvasSize,
2551
2613
  config,
2552
- style,
2614
+ style: style2,
2553
2615
  overflowVisible,
2554
2616
  layout
2555
2617
  });
2556
- }, [canvasSize, config, layout, overflowVisible, style]);
2618
+ }, [canvasSize, config, layout, overflowVisible, style2]);
2557
2619
  const outer = useMemo12(() => {
2558
2620
  return calculateOuter({ config, layout, scale, overflowVisible });
2559
2621
  }, [config, layout, overflowVisible, scale]);
@@ -2601,7 +2663,7 @@ var PlayerUI = ({
2601
2663
  }
2602
2664
  }, [exitFullscreen, isFullscreen, requestFullscreen]);
2603
2665
  const { handlePointerDown, handleDoubleClick } = useClickPreventionOnDoubleClick(onSingleClick, onDoubleClick, doubleClickToFullscreen && allowFullscreen && supportsFullScreen);
2604
- useEffect12(() => {
2666
+ useEffect13(() => {
2605
2667
  if (shouldAutoplay) {
2606
2668
  player.play();
2607
2669
  setShouldAutoPlay(false);
@@ -2640,45 +2702,48 @@ var PlayerUI = ({
2640
2702
  const { left, top, width, height, ...outerWithoutScale } = outer;
2641
2703
  const content = /* @__PURE__ */ jsxs9(Fragment3, {
2642
2704
  children: [
2643
- /* @__PURE__ */ jsx11("div", {
2705
+ /* @__PURE__ */ jsxs9("div", {
2644
2706
  style: outer,
2645
2707
  onPointerDown: clickToPlay ? handlePointerDown : undefined,
2646
2708
  onDoubleClick: doubleClickToFullscreen ? handleDoubleClick : undefined,
2647
- children: /* @__PURE__ */ jsxs9("div", {
2648
- style: containerStyle3,
2649
- className: playerCssClassname(overrideInternalClassName),
2650
- children: [
2651
- VideoComponent ? /* @__PURE__ */ jsx11(ErrorBoundary, {
2652
- onError,
2653
- errorFallback,
2654
- children: /* @__PURE__ */ jsx11(Internals11.CurrentScaleContext.Provider, {
2655
- value: currentScale,
2656
- children: /* @__PURE__ */ jsx11(VideoComponent, {
2657
- ...video?.props ?? {},
2658
- ...inputProps ?? {}
2709
+ children: [
2710
+ /* @__PURE__ */ jsxs9("div", {
2711
+ style: containerStyle3,
2712
+ className: playerCssClassname(overrideInternalClassName),
2713
+ children: [
2714
+ VideoComponent ? /* @__PURE__ */ jsx12(ErrorBoundary, {
2715
+ onError,
2716
+ errorFallback,
2717
+ children: /* @__PURE__ */ jsx12(Internals11.CurrentScaleContext.Provider, {
2718
+ value: currentScale,
2719
+ children: /* @__PURE__ */ jsx12(VideoComponent, {
2720
+ ...video?.props ?? {},
2721
+ ...inputProps ?? {}
2722
+ })
2659
2723
  })
2660
- })
2661
- }) : null,
2662
- shouldShowPoster && posterFillMode === "composition-size" ? /* @__PURE__ */ jsx11("div", {
2663
- style: {
2664
- ...outerWithoutScale,
2665
- width: config.width,
2666
- height: config.height
2667
- },
2668
- onPointerDown: clickToPlay ? handlePointerDown : undefined,
2669
- onDoubleClick: doubleClickToFullscreen ? handleDoubleClick : undefined,
2670
- children: poster
2671
- }) : null
2672
- ]
2673
- })
2724
+ }) : null,
2725
+ shouldShowPoster && posterFillMode === "composition-size" ? /* @__PURE__ */ jsx12("div", {
2726
+ style: {
2727
+ ...outerWithoutScale,
2728
+ width: config.width,
2729
+ height: config.height
2730
+ },
2731
+ onPointerDown: clickToPlay ? handlePointerDown : undefined,
2732
+ onDoubleClick: doubleClickToFullscreen ? handleDoubleClick : undefined,
2733
+ children: poster
2734
+ }) : null
2735
+ ]
2736
+ }),
2737
+ /* @__PURE__ */ jsx12(RenderWarningIfBlacklist, {})
2738
+ ]
2674
2739
  }),
2675
- shouldShowPoster && posterFillMode === "player-size" ? /* @__PURE__ */ jsx11("div", {
2740
+ shouldShowPoster && posterFillMode === "player-size" ? /* @__PURE__ */ jsx12("div", {
2676
2741
  style: outer,
2677
2742
  onPointerDown: clickToPlay ? handlePointerDown : undefined,
2678
2743
  onDoubleClick: doubleClickToFullscreen ? handleDoubleClick : undefined,
2679
2744
  children: poster
2680
2745
  }) : null,
2681
- controls ? /* @__PURE__ */ jsx11(Controls, {
2746
+ controls ? /* @__PURE__ */ jsx12(Controls, {
2682
2747
  fps: config.fps,
2683
2748
  playing: player.playing,
2684
2749
  toggle: player.toggle,
@@ -2710,18 +2775,18 @@ var PlayerUI = ({
2710
2775
  ]
2711
2776
  });
2712
2777
  if (IS_NODE && !doesReactVersionSupportSuspense) {
2713
- return /* @__PURE__ */ jsx11("div", {
2778
+ return /* @__PURE__ */ jsx12("div", {
2714
2779
  ref: container,
2715
2780
  style: outerStyle,
2716
2781
  className: className2,
2717
2782
  children: content
2718
2783
  });
2719
2784
  }
2720
- return /* @__PURE__ */ jsx11("div", {
2785
+ return /* @__PURE__ */ jsx12("div", {
2721
2786
  ref: container,
2722
2787
  style: outerStyle,
2723
2788
  className: className2,
2724
- children: /* @__PURE__ */ jsx11(Suspense, {
2789
+ children: /* @__PURE__ */ jsx12(Suspense, {
2725
2790
  fallback: loadingMarkup,
2726
2791
  children: content
2727
2792
  })
@@ -2758,7 +2823,7 @@ var getPreferredVolume = () => {
2758
2823
  };
2759
2824
 
2760
2825
  // src/SharedPlayerContext.tsx
2761
- import { jsx as jsx12 } from "react/jsx-runtime";
2826
+ import { jsx as jsx13 } from "react/jsx-runtime";
2762
2827
  var PLAYER_COMP_ID = "player-comp";
2763
2828
  var SharedPlayerContexts = ({
2764
2829
  children,
@@ -2833,22 +2898,22 @@ var SharedPlayerContexts = ({
2833
2898
  setMediaVolume: setMediaVolumeAndPersist
2834
2899
  };
2835
2900
  }, [setMediaVolumeAndPersist]);
2836
- return /* @__PURE__ */ jsx12(Internals12.CanUseRemotionHooksProvider, {
2837
- children: /* @__PURE__ */ jsx12(Internals12.Timeline.TimelineContext.Provider, {
2901
+ return /* @__PURE__ */ jsx13(Internals12.CanUseRemotionHooksProvider, {
2902
+ children: /* @__PURE__ */ jsx13(Internals12.Timeline.TimelineContext.Provider, {
2838
2903
  value: timelineContext,
2839
- children: /* @__PURE__ */ jsx12(Internals12.CompositionManager.Provider, {
2904
+ children: /* @__PURE__ */ jsx13(Internals12.CompositionManager.Provider, {
2840
2905
  value: compositionManagerContext,
2841
- children: /* @__PURE__ */ jsx12(Internals12.ResolveCompositionConfig, {
2842
- children: /* @__PURE__ */ jsx12(Internals12.PrefetchProvider, {
2843
- children: /* @__PURE__ */ jsx12(Internals12.DurationsContextProvider, {
2844
- children: /* @__PURE__ */ jsx12(Internals12.MediaVolumeContext.Provider, {
2906
+ children: /* @__PURE__ */ jsx13(Internals12.ResolveCompositionConfig, {
2907
+ children: /* @__PURE__ */ jsx13(Internals12.PrefetchProvider, {
2908
+ children: /* @__PURE__ */ jsx13(Internals12.DurationsContextProvider, {
2909
+ children: /* @__PURE__ */ jsx13(Internals12.MediaVolumeContext.Provider, {
2845
2910
  value: mediaVolumeContextValue,
2846
- children: /* @__PURE__ */ jsx12(Internals12.SetMediaVolumeContext.Provider, {
2911
+ children: /* @__PURE__ */ jsx13(Internals12.SetMediaVolumeContext.Provider, {
2847
2912
  value: setMediaVolumeContextValue,
2848
- children: /* @__PURE__ */ jsx12(Internals12.SharedAudioContextProvider, {
2913
+ children: /* @__PURE__ */ jsx13(Internals12.SharedAudioContextProvider, {
2849
2914
  numberOfAudioTags: numberOfSharedAudioTags,
2850
2915
  component,
2851
- children: /* @__PURE__ */ jsx12(Internals12.BufferingProvider, {
2916
+ children: /* @__PURE__ */ jsx13(Internals12.BufferingProvider, {
2852
2917
  children
2853
2918
  })
2854
2919
  })
@@ -2960,7 +3025,7 @@ var validateDurationInFrames = NoReactInternals.validateDurationInFrames;
2960
3025
  var validateDefaultAndInputProps = NoReactInternals.validateDefaultAndInputProps;
2961
3026
 
2962
3027
  // src/Player.tsx
2963
- import { jsx as jsx13 } from "react/jsx-runtime";
3028
+ import { jsx as jsx14 } from "react/jsx-runtime";
2964
3029
  var componentOrNullIfLazy = (props) => {
2965
3030
  if ("component" in props) {
2966
3031
  return props.component;
@@ -2973,7 +3038,7 @@ var PlayerFn = ({
2973
3038
  compositionWidth,
2974
3039
  fps,
2975
3040
  inputProps,
2976
- style,
3041
+ style: style2,
2977
3042
  controls = false,
2978
3043
  loop = false,
2979
3044
  autoPlay = false,
@@ -3085,7 +3150,7 @@ var PlayerFn = ({
3085
3150
  throw new TypeError(`'numberOfSharedAudioTags' must be an integer but got '${numberOfSharedAudioTags}' instead`);
3086
3151
  }
3087
3152
  validatePlaybackRate(currentPlaybackRate);
3088
- useEffect13(() => {
3153
+ useEffect14(() => {
3089
3154
  setCurrentPlaybackRate(playbackRate);
3090
3155
  }, [playbackRate]);
3091
3156
  useImperativeHandle2(ref, () => rootRef.current, []);
@@ -3119,8 +3184,8 @@ var PlayerFn = ({
3119
3184
  mode: "prevent-media-session"
3120
3185
  };
3121
3186
  }, [passedBrowserMediaControlsBehavior]);
3122
- return /* @__PURE__ */ jsx13(Internals13.IsPlayerContextProvider, {
3123
- children: /* @__PURE__ */ jsx13(SharedPlayerContexts, {
3187
+ return /* @__PURE__ */ jsx14(Internals13.IsPlayerContextProvider, {
3188
+ children: /* @__PURE__ */ jsx14(SharedPlayerContexts, {
3124
3189
  timelineContext: timelineContextValue,
3125
3190
  component,
3126
3191
  compositionHeight,
@@ -3129,11 +3194,11 @@ var PlayerFn = ({
3129
3194
  fps,
3130
3195
  numberOfSharedAudioTags,
3131
3196
  initiallyMuted,
3132
- children: /* @__PURE__ */ jsx13(Internals13.Timeline.SetTimelineContext.Provider, {
3197
+ children: /* @__PURE__ */ jsx14(Internals13.Timeline.SetTimelineContext.Provider, {
3133
3198
  value: setTimelineContextValue,
3134
- children: /* @__PURE__ */ jsx13(PlayerEmitterProvider, {
3199
+ children: /* @__PURE__ */ jsx14(PlayerEmitterProvider, {
3135
3200
  currentPlaybackRate,
3136
- children: /* @__PURE__ */ jsx13(PlayerUI_default, {
3201
+ children: /* @__PURE__ */ jsx14(PlayerUI_default, {
3137
3202
  ref: rootRef,
3138
3203
  posterFillMode,
3139
3204
  renderLoading,
@@ -3141,7 +3206,7 @@ var PlayerFn = ({
3141
3206
  loop: Boolean(loop),
3142
3207
  controls: Boolean(controls),
3143
3208
  errorFallback,
3144
- style,
3209
+ style: style2,
3145
3210
  inputProps: actualInputProps,
3146
3211
  allowFullscreen: Boolean(allowFullscreen),
3147
3212
  moveToBeginningWhenEnded: Boolean(moveToBeginningWhenEnded),
@@ -3190,7 +3255,7 @@ import {
3190
3255
  import { Internals as Internals15, random as random2 } from "remotion";
3191
3256
 
3192
3257
  // src/ThumbnailUI.tsx
3193
- import React12, {
3258
+ import React13, {
3194
3259
  forwardRef as forwardRef3,
3195
3260
  Suspense as Suspense2,
3196
3261
  useCallback as useCallback13,
@@ -3216,14 +3281,14 @@ var useThumbnail = () => {
3216
3281
  };
3217
3282
 
3218
3283
  // src/ThumbnailUI.tsx
3219
- import { jsx as jsx14 } from "react/jsx-runtime";
3220
- var reactVersion2 = React12.version.split(".")[0];
3284
+ import { jsx as jsx15 } from "react/jsx-runtime";
3285
+ var reactVersion2 = React13.version.split(".")[0];
3221
3286
  if (reactVersion2 === "0") {
3222
3287
  throw new Error(`Version ${reactVersion2} of "react" is not supported by Remotion`);
3223
3288
  }
3224
3289
  var doesReactVersionSupportSuspense2 = parseInt(reactVersion2, 10) >= 18;
3225
3290
  var ThumbnailUI = ({
3226
- style,
3291
+ style: style2,
3227
3292
  inputProps,
3228
3293
  errorFallback,
3229
3294
  renderLoading,
@@ -3263,12 +3328,12 @@ var ThumbnailUI = ({
3263
3328
  const outerStyle = useMemo16(() => {
3264
3329
  return calculateOuterStyle({
3265
3330
  config,
3266
- style,
3331
+ style: style2,
3267
3332
  canvasSize,
3268
3333
  overflowVisible,
3269
3334
  layout
3270
3335
  });
3271
- }, [canvasSize, config, layout, overflowVisible, style]);
3336
+ }, [canvasSize, config, layout, overflowVisible, style2]);
3272
3337
  const outer = useMemo16(() => {
3273
3338
  return calculateOuter({ config, layout, scale, overflowVisible });
3274
3339
  }, [config, layout, overflowVisible, scale]);
@@ -3300,17 +3365,17 @@ var ThumbnailUI = ({
3300
3365
  if (!config) {
3301
3366
  return null;
3302
3367
  }
3303
- const content = /* @__PURE__ */ jsx14("div", {
3368
+ const content = /* @__PURE__ */ jsx15("div", {
3304
3369
  style: outer,
3305
- children: /* @__PURE__ */ jsx14("div", {
3370
+ children: /* @__PURE__ */ jsx15("div", {
3306
3371
  style: containerStyle3,
3307
3372
  className: playerCssClassname(overrideInternalClassName),
3308
- children: VideoComponent ? /* @__PURE__ */ jsx14(ErrorBoundary, {
3373
+ children: VideoComponent ? /* @__PURE__ */ jsx15(ErrorBoundary, {
3309
3374
  onError,
3310
3375
  errorFallback,
3311
- children: /* @__PURE__ */ jsx14(Internals14.CurrentScaleContext.Provider, {
3376
+ children: /* @__PURE__ */ jsx15(Internals14.CurrentScaleContext.Provider, {
3312
3377
  value: currentScaleContext,
3313
- children: /* @__PURE__ */ jsx14(VideoComponent, {
3378
+ children: /* @__PURE__ */ jsx15(VideoComponent, {
3314
3379
  ...video?.props ?? {},
3315
3380
  ...inputProps ?? {}
3316
3381
  })
@@ -3319,18 +3384,18 @@ var ThumbnailUI = ({
3319
3384
  })
3320
3385
  });
3321
3386
  if (IS_NODE && !doesReactVersionSupportSuspense2) {
3322
- return /* @__PURE__ */ jsx14("div", {
3387
+ return /* @__PURE__ */ jsx15("div", {
3323
3388
  ref: container,
3324
3389
  style: outerStyle,
3325
3390
  className: className2,
3326
3391
  children: content
3327
3392
  });
3328
3393
  }
3329
- return /* @__PURE__ */ jsx14("div", {
3394
+ return /* @__PURE__ */ jsx15("div", {
3330
3395
  ref: container,
3331
3396
  style: outerStyle,
3332
3397
  className: className2,
3333
- children: /* @__PURE__ */ jsx14(Suspense2, {
3398
+ children: /* @__PURE__ */ jsx15(Suspense2, {
3334
3399
  fallback: loadingMarkup,
3335
3400
  children: content
3336
3401
  })
@@ -3339,10 +3404,10 @@ var ThumbnailUI = ({
3339
3404
  var ThumbnailUI_default = forwardRef3(ThumbnailUI);
3340
3405
 
3341
3406
  // src/Thumbnail.tsx
3342
- import { jsx as jsx15 } from "react/jsx-runtime";
3407
+ import { jsx as jsx16 } from "react/jsx-runtime";
3343
3408
  var ThumbnailFn = ({
3344
3409
  frameToDisplay,
3345
- style,
3410
+ style: style2,
3346
3411
  inputProps,
3347
3412
  compositionHeight,
3348
3413
  compositionWidth,
@@ -3386,8 +3451,8 @@ var ThumbnailFn = ({
3386
3451
  const passedInputProps = useMemo17(() => {
3387
3452
  return inputProps ?? {};
3388
3453
  }, [inputProps]);
3389
- return /* @__PURE__ */ jsx15(Internals15.IsPlayerContextProvider, {
3390
- children: /* @__PURE__ */ jsx15(SharedPlayerContexts, {
3454
+ return /* @__PURE__ */ jsx16(Internals15.IsPlayerContextProvider, {
3455
+ children: /* @__PURE__ */ jsx16(SharedPlayerContexts, {
3391
3456
  timelineContext: timelineState,
3392
3457
  component: Component,
3393
3458
  compositionHeight,
@@ -3396,15 +3461,15 @@ var ThumbnailFn = ({
3396
3461
  fps,
3397
3462
  numberOfSharedAudioTags: 0,
3398
3463
  initiallyMuted: true,
3399
- children: /* @__PURE__ */ jsx15(ThumbnailEmitterContext.Provider, {
3464
+ children: /* @__PURE__ */ jsx16(ThumbnailEmitterContext.Provider, {
3400
3465
  value: emitter,
3401
- children: /* @__PURE__ */ jsx15(ThumbnailUI_default, {
3466
+ children: /* @__PURE__ */ jsx16(ThumbnailUI_default, {
3402
3467
  ref: rootRef,
3403
3468
  className: className2,
3404
3469
  errorFallback,
3405
3470
  inputProps: passedInputProps,
3406
3471
  renderLoading,
3407
- style,
3472
+ style: style2,
3408
3473
  overflowVisible,
3409
3474
  overrideInternalClassName
3410
3475
  })
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/player"
4
4
  },
5
5
  "name": "@remotion/player",
6
- "version": "4.0.233",
6
+ "version": "4.0.235",
7
7
  "description": "React component for embedding a Remotion preview into your app",
8
8
  "main": "dist/cjs/index.js",
9
9
  "types": "dist/cjs/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  ],
29
29
  "license": "SEE LICENSE IN LICENSE.md",
30
30
  "dependencies": {
31
- "remotion": "4.0.233"
31
+ "remotion": "4.0.235"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "react": ">=16.8.0",
@@ -43,7 +43,7 @@
43
43
  "webpack": "5.96.1",
44
44
  "zod": "3.22.3",
45
45
  "eslint": "9.14.0",
46
- "@remotion/eslint-config-internal": "4.0.233"
46
+ "@remotion/eslint-config-internal": "4.0.235"
47
47
  },
48
48
  "keywords": [
49
49
  "remotion",
package/LICENSE.md DELETED
@@ -1,49 +0,0 @@
1
- # Remotion License
2
-
3
- In Remotion 5.0, the license will slightly change. [View the changes here](https://github.com/remotion-dev/remotion/pull/3750).
4
-
5
- ---
6
-
7
- Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion to create videos for free (even commercial), while a company license is required for for-profit organizations of a certain size. This two-tier system was designed to ensure funding for this project while still allowing the source code to be available and the program to be free for most. Read below for the exact terms of use.
8
-
9
- - [Free license](#free-license)
10
- - [Company license](#company-license)
11
-
12
- ## Free license
13
-
14
- Copyright © 2024 [Remotion](https://www.remotion.dev)
15
-
16
- ### Eligibility
17
-
18
- You are eligible to use Remotion for free if you are:
19
-
20
- - an individual
21
- - a for-profit organization with up to 3 employees
22
- - a non-profit or not-for-profit organization
23
- - evaluating whether Remotion is a good fit, and are not yet using it in a commercial way
24
-
25
- ### Allowed use cases
26
-
27
- Permission is hereby granted, free of charge, to any person eligible for the "Free license", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify the software to their own liking, for the purpose of fulfilling their custom use case or to contribute bug fixes or improvements back to Remotion.
28
-
29
- ### Disallowed use cases
30
-
31
- It is not allowed to copy or modify Remotion code for the purpose of selling, renting, licensing, relicensing, or sublicensing your own derivate of Remotion.
32
-
33
- ### Warranty notice
34
-
35
- The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the author or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
36
-
37
- ### Support
38
-
39
- Support is provided on a best-we-can-do basis via GitHub Issues and Discord.
40
-
41
- ## Company license
42
-
43
- You are required to obtain a company license to use Remotion if you are not within the group of entities eligible for a free license. This license will enable you to use Remotion for the allowed use cases specified in the free license, and give you access to prioritized support (read the [Support Policy](https://www.remotion.dev/docs/support)).
44
-
45
- Visit [remotion.pro](https://www.remotion.pro/license) for pricing and to buy a license.
46
-
47
- ### FAQs
48
-
49
- Are you not sure whether you need a company license because of an edge case? Here are some [frequently asked questions](https://www.remotion.pro/faq).