@remotion/player
Advanced tools
Comparing version 4.0.249 to 4.0.250
@@ -18,3 +18,3 @@ import React from 'react'; | ||
componentDidCatch(error: Error): void; | ||
render(): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined; | ||
render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined; | ||
} |
import type { ComponentType } from 'react'; | ||
import React from 'react'; | ||
import type { CompProps } from 'remotion'; | ||
import type { CompProps, LogLevel } from 'remotion'; | ||
import type { AnyZodObject } from 'zod'; | ||
@@ -58,2 +58,3 @@ import type { RenderMuteButton } from './MediaVolumeSlider.js'; | ||
readonly overrideInternalClassName?: string; | ||
readonly logLevel?: LogLevel; | ||
} & CompProps<Props> & PropsIfHasProps<Schema, Props>; | ||
@@ -60,0 +61,0 @@ export type PlayerPropsWithoutZod<Props extends Record<string, unknown>> = PlayerProps<AnyZodObject, Props>; |
@@ -25,3 +25,3 @@ "use strict"; | ||
exports.componentOrNullIfLazy = componentOrNullIfLazy; | ||
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, 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, ...componentProps }, ref) => { | ||
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, 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', ...componentProps }, ref) => { | ||
if (typeof window !== 'undefined') { | ||
@@ -115,2 +115,5 @@ // eslint-disable-next-line react-hooks/rules-of-hooks | ||
(0, react_1.useImperativeHandle)(ref, () => rootRef.current, []); | ||
(0, react_1.useState)(() => { | ||
remotion_1.Internals.Log.trace(logLevel, `[player] Mounting <Player>. User agent = ${typeof navigator === 'undefined' ? 'server' : navigator.userAgent}`); | ||
}); | ||
const timelineContextValue = (0, react_1.useMemo)(() => { | ||
@@ -148,3 +151,3 @@ return { | ||
}, [passedBrowserMediaControlsBehavior]); | ||
return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.IsPlayerContextProvider, { children: (0, jsx_runtime_1.jsx)(SharedPlayerContext_js_1.SharedPlayerContexts, { timelineContext: timelineContextValue, component: component, compositionHeight: compositionHeight, compositionWidth: compositionWidth, durationInFrames: durationInFrames, fps: fps, numberOfSharedAudioTags: numberOfSharedAudioTags, initiallyMuted: initiallyMuted, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.Timeline.SetTimelineContext.Provider, { value: setTimelineContextValue, 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' | ||
return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.IsPlayerContextProvider, { children: (0, jsx_runtime_1.jsx)(SharedPlayerContext_js_1.SharedPlayerContexts, { timelineContext: timelineContextValue, component: component, compositionHeight: compositionHeight, compositionWidth: compositionWidth, durationInFrames: durationInFrames, fps: fps, numberOfSharedAudioTags: numberOfSharedAudioTags, initiallyMuted: initiallyMuted, logLevel: logLevel, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.Timeline.SetTimelineContext.Provider, { value: setTimelineContextValue, 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' | ||
? clickToPlay | ||
@@ -151,0 +154,0 @@ : 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), 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, 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 }) }) }) }) })); |
import type { ComponentType, LazyExoticComponent } from 'react'; | ||
import React from 'react'; | ||
import type { TimelineContextValue } from 'remotion'; | ||
import type { LogLevel, TimelineContextValue } from 'remotion'; | ||
export declare const PLAYER_COMP_ID = "player-comp"; | ||
@@ -15,2 +15,3 @@ export declare const SharedPlayerContexts: React.FC<{ | ||
readonly initiallyMuted: boolean; | ||
readonly logLevel: LogLevel; | ||
}>; |
@@ -9,3 +9,3 @@ "use strict"; | ||
exports.PLAYER_COMP_ID = 'player-comp'; | ||
const SharedPlayerContexts = ({ children, timelineContext, fps, compositionHeight, compositionWidth, durationInFrames, component, numberOfSharedAudioTags, initiallyMuted, }) => { | ||
const SharedPlayerContexts = ({ children, timelineContext, fps, compositionHeight, compositionWidth, durationInFrames, component, numberOfSharedAudioTags, initiallyMuted, logLevel, }) => { | ||
const compositionManagerContext = (0, react_1.useMemo)(() => { | ||
@@ -51,4 +51,4 @@ const context = { | ||
setMediaVolume(vol); | ||
(0, volume_persistance_js_1.persistVolume)(vol); | ||
}, []); | ||
(0, volume_persistance_js_1.persistVolume)(vol, logLevel); | ||
}, [logLevel]); | ||
const setMediaVolumeContextValue = (0, react_1.useMemo)(() => { | ||
@@ -60,4 +60,4 @@ return { | ||
}, [setMediaVolumeAndPersist]); | ||
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 }) }) }) }) }) }) }) }) }) })); | ||
return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.LogLevelContext.Provider, { value: logLevel, 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, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.BufferingProvider, { children: children }) }) }) }) }) }) }) }) }) }) })); | ||
}; | ||
exports.SharedPlayerContexts = SharedPlayerContexts; |
import type { CSSProperties } from 'react'; | ||
import type { CompProps } from 'remotion'; | ||
import type { CompProps, LogLevel } from 'remotion'; | ||
import type { AnyZodObject } from 'zod'; | ||
@@ -19,4 +19,5 @@ import type { ThumbnailMethods } from './player-methods.js'; | ||
readonly overrideInternalClassName?: string; | ||
readonly logLevel?: LogLevel; | ||
}; | ||
export type ThumbnailPropsWithoutZod<Props extends Record<string, unknown>> = ThumbnailProps<AnyZodObject, Props>; | ||
export declare const Thumbnail: <Schema extends AnyZodObject, Props extends Record<string, unknown>>(props: ThumbnailProps<Schema, Props> & import("react").RefAttributes<ThumbnailMethods>) => React.ReactElement | null; |
@@ -14,3 +14,3 @@ "use strict"; | ||
const ThumbnailUI_js_1 = __importDefault(require("./ThumbnailUI.js")); | ||
const ThumbnailFn = ({ frameToDisplay, style, inputProps, compositionHeight, compositionWidth, durationInFrames, fps, className, errorFallback = () => '⚠️', renderLoading, overflowVisible = false, overrideInternalClassName, ...componentProps }, ref) => { | ||
const ThumbnailFn = ({ frameToDisplay, style, inputProps, compositionHeight, compositionWidth, durationInFrames, fps, className, errorFallback = () => '⚠️', renderLoading, overflowVisible = false, overrideInternalClassName, logLevel = 'info', ...componentProps }, ref) => { | ||
if (typeof window !== 'undefined') { | ||
@@ -48,3 +48,3 @@ // eslint-disable-next-line react-hooks/rules-of-hooks | ||
}, [inputProps]); | ||
return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.IsPlayerContextProvider, { children: (0, jsx_runtime_1.jsx)(SharedPlayerContext_js_1.SharedPlayerContexts, { timelineContext: timelineState, component: Component, compositionHeight: compositionHeight, compositionWidth: compositionWidth, durationInFrames: durationInFrames, fps: fps, numberOfSharedAudioTags: 0, initiallyMuted: true, 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 }) }) }) })); | ||
return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.IsPlayerContextProvider, { children: (0, jsx_runtime_1.jsx)(SharedPlayerContext_js_1.SharedPlayerContexts, { timelineContext: timelineState, component: Component, compositionHeight: compositionHeight, compositionWidth: compositionWidth, durationInFrames: durationInFrames, fps: fps, numberOfSharedAudioTags: 0, initiallyMuted: true, logLevel: logLevel, 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 }) }) }) })); | ||
}; | ||
@@ -51,0 +51,0 @@ const forward = react_1.forwardRef; |
@@ -1,2 +0,3 @@ | ||
export declare const persistVolume: (volume: number) => void; | ||
import { type LogLevel } from 'remotion'; | ||
export declare const persistVolume: (volume: number, logLevel: LogLevel) => void; | ||
export declare const getPreferredVolume: () => number; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getPreferredVolume = exports.persistVolume = void 0; | ||
const remotion_1 = require("remotion"); | ||
const VOLUME_PERSISTANCE_KEY = 'remotion.volumePreference'; | ||
const persistVolume = (volume) => { | ||
const persistVolume = (volume, logLevel) => { | ||
if (typeof window === 'undefined') { | ||
@@ -15,4 +16,3 @@ return; | ||
// https://github.com/remotion-dev/remotion/issues/3540 | ||
// eslint-disable-next-line no-console | ||
console.log('Could not persist volume', e); | ||
remotion_1.Internals.Log.error(logLevel, 'Could not persist volume', e); | ||
} | ||
@@ -19,0 +19,0 @@ }; |
@@ -6,3 +6,3 @@ { | ||
"name": "@remotion/player", | ||
"version": "4.0.249", | ||
"version": "4.0.250", | ||
"description": "React component for embedding a Remotion preview into your app", | ||
@@ -32,3 +32,3 @@ "main": "dist/cjs/index.js", | ||
"dependencies": { | ||
"remotion": "4.0.249" | ||
"remotion": "4.0.250" | ||
}, | ||
@@ -48,3 +48,3 @@ "peerDependencies": { | ||
"eslint": "9.14.0", | ||
"@remotion/eslint-config-internal": "4.0.249" | ||
"@remotion/eslint-config-internal": "4.0.250" | ||
}, | ||
@@ -51,0 +51,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
504962
11095
+ Addedremotion@4.0.250(transitive)
- Removedremotion@4.0.249(transitive)
Updatedremotion@4.0.250