@remotion/player 4.0.226 → 4.0.228

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.
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  export declare const bufferingIndicatorStrokeWidth = 3;
3
3
  export declare const BufferingIndicator: React.FC<{
4
- type: 'player' | 'studio';
4
+ readonly type: 'player' | 'studio';
5
5
  }>;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  export declare const PlayerEmitterProvider: React.FC<{
3
- children: React.ReactNode;
4
- currentPlaybackRate: number | null;
3
+ readonly children: React.ReactNode;
4
+ readonly currentPlaybackRate: number | null;
5
5
  }>;
@@ -3,6 +3,6 @@ import type { Size } from './utils/use-element-size.js';
3
3
  export declare const Checkmark: () => import("react/jsx-runtime.js").JSX.Element;
4
4
  export declare const playerButtonStyle: React.CSSProperties;
5
5
  export declare const PlaybackrateControl: React.FC<{
6
- playbackRates: number[];
7
- canvasSize: Size;
6
+ readonly playbackRates: number[];
7
+ readonly canvasSize: Size;
8
8
  }>;
@@ -419,7 +419,7 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
419
419
  showPosterWhenBuffering && showBufferIndicator && player.isPlaying(),
420
420
  ].some(Boolean);
421
421
  const { left, top, width, height, ...outerWithoutScale } = outer;
422
- 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: player_css_classname_js_1.PLAYER_CSS_CLASSNAME, 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.ClipComposition, { 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
+ 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: player_css_classname_js_1.PLAYER_CSS_CLASSNAME, 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: {
423
423
  ...outerWithoutScale,
424
424
  width: config.width,
425
425
  height: config.height,
@@ -55,6 +55,6 @@ const SharedPlayerContexts = ({ children, timelineContext, fps, compositionHeigh
55
55
  setMediaVolume: setMediaVolumeAndPersist,
56
56
  };
57
57
  }, [setMediaVolumeAndPersist]);
58
- return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.Timeline.TimelineContext.Provider, { value: timelineContext, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.CompositionManager.Provider, { value: compositionManagerContext, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.ResolveCompositionConfig, { children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.PrefetchProvider, { children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.DurationsContextProvider, { children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.MediaVolumeContext.Provider, { value: mediaVolumeContextValue, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.NativeLayersProvider, { children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.SetMediaVolumeContext.Provider, { value: setMediaVolumeContextValue, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.SharedAudioContextProvider, { numberOfAudioTags: numberOfSharedAudioTags, component: component, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.BufferingProvider, { children: children }) }) }) }) }) }) }) }) }) }) }));
58
+ return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.Timeline.TimelineContext.Provider, { value: timelineContext, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.CompositionManager.Provider, { value: compositionManagerContext, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.ResolveCompositionConfig, { children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.PrefetchProvider, { children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.DurationsContextProvider, { children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.MediaVolumeContext.Provider, { value: mediaVolumeContextValue, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.SetMediaVolumeContext.Provider, { value: setMediaVolumeContextValue, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.SharedAudioContextProvider, { numberOfAudioTags: numberOfSharedAudioTags, component: component, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.BufferingProvider, { children: children }) }) }) }) }) }) }) }) }) }));
59
59
  };
60
60
  exports.SharedPlayerContexts = SharedPlayerContexts;
@@ -2,11 +2,11 @@ import React from 'react';
2
2
  import type { ThumbnailMethods } from './player-methods.js';
3
3
  import type { ErrorFallback, RenderLoading } from './PlayerUI.js';
4
4
  declare const _default: React.ForwardRefExoticComponent<{
5
- inputProps: Record<string, unknown>;
6
- style?: React.CSSProperties;
7
- errorFallback: ErrorFallback;
8
- renderLoading: RenderLoading | undefined;
9
- className: string | undefined;
10
- overflowVisible: boolean;
5
+ readonly inputProps: Record<string, unknown>;
6
+ readonly style?: React.CSSProperties;
7
+ readonly errorFallback: ErrorFallback;
8
+ readonly renderLoading: RenderLoading | undefined;
9
+ readonly className: string | undefined;
10
+ readonly overflowVisible: boolean;
11
11
  } & React.RefAttributes<ThumbnailMethods>>;
12
12
  export default _default;
@@ -49,6 +49,6 @@ export declare const calculateOuter: ({ layout, scale, config, overflowVisible,
49
49
  readonly position: "absolute";
50
50
  readonly left: number;
51
51
  readonly top: number;
52
- readonly overflow: "hidden" | "visible";
52
+ readonly overflow: "visible" | "hidden";
53
53
  };
54
54
  export {};
@@ -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
  }
@@ -4,7 +4,7 @@ export declare const fullscreenIconSize = 16;
4
4
  export declare const PlayIcon: React.FC;
5
5
  export declare const PauseIcon: React.FC;
6
6
  export declare const FullscreenIcon: React.FC<{
7
- isFullscreen: boolean;
7
+ readonly isFullscreen: boolean;
8
8
  }>;
9
9
  export declare const VolumeOffIcon: React.FC;
10
10
  export declare const VolumeOnIcon: React.FC;
@@ -60,10 +60,10 @@ export declare const PlayerInternals: {
60
60
  useHoverState: (ref: React.RefObject<HTMLDivElement>, hideControlsWhenPointerDoesntMove: boolean | number) => boolean;
61
61
  updateAllElementsSizes: () => void;
62
62
  PlayerEmitterProvider: import("react").FC<{
63
- children: import("react").ReactNode;
64
- currentPlaybackRate: number | null;
63
+ readonly children: import("react").ReactNode;
64
+ readonly currentPlaybackRate: number | null;
65
65
  }>;
66
66
  BufferingIndicator: import("react").FC<{
67
- type: "player" | "studio";
67
+ readonly type: "player" | "studio";
68
68
  }>;
69
69
  };
@@ -23,7 +23,6 @@ const HelloWorld = () => {
23
23
  exports.HelloWorld = HelloWorld;
24
24
  const AllTheProviders = ({ children }) => {
25
25
  // overwriting console.error console does not gets poluted with all the errors
26
- // eslint-disable-next-line @typescript-eslint/no-empty-function
27
26
  window.console.error = () => { };
28
27
  return (0, jsx_runtime_1.jsx)("div", { children: children });
29
28
  };
@@ -25,7 +25,7 @@ const getPreferredVolume = () => {
25
25
  const val = window.localStorage.getItem(VOLUME_PERSISTANCE_KEY);
26
26
  return val ? Number(val) : 1;
27
27
  }
28
- catch (e) {
28
+ catch (_a) {
29
29
  // User can disallow localStorage access
30
30
  // https://github.com/remotion-dev/remotion/issues/3540
31
31
  return 1;
@@ -2611,13 +2611,11 @@ var PlayerUI = ({
2611
2611
  VideoComponent ? /* @__PURE__ */ jsx11(ErrorBoundary, {
2612
2612
  onError,
2613
2613
  errorFallback,
2614
- children: /* @__PURE__ */ jsx11(Internals10.ClipComposition, {
2615
- children: /* @__PURE__ */ jsx11(Internals10.CurrentScaleContext.Provider, {
2616
- value: currentScale,
2617
- children: /* @__PURE__ */ jsx11(VideoComponent, {
2618
- ...video?.props ?? {},
2619
- ...inputProps ?? {}
2620
- })
2614
+ children: /* @__PURE__ */ jsx11(Internals10.CurrentScaleContext.Provider, {
2615
+ value: currentScale,
2616
+ children: /* @__PURE__ */ jsx11(VideoComponent, {
2617
+ ...video?.props ?? {},
2618
+ ...inputProps ?? {}
2621
2619
  })
2622
2620
  })
2623
2621
  }) : null,
@@ -2713,7 +2711,7 @@ var getPreferredVolume = () => {
2713
2711
  try {
2714
2712
  const val = window.localStorage.getItem(VOLUME_PERSISTANCE_KEY);
2715
2713
  return val ? Number(val) : 1;
2716
- } catch (e) {
2714
+ } catch {
2717
2715
  return 1;
2718
2716
  }
2719
2717
  };
@@ -2804,15 +2802,13 @@ var SharedPlayerContexts = ({
2804
2802
  children: /* @__PURE__ */ jsx12(Internals11.DurationsContextProvider, {
2805
2803
  children: /* @__PURE__ */ jsx12(Internals11.MediaVolumeContext.Provider, {
2806
2804
  value: mediaVolumeContextValue,
2807
- children: /* @__PURE__ */ jsx12(Internals11.NativeLayersProvider, {
2808
- children: /* @__PURE__ */ jsx12(Internals11.SetMediaVolumeContext.Provider, {
2809
- value: setMediaVolumeContextValue,
2810
- children: /* @__PURE__ */ jsx12(Internals11.SharedAudioContextProvider, {
2811
- numberOfAudioTags: numberOfSharedAudioTags,
2812
- component,
2813
- children: /* @__PURE__ */ jsx12(Internals11.BufferingProvider, {
2814
- children
2815
- })
2805
+ children: /* @__PURE__ */ jsx12(Internals11.SetMediaVolumeContext.Provider, {
2806
+ value: setMediaVolumeContextValue,
2807
+ children: /* @__PURE__ */ jsx12(Internals11.SharedAudioContextProvider, {
2808
+ numberOfAudioTags: numberOfSharedAudioTags,
2809
+ component,
2810
+ children: /* @__PURE__ */ jsx12(Internals11.BufferingProvider, {
2811
+ children
2816
2812
  })
2817
2813
  })
2818
2814
  })
@@ -0,0 +1,23 @@
1
+ import {remotionFlatConfig} from '@remotion/eslint-config-internal';
2
+
3
+ const config = remotionFlatConfig({react: true});
4
+
5
+ export default {
6
+ ...config,
7
+ rules: {
8
+ ...config.rules,
9
+ 'no-console': 'error',
10
+ '@typescript-eslint/no-restricted-imports': [
11
+ 'error',
12
+ {
13
+ paths: [
14
+ {
15
+ name: 'zod',
16
+ message: 'Can only import zod as a type',
17
+ allowTypeImports: true,
18
+ },
19
+ ],
20
+ },
21
+ ],
22
+ },
23
+ };
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.226",
6
+ "version": "4.0.228",
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.226"
31
+ "remotion": "4.0.228"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "react": ">=16.8.0",
@@ -40,8 +40,10 @@
40
40
  "csstype": "^3.1.1",
41
41
  "react": "18.3.1",
42
42
  "react-dom": "18.3.1",
43
- "webpack": "5.94.0",
44
- "zod": "3.22.3"
43
+ "webpack": "5.96.1",
44
+ "zod": "3.22.3",
45
+ "eslint": "9.14.0",
46
+ "@remotion/eslint-config-internal": "4.0.228"
45
47
  },
46
48
  "keywords": [
47
49
  "remotion",
@@ -56,8 +58,8 @@
56
58
  "homepage": "https://www.remotion.dev/docs/player",
57
59
  "scripts": {
58
60
  "formatting": "prettier src --check",
59
- "lint": "eslint src --ext ts,tsx",
60
- "make": "bun ensure-correct-version.ts && bun --env-file=../.env.bundle bundle.ts",
61
+ "lint": "eslint src",
62
+ "make": "tsc -d && bun ensure-correct-version.ts && bun --env-file=../.env.bundle bundle.ts",
61
63
  "test": "bun test src",
62
64
  "prerelease": "cp ../../README.md ."
63
65
  }