@remotion/player 4.0.539 → 4.0.541

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,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { Size } from './utils/use-element-size.js';
3
- export declare const Checkmark: () => import("react/jsx-runtime").JSX.Element;
3
+ export declare const Checkmark: () => React.JSX.Element;
4
4
  export declare const playerButtonStyle: React.CSSProperties;
5
5
  export declare const PlaybackrateControl: React.FC<{
6
6
  readonly playbackRates: number[];
@@ -1,5 +1,6 @@
1
1
  import type { ComponentType } from 'react';
2
2
  import React from 'react';
3
+ import type { PreferredEffectBackend } from 'remotion';
3
4
  import type { AnyZodObject, CompProps, LogLevel } from 'remotion';
4
5
  import type { BrowserMediaControlsBehavior } from './browser-mediasession.js';
5
6
  import type { RenderMuteButton } from './MediaVolumeSlider.js';
@@ -65,6 +66,7 @@ export type PlayerProps<Schema extends AnyZodObject, Props extends Record<string
65
66
  readonly logLevel?: LogLevel;
66
67
  readonly noSuspense?: boolean;
67
68
  readonly acknowledgeRemotionLicense?: boolean;
69
+ readonly preferredEffectBackend?: PreferredEffectBackend;
68
70
  readonly audioLatencyHint?: AudioContextLatencyCategory;
69
71
  readonly sampleRate?: number;
70
72
  readonly volumePersistenceKey?: string;
@@ -73,7 +73,7 @@ const TimelineSequenceObserverComponent = ({ onTimelineSequenceChange }) => {
73
73
  };
74
74
  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 = no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES
75
75
  ? 0
76
- : 5, errorFallback = () => '⚠️', playbackRate = 1, preservePitch = false, renderLoading, className, showPosterWhenUnplayed, showPosterWhenEnded, showPosterWhenPaused, showPosterWhenBuffering, showPosterWhenBufferingAndPaused, initialFrame, renderPoster, inFrame, outFrame, initiallyShowControls, renderFullscreenButton, renderPlayPauseButton, renderVolumeSlider, renderCustomControls, alwaysShowControls = false, initiallyMuted = false, showPlaybackRateControl = false, posterFillMode = 'player-size', bufferStateDelayInMilliseconds, defaultPremountInSeconds = no_react_1.NoReactInternals.DEFAULT_PREMOUNT_IN_SECONDS, hideControlsWhenPointerDoesntMove = true, overflowVisible = false, renderMuteButton, browserMediaControlsBehavior: passedBrowserMediaControlsBehavior, overrideInternalClassName, logLevel = 'info', noSuspense, acknowledgeRemotionLicense, audioLatencyHint = 'playback', sampleRate = 48000, volumePersistenceKey, initialVolume, _experimentalKeepAudioContextAlive = false, ...componentProps }, ref) => {
76
+ : 5, errorFallback = () => '⚠️', playbackRate = 1, preservePitch = false, renderLoading, className, showPosterWhenUnplayed, showPosterWhenEnded, showPosterWhenPaused, showPosterWhenBuffering, showPosterWhenBufferingAndPaused, initialFrame, renderPoster, inFrame, outFrame, initiallyShowControls, renderFullscreenButton, renderPlayPauseButton, renderVolumeSlider, renderCustomControls, alwaysShowControls = false, initiallyMuted = false, showPlaybackRateControl = false, posterFillMode = 'player-size', bufferStateDelayInMilliseconds, defaultPremountInSeconds = no_react_1.NoReactInternals.DEFAULT_PREMOUNT_IN_SECONDS, hideControlsWhenPointerDoesntMove = true, overflowVisible = false, renderMuteButton, browserMediaControlsBehavior: passedBrowserMediaControlsBehavior, overrideInternalClassName, logLevel = 'info', noSuspense, acknowledgeRemotionLicense, audioLatencyHint = 'playback', preferredEffectBackend = 'auto', sampleRate = 48000, volumePersistenceKey, initialVolume, _experimentalKeepAudioContextAlive = false, ...componentProps }, ref) => {
77
77
  no_react_1.NoReactInternals.validateDefaultPremountInSeconds(defaultPremountInSeconds);
78
78
  if (typeof window !== 'undefined') {
79
79
  window.remotion_isPlayer = true;
@@ -258,7 +258,7 @@ const PlayerFn = ({ durationInFrames, compositionHeight, compositionWidth, fps,
258
258
  mode: 'prevent-media-session',
259
259
  });
260
260
  }, [passedBrowserMediaControlsBehavior]);
261
- const player = ((0, jsx_runtime_1.jsx)(remotion_1.Internals.IsPlayerContextProvider, { children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.SetTimelineContext.Provider, { value: setTimelineContextValue, children: (0, jsx_runtime_1.jsx)(SharedPlayerContext_js_1.SharedPlayerContexts, { timelineContext: timelineContextValue, playbackRateContext: playbackRateContextValue, preservePitch: preservePitch, component: component, compositionHeight: compositionHeight, compositionWidth: compositionWidth, durationInFrames: durationInFrames, fps: fps, numberOfSharedAudioTags: numberOfSharedAudioTags, initiallyMuted: initiallyMuted, logLevel: logLevel, audioLatencyHint: audioLatencyHint, sampleRate: sampleRate, _experimentalKeepAudioContextAlive: _experimentalKeepAudioContextAlive, volumePersistenceKey: volumePersistenceKey, initialVolume: initialVolume, inputProps: actualInputProps, audioEnabled: true, children: (0, jsx_runtime_1.jsx)(EmitterProvider_js_1.PlayerEmitterProvider, { currentPlaybackRate: currentPlaybackRate, children: (0, jsx_runtime_1.jsx)(PlayerUI_js_1.default, { ref: rootRef, posterFillMode: posterFillMode, renderLoading: renderLoading, autoPlay: Boolean(autoPlay), loop: Boolean(loop), controls: Boolean(controls), errorFallback: errorFallback, style: style, inputProps: actualInputProps, allowFullscreen: Boolean(allowFullscreen), moveToBeginningWhenEnded: Boolean(moveToBeginningWhenEnded), clickToPlay: typeof clickToPlay === 'boolean'
261
+ const player = ((0, jsx_runtime_1.jsx)(remotion_1.Internals.IsPlayerContextProvider, { children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.SetTimelineContext.Provider, { value: setTimelineContextValue, children: (0, jsx_runtime_1.jsx)(SharedPlayerContext_js_1.SharedPlayerContexts, { timelineContext: timelineContextValue, playbackRateContext: playbackRateContextValue, preservePitch: preservePitch, component: component, compositionHeight: compositionHeight, compositionWidth: compositionWidth, durationInFrames: durationInFrames, fps: fps, numberOfSharedAudioTags: numberOfSharedAudioTags, initiallyMuted: initiallyMuted, logLevel: logLevel, audioLatencyHint: audioLatencyHint, preferredEffectBackend: preferredEffectBackend, sampleRate: sampleRate, _experimentalKeepAudioContextAlive: _experimentalKeepAudioContextAlive, volumePersistenceKey: volumePersistenceKey, initialVolume: initialVolume, inputProps: actualInputProps, audioEnabled: true, children: (0, jsx_runtime_1.jsx)(EmitterProvider_js_1.PlayerEmitterProvider, { currentPlaybackRate: currentPlaybackRate, children: (0, jsx_runtime_1.jsx)(PlayerUI_js_1.default, { ref: rootRef, posterFillMode: posterFillMode, renderLoading: renderLoading, autoPlay: Boolean(autoPlay), loop: Boolean(loop), controls: Boolean(controls), errorFallback: errorFallback, style: style, inputProps: actualInputProps, allowFullscreen: Boolean(allowFullscreen), moveToBeginningWhenEnded: Boolean(moveToBeginningWhenEnded), clickToPlay: typeof clickToPlay === 'boolean'
262
262
  ? clickToPlay
263
263
  : Boolean(controls), showVolumeControls: Boolean(showVolumeControls), doubleClickToFullscreen: Boolean(doubleClickToFullscreen), spaceKeyToPlayOrPause: Boolean(spaceKeyToPlayOrPause), playbackRate: currentPlaybackRate, className: className !== null && className !== void 0 ? className : undefined, showPosterWhenUnplayed: Boolean(showPosterWhenUnplayed), showPosterWhenEnded: Boolean(showPosterWhenEnded), showPosterWhenPaused: Boolean(showPosterWhenPaused), showPosterWhenBuffering: Boolean(showPosterWhenBuffering), showPosterWhenBufferingAndPaused: Boolean(showPosterWhenBufferingAndPaused), renderPoster: renderPoster, inFrame: inFrame !== null && inFrame !== void 0 ? inFrame : null, outFrame: outFrame !== null && outFrame !== void 0 ? outFrame : null, initiallyShowControls: initiallyShowControls !== null && initiallyShowControls !== void 0 ? initiallyShowControls : true, renderFullscreen: renderFullscreenButton !== null && renderFullscreenButton !== void 0 ? renderFullscreenButton : null, renderPlayPauseButton: renderPlayPauseButton !== null && renderPlayPauseButton !== void 0 ? renderPlayPauseButton : null, renderMuteButton: renderMuteButton !== null && renderMuteButton !== void 0 ? renderMuteButton : null, renderVolumeSlider: renderVolumeSlider !== null && renderVolumeSlider !== void 0 ? renderVolumeSlider : null, renderCustomControls: renderCustomControls !== null && renderCustomControls !== void 0 ? renderCustomControls : null, alwaysShowControls: alwaysShowControls, showPlaybackRateControl: showPlaybackRateControl, bufferStateDelayInMilliseconds: bufferStateDelayInMilliseconds !== null && bufferStateDelayInMilliseconds !== void 0 ? bufferStateDelayInMilliseconds : 300, hideControlsWhenPointerDoesntMove: hideControlsWhenPointerDoesntMove, overflowVisible: overflowVisible, browserMediaControlsBehavior: browserMediaControlsBehavior, overrideInternalClassName: overrideInternalClassName !== null && overrideInternalClassName !== void 0 ? overrideInternalClassName : undefined, noSuspense: Boolean(noSuspense) }) }) }) }) }));
264
264
  return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.DefaultPremountContext.Provider, { value: defaultPremountInSeconds, children: onTimelineSequenceChange ? ((0, jsx_runtime_1.jsx)(remotion_1.Internals.SequenceRegistrationContext.Provider, { value: true, children: (0, jsx_runtime_1.jsxs)(remotion_1.Internals.SequenceManagerProvider, { children: [(0, jsx_runtime_1.jsx)(TimelineSequenceObserverComponent, { onTimelineSequenceChange: onTimelineSequenceChange }), player] }) })) : (player) }));
@@ -84,7 +84,8 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
84
84
  setHasPlayed(true);
85
85
  player.play(e);
86
86
  }, [player]);
87
- const { playerMuted, mediaVolume } = (0, react_1.useContext)(remotion_1.Internals.MediaVolumeContext);
87
+ const [playerMuted, setPlayerMuted] = remotion_1.Internals.usePlayerMutedState();
88
+ const [mediaVolume, setMediaVolume] = remotion_1.Internals.useMediaVolumeState();
88
89
  const canvasOverlay = (0, react_1.useContext)(canvas_overlay_context_js_1.CanvasOverlayContext);
89
90
  const canvasContentRef = (0, react_1.useRef)(null);
90
91
  (0, react_1.useEffect)(() => {
@@ -219,7 +220,6 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
219
220
  }
220
221
  player.emitter.dispatchScaleChange(scale);
221
222
  }, [player.emitter, scale]);
222
- const { setMediaVolume, setPlayerMuted } = (0, react_1.useContext)(remotion_1.Internals.SetMediaVolumeContext);
223
223
  const [showBufferIndicator, setShowBufferState] = (0, react_1.useState)(false);
224
224
  (0, react_1.useEffect)(() => {
225
225
  let timeout = null;
@@ -1,5 +1,6 @@
1
1
  import type { ComponentType, LazyExoticComponent } from 'react';
2
2
  import React from 'react';
3
+ import type { PreferredEffectBackend } from 'remotion';
3
4
  import type { LogLevel, PlaybackRateContextValue, TimelineContextValue } from 'remotion';
4
5
  export declare const PLAYER_COMP_ID = "player-comp";
5
6
  export declare const SharedPlayerContexts: React.FC<{
@@ -15,6 +16,7 @@ export declare const SharedPlayerContexts: React.FC<{
15
16
  readonly numberOfSharedAudioTags: number;
16
17
  readonly initiallyMuted: boolean;
17
18
  readonly logLevel: LogLevel;
19
+ readonly preferredEffectBackend: PreferredEffectBackend;
18
20
  readonly audioLatencyHint: AudioContextLatencyCategory;
19
21
  readonly sampleRate: number;
20
22
  readonly volumePersistenceKey?: string;
@@ -6,7 +6,7 @@ const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
7
  const volume_persistence_js_1 = require("./volume-persistence.js");
8
8
  exports.PLAYER_COMP_ID = 'player-comp';
9
- const SharedPlayerContexts = ({ children, timelineContext, playbackRateContext, preservePitch, fps, compositionHeight, compositionWidth, durationInFrames, component, numberOfSharedAudioTags, initiallyMuted, logLevel, audioLatencyHint, sampleRate, volumePersistenceKey, initialVolume, inputProps, audioEnabled, _experimentalKeepAudioContextAlive, }) => {
9
+ const SharedPlayerContexts = ({ children, timelineContext, playbackRateContext, preservePitch, fps, compositionHeight, compositionWidth, durationInFrames, component, numberOfSharedAudioTags, initiallyMuted, logLevel, audioLatencyHint, preferredEffectBackend, sampleRate, volumePersistenceKey, initialVolume, inputProps, audioEnabled, _experimentalKeepAudioContextAlive, }) => {
10
10
  const persistVolumeToStorage = initialVolume === undefined;
11
11
  const compositionManagerContext = (0, react_1.useMemo)(() => {
12
12
  const context = {
@@ -93,6 +93,6 @@ const SharedPlayerContexts = ({ children, timelineContext, playbackRateContext,
93
93
  isReadOnlyStudio: false,
94
94
  };
95
95
  }, []);
96
- 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.AbsoluteTimeContext.Provider, { value: timelineContext, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.PlaybackRateContext.Provider, { value: playbackRateContext, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.PlaybackPitchContext.Provider, { value: preservePitch, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.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.VideoProvider, { 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.BufferingProvider, { children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.SharedAudioContextProvider, { audioLatencyHint: audioLatencyHint, audioEnabled: shouldCreateAudioContext, previewSampleRate: sampleRate, _experimentalKeepAudioContextAlive: _experimentalKeepAudioContextAlive, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.SharedAudioTagsContextProvider, { numberOfAudioTags: numberOfSharedAudioTags, children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
96
+ 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.AbsoluteTimeContext.Provider, { value: timelineContext, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.PlaybackRateContext.Provider, { value: playbackRateContext, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.PlaybackPitchContext.Provider, { value: preservePitch, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.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.VideoProvider, { 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.BufferingProvider, { children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.SharedAudioContextProvider, { audioLatencyHint: audioLatencyHint, audioEnabled: shouldCreateAudioContext, previewSampleRate: sampleRate, _experimentalKeepAudioContextAlive: _experimentalKeepAudioContextAlive, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.SharedAudioTagsContextProvider, { numberOfAudioTags: numberOfSharedAudioTags, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.PreferredEffectBackendContext.Provider, { value: remotion_1.Internals.validatePreferredEffectBackend(preferredEffectBackend), children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
97
97
  };
98
98
  exports.SharedPlayerContexts = SharedPlayerContexts;
@@ -1,4 +1,5 @@
1
1
  import type { CSSProperties } from 'react';
2
+ import type { PreferredEffectBackend } from 'remotion';
2
3
  import type { AnyZodObject, CompProps, LogLevel } from 'remotion';
3
4
  import type { ThumbnailMethods } from './player-methods.js';
4
5
  import type { ErrorFallback, RenderLoading } from './PlayerUI.js';
@@ -15,6 +16,7 @@ export type ThumbnailProps<Schema extends AnyZodObject, Props extends Record<str
15
16
  readonly renderLoading?: RenderLoading;
16
17
  readonly className?: string;
17
18
  readonly overrideInternalClassName?: string;
19
+ readonly preferredEffectBackend?: PreferredEffectBackend;
18
20
  readonly logLevel?: LogLevel;
19
21
  readonly noSuspense?: boolean;
20
22
  };
@@ -11,7 +11,7 @@ const emitter_context_js_1 = require("./emitter-context.js");
11
11
  const event_emitter_js_1 = require("./event-emitter.js");
12
12
  const SharedPlayerContext_js_1 = require("./SharedPlayerContext.js");
13
13
  const ThumbnailUI_js_1 = __importDefault(require("./ThumbnailUI.js"));
14
- const ThumbnailFn = ({ frameToDisplay, style, inputProps, compositionHeight, compositionWidth, durationInFrames, fps, className, errorFallback = () => '⚠️', renderLoading, overflowVisible = false, overrideInternalClassName, logLevel = 'info', noSuspense, ...componentProps }, ref) => {
14
+ const ThumbnailFn = ({ frameToDisplay, style, inputProps, compositionHeight, compositionWidth, durationInFrames, fps, className, errorFallback = () => '⚠️', renderLoading, overflowVisible = false, overrideInternalClassName, logLevel = 'info', preferredEffectBackend = 'auto', noSuspense, ...componentProps }, ref) => {
15
15
  if (typeof window !== 'undefined') {
16
16
  // eslint-disable-next-line react-hooks/rules-of-hooks
17
17
  (0, react_1.useLayoutEffect)(() => {
@@ -70,7 +70,7 @@ const ThumbnailFn = ({ frameToDisplay, style, inputProps, compositionHeight, com
70
70
  const passedInputProps = (0, react_1.useMemo)(() => {
71
71
  return inputProps !== null && inputProps !== void 0 ? inputProps : {};
72
72
  }, [inputProps]);
73
- return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.IsPlayerContextProvider, { children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.SetTimelineContext.Provider, { value: setTimelineContext, children: (0, jsx_runtime_1.jsx)(SharedPlayerContext_js_1.SharedPlayerContexts, { timelineContext: timelineState, playbackRateContext: playbackRateContext, preservePitch: false, component: Component, compositionHeight: compositionHeight, compositionWidth: compositionWidth, durationInFrames: durationInFrames, fps: fps, numberOfSharedAudioTags: 0, initiallyMuted: true, logLevel: logLevel, audioLatencyHint: "playback", sampleRate: 48000, inputProps: passedInputProps, audioEnabled: false, _experimentalKeepAudioContextAlive: false, children: (0, jsx_runtime_1.jsx)(emitter_context_js_1.ThumbnailEmitterContext.Provider, { value: emitter, children: (0, jsx_runtime_1.jsx)(ThumbnailUI_js_1.default, { ref: rootRef, className: className, errorFallback: errorFallback, inputProps: passedInputProps, renderLoading: renderLoading, style: style, overflowVisible: overflowVisible, overrideInternalClassName: overrideInternalClassName, noSuspense: Boolean(noSuspense) }) }) }) }) }));
73
+ return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.IsPlayerContextProvider, { children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.SetTimelineContext.Provider, { value: setTimelineContext, children: (0, jsx_runtime_1.jsx)(SharedPlayerContext_js_1.SharedPlayerContexts, { timelineContext: timelineState, playbackRateContext: playbackRateContext, preservePitch: false, component: Component, compositionHeight: compositionHeight, compositionWidth: compositionWidth, durationInFrames: durationInFrames, fps: fps, numberOfSharedAudioTags: 0, initiallyMuted: true, logLevel: logLevel, audioLatencyHint: "playback", preferredEffectBackend: preferredEffectBackend, sampleRate: 48000, inputProps: passedInputProps, audioEnabled: false, _experimentalKeepAudioContextAlive: false, children: (0, jsx_runtime_1.jsx)(emitter_context_js_1.ThumbnailEmitterContext.Provider, { value: emitter, children: (0, jsx_runtime_1.jsx)(ThumbnailUI_js_1.default, { ref: rootRef, className: className, errorFallback: errorFallback, inputProps: passedInputProps, renderLoading: renderLoading, style: style, overflowVisible: overflowVisible, overrideInternalClassName: overrideInternalClassName, noSuspense: Boolean(noSuspense) }) }) }) }) }));
74
74
  };
75
75
  const forward = react_1.forwardRef;
76
76
  /*
@@ -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 | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | Iterable<React.ReactNode> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | React.ReactPortal | null | undefined> | null | undefined;
18
+ render(): string | number | bigint | boolean | React.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | Iterable<React.ReactNode> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | React.ReactPortal | null | undefined> | null | undefined;
19
19
  }
@@ -34,6 +34,36 @@ export declare const PlayerInternals: {
34
34
  readonly type: 'player' | 'studio';
35
35
  readonly color?: string;
36
36
  }>;
37
+ PlayerControls: import("react").FC<{
38
+ readonly fps: number;
39
+ readonly durationInFrames: number;
40
+ readonly showVolumeControls: boolean;
41
+ readonly onFullscreenButtonClick: import("react").MouseEventHandler<HTMLButtonElement>;
42
+ readonly isFullscreen: boolean;
43
+ readonly allowFullscreen: boolean;
44
+ readonly onExitFullscreenButtonClick: import("react").MouseEventHandler<HTMLButtonElement>;
45
+ readonly spaceKeyToPlayOrPause: boolean;
46
+ readonly onSeekEnd: () => void;
47
+ readonly onSeekStart: () => void;
48
+ readonly inFrame: number | null;
49
+ readonly outFrame: number | null;
50
+ readonly initiallyShowControls: number | boolean;
51
+ readonly canvasSize: import("./index.js").Size | null;
52
+ readonly renderPlayPauseButton: import("./PlayerControls.js").RenderPlayPauseButton | null;
53
+ readonly renderFullscreenButton: import("./PlayerControls.js").RenderFullscreenButton | null;
54
+ readonly alwaysShowControls: boolean;
55
+ readonly showPlaybackRateControl: boolean | number[];
56
+ readonly containerRef: React.RefObject<HTMLDivElement | null>;
57
+ readonly buffering: boolean;
58
+ readonly hideControlsWhenPointerDoesntMove: boolean | number;
59
+ readonly onPointerDown: ((ev: PointerEvent | import("react").SyntheticEvent) => void) | undefined;
60
+ readonly onDoubleClick: import("react").MouseEventHandler<HTMLDivElement> | undefined;
61
+ readonly renderMuteButton: import("./MediaVolumeSlider.js").RenderMuteButton | null;
62
+ readonly renderVolumeSlider: import("./render-volume-slider.js").RenderVolumeSlider | null;
63
+ readonly playing: boolean;
64
+ readonly toggle: (e?: import("react").SyntheticEvent | PointerEvent) => void;
65
+ readonly renderCustomControls: import("./player-methods.js").RenderCustomControls | null;
66
+ }>;
37
67
  TimelineSequenceObserverContext: import("react").Context<import("./timeline-sequence-observer-context.js").TimelineSequenceObserver | null>;
38
68
  CanvasOverlayContext: import("react").Context<import("react").ReactNode>;
39
69
  CanvasContentContext: import("react").Context<{
package/dist/cjs/index.js CHANGED
@@ -8,6 +8,7 @@ const canvas_overlay_context_js_1 = require("./canvas-overlay-context.js");
8
8
  const emitter_context_js_1 = require("./emitter-context.js");
9
9
  const EmitterProvider_js_1 = require("./EmitterProvider.js");
10
10
  const event_emitter_js_1 = require("./event-emitter.js");
11
+ const PlayerControls_js_1 = require("./PlayerControls.js");
11
12
  const timeline_sequence_observer_context_js_1 = require("./timeline-sequence-observer-context.js");
12
13
  const use_hover_state_js_1 = require("./use-hover-state.js");
13
14
  const use_playback_js_1 = require("./use-playback.js");
@@ -28,6 +29,7 @@ exports.PlayerInternals = {
28
29
  updateAllElementsSizes: use_element_size_js_1.updateAllElementsSizes,
29
30
  PlayerEmitterProvider: EmitterProvider_js_1.PlayerEmitterProvider,
30
31
  BufferingIndicator: BufferingIndicator_js_1.BufferingIndicator,
32
+ PlayerControls: PlayerControls_js_1.Controls,
31
33
  TimelineSequenceObserverContext: timeline_sequence_observer_context_js_1.TimelineSequenceObserverContext,
32
34
  CanvasOverlayContext: canvas_overlay_context_js_1.CanvasOverlayContext,
33
35
  CanvasContentContext: canvas_overlay_context_js_1.CanvasContentContext,
@@ -111,8 +111,8 @@ const usePlayback = ({ loop, playbackRate, moveToBeginningWhenEnded, inFrame, ou
111
111
  };
112
112
  }, [fps, getCurrentFrame, logLevel, muted, playbackRate, sharedAudioContext]);
113
113
  (0, react_2.useEffect)(() => {
114
- var _a;
115
- var _b;
114
+ var _a, _b;
115
+ var _c;
116
116
  const wasMuted = previousMutedRef.current;
117
117
  previousMutedRef.current = muted;
118
118
  if (fps === null || durationInFrames === null || compositionId === null) {
@@ -124,6 +124,9 @@ const usePlayback = ({ loop, playbackRate, moveToBeginningWhenEnded, inFrame, ou
124
124
  (_a = sharedAudioContext === null || sharedAudioContext === void 0 ? void 0 : sharedAudioContext.suspend) === null || _a === void 0 ? void 0 : _a.call(sharedAudioContext);
125
125
  return;
126
126
  }
127
+ if (muted) {
128
+ (_b = sharedAudioContext === null || sharedAudioContext === void 0 ? void 0 : sharedAudioContext.suspend) === null || _b === void 0 ? void 0 : _b.call(sharedAudioContext);
129
+ }
127
130
  // Duration and range changes update the endpoint without losing elapsed
128
131
  // sub-frame time. A different composition or timebase needs a fresh clock.
129
132
  const previousClock = playbackClockRef.current;
@@ -170,7 +173,7 @@ const usePlayback = ({ loop, playbackRate, moveToBeginningWhenEnded, inFrame, ou
170
173
  let audioContextFailed = false;
171
174
  let reqAnimFrameCall = null;
172
175
  let playbackFrame = getCurrentFrame();
173
- let lastSeekRevision = (_b = seek === null || seek === void 0 ? void 0 : seek.revision.current) !== null && _b !== void 0 ? _b : null;
176
+ let lastSeekRevision = (_c = seek === null || seek === void 0 ? void 0 : seek.revision.current) !== null && _c !== void 0 ? _c : null;
174
177
  const cancelQueuedFrame = () => {
175
178
  if (reqAnimFrameCall !== null) {
176
179
  if (reqAnimFrameCall.type === 'raf') {
@@ -10,6 +10,8 @@ const usePlayerMethods = () => {
10
10
  const { setPlaying, frameRef, audioAndVideoTags, isPlaying: readIsPlaying, isBuffering, } = (0, react_1.useContext)(remotion_1.Internals.SetTimelineContext);
11
11
  const audioContext = (0, react_1.useContext)(remotion_1.Internals.SharedAudioContext);
12
12
  const audioTagsContext = (0, react_1.useContext)(remotion_1.Internals.SharedAudioTagsContext);
13
+ const { playerMuted, mediaVolume } = (0, react_1.useContext)(remotion_1.Internals.MediaVolumeContext);
14
+ const muted = playerMuted || mediaVolume === 0;
13
15
  const environment = (0, remotion_1.useRemotionEnvironment)();
14
16
  const video = remotion_1.Internals.useVideo();
15
17
  const videoId = (_a = video === null || video === void 0 ? void 0 : video.id) !== null && _a !== void 0 ? _a : null;
@@ -63,17 +65,19 @@ const usePlayerMethods = () => {
63
65
  if (getCurrentFrame() === lastFrameForPlayback) {
64
66
  seek(0);
65
67
  }
66
- if (isAutoPlayAttempt) {
67
- audioContext === null || audioContext === void 0 ? void 0 : audioContext.resumeAsAutoPlay();
68
- }
69
- else {
70
- audioContext === null || audioContext === void 0 ? void 0 : audioContext.resume();
71
- }
72
- /**
73
- * Play silent audio tags to warm them up for autoplay
74
- */
75
- if (audioTagsContext && audioTagsContext.numberOfAudioTags > 0 && e) {
76
- audioTagsContext.playAllAudios();
68
+ if (!muted) {
69
+ if (isAutoPlayAttempt) {
70
+ audioContext === null || audioContext === void 0 ? void 0 : audioContext.resumeAsAutoPlay();
71
+ }
72
+ else {
73
+ audioContext === null || audioContext === void 0 ? void 0 : audioContext.resume();
74
+ }
75
+ /**
76
+ * Play silent audio tags to warm them up for autoplay
77
+ */
78
+ if (audioTagsContext && audioTagsContext.numberOfAudioTags > 0 && e) {
79
+ audioTagsContext.playAllAudios();
80
+ }
77
81
  }
78
82
  /**
79
83
  * Play audios and videos directly here so they can benefit from
@@ -90,6 +94,7 @@ const usePlayerMethods = () => {
90
94
  config === null || config === void 0 ? void 0 : config.durationInFrames,
91
95
  emitter,
92
96
  getCurrentFrame,
97
+ muted,
93
98
  readIsPlaying,
94
99
  seek,
95
100
  setPlaying,