@remotion/player 4.0.344 → 4.0.346

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.
@@ -25,10 +25,7 @@ const componentOrNullIfLazy = (props) => {
25
25
  exports.componentOrNullIfLazy = componentOrNullIfLazy;
26
26
  const PlayerFn = ({ durationInFrames, compositionHeight, compositionWidth, fps, inputProps, style, controls = false, loop = false, autoPlay = false, showVolumeControls = true, allowFullscreen = true, clickToPlay, doubleClickToFullscreen = false, spaceKeyToPlayOrPause = true, moveToBeginningWhenEnded = true, numberOfSharedAudioTags = 5, errorFallback = () => '⚠️', playbackRate = 1, renderLoading, className, showPosterWhenUnplayed, showPosterWhenEnded, showPosterWhenPaused, showPosterWhenBuffering, showPosterWhenBufferingAndPaused, initialFrame, renderPoster, inFrame, outFrame, initiallyShowControls, renderFullscreenButton, renderPlayPauseButton, renderVolumeSlider, alwaysShowControls = false, initiallyMuted = false, showPlaybackRateControl = false, posterFillMode = 'player-size', bufferStateDelayInMilliseconds, hideControlsWhenPointerDoesntMove = true, overflowVisible = false, renderMuteButton, browserMediaControlsBehavior: passedBrowserMediaControlsBehavior, overrideInternalClassName, logLevel = 'info', noSuspense, acknowledgeRemotionLicense, audioLatencyHint = 'interactive', volumePersistenceKey, ...componentProps }, ref) => {
27
27
  if (typeof window !== 'undefined') {
28
- // eslint-disable-next-line react-hooks/rules-of-hooks
29
- (0, react_1.useLayoutEffect)(() => {
30
- window.remotion_isPlayer = true;
31
- }, []);
28
+ window.remotion_isPlayer = true;
32
29
  }
33
30
  // @ts-expect-error
34
31
  if (componentProps.defaultProps !== undefined) {
@@ -54,6 +54,15 @@ const SharedPlayerContexts = ({ children, timelineContext, fps, compositionHeigh
54
54
  mountTime: Date.now(),
55
55
  };
56
56
  }, [logLevel]);
57
- return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.LogLevelContext.Provider, { value: logLevelContext, children: (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, audioLatencyHint: audioLatencyHint, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.BufferingProvider, { children: children }) }) }) }) }) }) }) }) }) }) }));
57
+ const env = (0, react_1.useMemo)(() => {
58
+ return {
59
+ isPlayer: true,
60
+ isRendering: false,
61
+ isStudio: false,
62
+ isClientSideRendering: false,
63
+ isReadOnlyStudio: false,
64
+ };
65
+ }, []);
66
+ return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.RemotionEnvironmentContext.Provider, { value: env, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.LogLevelContext.Provider, { value: logLevelContext, children: (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, audioLatencyHint: audioLatencyHint, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.BufferingProvider, { children: children }) }) }) }) }) }) }) }) }) }) }) }));
58
67
  };
59
68
  exports.SharedPlayerContexts = SharedPlayerContexts;
@@ -2938,26 +2938,38 @@ var SharedPlayerContexts = ({
2938
2938
  mountTime: Date.now()
2939
2939
  };
2940
2940
  }, [logLevel]);
2941
- return /* @__PURE__ */ jsx13(Internals13.LogLevelContext.Provider, {
2942
- value: logLevelContext,
2943
- children: /* @__PURE__ */ jsx13(Internals13.CanUseRemotionHooksProvider, {
2944
- children: /* @__PURE__ */ jsx13(Internals13.Timeline.TimelineContext.Provider, {
2945
- value: timelineContext,
2946
- children: /* @__PURE__ */ jsx13(Internals13.CompositionManager.Provider, {
2947
- value: compositionManagerContext,
2948
- children: /* @__PURE__ */ jsx13(Internals13.ResolveCompositionConfig, {
2949
- children: /* @__PURE__ */ jsx13(Internals13.PrefetchProvider, {
2950
- children: /* @__PURE__ */ jsx13(Internals13.DurationsContextProvider, {
2951
- children: /* @__PURE__ */ jsx13(Internals13.MediaVolumeContext.Provider, {
2952
- value: mediaVolumeContextValue,
2953
- children: /* @__PURE__ */ jsx13(Internals13.SetMediaVolumeContext.Provider, {
2954
- value: setMediaVolumeContextValue,
2955
- children: /* @__PURE__ */ jsx13(Internals13.SharedAudioContextProvider, {
2956
- numberOfAudioTags: numberOfSharedAudioTags,
2957
- component,
2958
- audioLatencyHint,
2959
- children: /* @__PURE__ */ jsx13(Internals13.BufferingProvider, {
2960
- children
2941
+ const env = useMemo13(() => {
2942
+ return {
2943
+ isPlayer: true,
2944
+ isRendering: false,
2945
+ isStudio: false,
2946
+ isClientSideRendering: false,
2947
+ isReadOnlyStudio: false
2948
+ };
2949
+ }, []);
2950
+ return /* @__PURE__ */ jsx13(Internals13.RemotionEnvironmentContext.Provider, {
2951
+ value: env,
2952
+ children: /* @__PURE__ */ jsx13(Internals13.LogLevelContext.Provider, {
2953
+ value: logLevelContext,
2954
+ children: /* @__PURE__ */ jsx13(Internals13.CanUseRemotionHooksProvider, {
2955
+ children: /* @__PURE__ */ jsx13(Internals13.Timeline.TimelineContext.Provider, {
2956
+ value: timelineContext,
2957
+ children: /* @__PURE__ */ jsx13(Internals13.CompositionManager.Provider, {
2958
+ value: compositionManagerContext,
2959
+ children: /* @__PURE__ */ jsx13(Internals13.ResolveCompositionConfig, {
2960
+ children: /* @__PURE__ */ jsx13(Internals13.PrefetchProvider, {
2961
+ children: /* @__PURE__ */ jsx13(Internals13.DurationsContextProvider, {
2962
+ children: /* @__PURE__ */ jsx13(Internals13.MediaVolumeContext.Provider, {
2963
+ value: mediaVolumeContextValue,
2964
+ children: /* @__PURE__ */ jsx13(Internals13.SetMediaVolumeContext.Provider, {
2965
+ value: setMediaVolumeContextValue,
2966
+ children: /* @__PURE__ */ jsx13(Internals13.SharedAudioContextProvider, {
2967
+ numberOfAudioTags: numberOfSharedAudioTags,
2968
+ component,
2969
+ audioLatencyHint,
2970
+ children: /* @__PURE__ */ jsx13(Internals13.BufferingProvider, {
2971
+ children
2972
+ })
2961
2973
  })
2962
2974
  })
2963
2975
  })
@@ -3142,9 +3154,7 @@ var PlayerFn = ({
3142
3154
  ...componentProps
3143
3155
  }, ref) => {
3144
3156
  if (typeof window !== "undefined") {
3145
- useLayoutEffect(() => {
3146
- window.remotion_isPlayer = true;
3147
- }, []);
3157
+ window.remotion_isPlayer = true;
3148
3158
  }
3149
3159
  if (componentProps.defaultProps !== undefined) {
3150
3160
  throw new Error("The <Player /> component does not accept `defaultProps`, but some were passed. Use `inputProps` instead.");
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.344",
6
+ "version": "4.0.346",
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.344"
31
+ "remotion": "4.0.346"
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.19.0",
46
- "@remotion/eslint-config-internal": "4.0.344"
46
+ "@remotion/eslint-config-internal": "4.0.346"
47
47
  },
48
48
  "keywords": [
49
49
  "remotion",