@remotion/player 4.0.179 → 4.0.180
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.
- package/dist/cjs/Player.d.ts +3 -2
- package/dist/cjs/PlayerControls.d.ts +0 -10
- package/dist/cjs/PlayerControls.js +3 -1
- package/dist/cjs/PlayerUI.js +13 -2
- package/dist/cjs/Thumbnail.d.ts +12 -12
- package/dist/cjs/index.d.ts +3 -2
- package/package.json +2 -2
package/dist/cjs/Player.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { PropsIfHasProps } from './utils/props-if-has-props.js';
|
|
|
9
9
|
export type ErrorFallback = (info: {
|
|
10
10
|
error: Error;
|
|
11
11
|
}) => React.ReactNode;
|
|
12
|
-
export type PlayerProps<Schema extends AnyZodObject, Props
|
|
12
|
+
export type PlayerProps<Schema extends AnyZodObject, Props extends Record<string, unknown>> = {
|
|
13
13
|
readonly durationInFrames: number;
|
|
14
14
|
readonly compositionWidth: number;
|
|
15
15
|
readonly compositionHeight: number;
|
|
@@ -49,6 +49,7 @@ export type PlayerProps<Schema extends AnyZodObject, Props> = {
|
|
|
49
49
|
readonly hideControlsWhenPointerDoesntMove?: boolean | number;
|
|
50
50
|
readonly overflowVisible?: boolean;
|
|
51
51
|
} & CompProps<Props> & PropsIfHasProps<Schema, Props>;
|
|
52
|
+
export type PlayerPropsWithoutZod<Props extends Record<string, unknown>> = PlayerProps<AnyZodObject, Props>;
|
|
52
53
|
export declare const componentOrNullIfLazy: <Props>(props: CompProps<Props>) => ComponentType<Props> | null;
|
|
53
54
|
/**
|
|
54
55
|
* @description Creates and renders a customizable video player with various interactive controls for a React application.
|
|
@@ -57,4 +58,4 @@ export declare const componentOrNullIfLazy: <Props>(props: CompProps<Props>) =>
|
|
|
57
58
|
* @param {MutableRefObject<PlayerRef>} ref Reference to the player for controlling playback, volume, and other aspects.
|
|
58
59
|
* @returns {JSX.Element} The rendered video player component.
|
|
59
60
|
*/
|
|
60
|
-
export declare const Player: <Schema extends AnyZodObject, Props
|
|
61
|
+
export declare const Player: <Schema extends AnyZodObject, Props extends Record<string, unknown>>(props: PlayerProps<Schema, Props> & React.RefAttributes<PlayerRef>) => React.ReactElement | null;
|
|
@@ -9,16 +9,6 @@ export type RenderPlayPauseButton = (props: {
|
|
|
9
9
|
export type RenderFullscreenButton = (props: {
|
|
10
10
|
isFullscreen: boolean;
|
|
11
11
|
}) => ReactNode;
|
|
12
|
-
declare global {
|
|
13
|
-
interface Document {
|
|
14
|
-
webkitFullscreenEnabled?: boolean;
|
|
15
|
-
webkitFullscreenElement?: Element;
|
|
16
|
-
webkitExitFullscreen?: Document['exitFullscreen'];
|
|
17
|
-
}
|
|
18
|
-
interface HTMLDivElement {
|
|
19
|
-
webkitRequestFullScreen: HTMLDivElement['requestFullscreen'];
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
12
|
export declare const Controls: React.FC<{
|
|
23
13
|
readonly fps: number;
|
|
24
14
|
readonly durationInFrames: number;
|
|
@@ -117,7 +117,9 @@ const Controls = ({ durationInFrames, isFullscreen, fps, player, showVolumeContr
|
|
|
117
117
|
var _a;
|
|
118
118
|
// Must be handled client-side to avoid SSR hydration mismatch
|
|
119
119
|
setSupportsFullscreen((_a = (typeof document !== 'undefined' &&
|
|
120
|
-
(document.fullscreenEnabled ||
|
|
120
|
+
(document.fullscreenEnabled ||
|
|
121
|
+
// @ts-expect-error Types not defined
|
|
122
|
+
document.webkitFullscreenEnabled))) !== null && _a !== void 0 ? _a : false);
|
|
121
123
|
}, []);
|
|
122
124
|
(0, react_1.useEffect)(() => {
|
|
123
125
|
if (shouldShowInitially === false) {
|
package/dist/cjs/PlayerUI.js
CHANGED
|
@@ -57,7 +57,9 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
|
|
|
57
57
|
if (typeof document === 'undefined') {
|
|
58
58
|
return false;
|
|
59
59
|
}
|
|
60
|
-
return Boolean(document.fullscreenEnabled ||
|
|
60
|
+
return Boolean(document.fullscreenEnabled ||
|
|
61
|
+
// @ts-expect-error Types not defined
|
|
62
|
+
document.webkitFullscreenEnabled);
|
|
61
63
|
}, []);
|
|
62
64
|
const player = (0, use_player_js_1.usePlayer)();
|
|
63
65
|
(0, use_playback_js_1.usePlayback)({
|
|
@@ -81,6 +83,7 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
|
|
|
81
83
|
}
|
|
82
84
|
const onFullscreenChange = () => {
|
|
83
85
|
setIsFullscreen(document.fullscreenElement === current ||
|
|
86
|
+
// @ts-expect-error Types not defined
|
|
84
87
|
document.webkitFullscreenElement === current);
|
|
85
88
|
};
|
|
86
89
|
document.addEventListener('fullscreenchange', onFullscreenChange);
|
|
@@ -108,7 +111,9 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
|
|
|
108
111
|
if (!container.current) {
|
|
109
112
|
throw new Error('No player ref found');
|
|
110
113
|
}
|
|
114
|
+
// @ts-expect-error Types not defined
|
|
111
115
|
if (container.current.webkitRequestFullScreen) {
|
|
116
|
+
// @ts-expect-error Types not defined
|
|
112
117
|
container.current.webkitRequestFullScreen();
|
|
113
118
|
}
|
|
114
119
|
else {
|
|
@@ -116,7 +121,9 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
|
|
|
116
121
|
}
|
|
117
122
|
}, [allowFullscreen, supportsFullScreen]);
|
|
118
123
|
const exitFullscreen = (0, react_1.useCallback)(() => {
|
|
124
|
+
// @ts-expect-error Types not defined
|
|
119
125
|
if (document.webkitExitFullscreen) {
|
|
126
|
+
// @ts-expect-error Types not defined
|
|
120
127
|
document.webkitExitFullscreen();
|
|
121
128
|
}
|
|
122
129
|
else {
|
|
@@ -130,7 +137,11 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
|
|
|
130
137
|
}
|
|
131
138
|
const fullscreenChange = () => {
|
|
132
139
|
var _a;
|
|
133
|
-
const element =
|
|
140
|
+
const element =
|
|
141
|
+
// @ts-expect-error Types not defined
|
|
142
|
+
(_a = document.webkitFullscreenElement) !== null && _a !== void 0 ? _a :
|
|
143
|
+
// defined
|
|
144
|
+
document.fullscreenElement;
|
|
134
145
|
if (element && element === container.current) {
|
|
135
146
|
player.emitter.dispatchFullscreenChange({
|
|
136
147
|
isFullscreen: true,
|
package/dist/cjs/Thumbnail.d.ts
CHANGED
|
@@ -4,21 +4,21 @@ import type { AnyZodObject } from 'zod';
|
|
|
4
4
|
import type { ThumbnailMethods } from './player-methods.js';
|
|
5
5
|
import type { ErrorFallback, RenderLoading } from './PlayerUI.js';
|
|
6
6
|
import type { PropsIfHasProps } from './utils/props-if-has-props.js';
|
|
7
|
-
type ThumbnailProps<Schema extends AnyZodObject, Props extends Record<string, unknown>> = PropsIfHasProps<Schema, Props> & CompProps<Props> & {
|
|
8
|
-
frameToDisplay: number;
|
|
9
|
-
style?: CSSProperties;
|
|
10
|
-
durationInFrames: number;
|
|
11
|
-
compositionWidth: number;
|
|
12
|
-
compositionHeight: number;
|
|
13
|
-
fps: number;
|
|
14
|
-
overflowVisible?: boolean;
|
|
15
|
-
errorFallback?: ErrorFallback;
|
|
16
|
-
renderLoading?: RenderLoading;
|
|
17
|
-
className?: string;
|
|
7
|
+
export type ThumbnailProps<Schema extends AnyZodObject, Props extends Record<string, unknown>> = PropsIfHasProps<Schema, Props> & CompProps<Props> & {
|
|
8
|
+
readonly frameToDisplay: number;
|
|
9
|
+
readonly style?: CSSProperties;
|
|
10
|
+
readonly durationInFrames: number;
|
|
11
|
+
readonly compositionWidth: number;
|
|
12
|
+
readonly compositionHeight: number;
|
|
13
|
+
readonly fps: number;
|
|
14
|
+
readonly overflowVisible?: boolean;
|
|
15
|
+
readonly errorFallback?: ErrorFallback;
|
|
16
|
+
readonly renderLoading?: RenderLoading;
|
|
17
|
+
readonly className?: string;
|
|
18
18
|
};
|
|
19
|
+
export type ThumbnailPropsWithoutZod<Props extends Record<string, unknown>> = ThumbnailProps<AnyZodObject, Props>;
|
|
19
20
|
/**
|
|
20
21
|
* @description A component which can be rendered in a regular React App (for example: Next.js, Vite) to display a single frame of a video.
|
|
21
22
|
* @see [Documentation](https://www.remotion.dev/docs/player/thumbnail)
|
|
22
23
|
*/
|
|
23
24
|
export declare const Thumbnail: <Schema extends AnyZodObject, Props extends Record<string, unknown>>(props: ThumbnailProps<Schema, Props> & import("react").RefAttributes<ThumbnailMethods>) => React.ReactElement | null;
|
|
24
|
-
export {};
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -3,10 +3,11 @@ import type { CallbackListener, PlayerEventTypes } from './event-emitter.js';
|
|
|
3
3
|
import { PlayerEmitter } from './event-emitter.js';
|
|
4
4
|
export type { PlayerMethods, PlayerRef, ThumbnailMethods, ThumbnailRef, } from './player-methods.js';
|
|
5
5
|
export { Player } from './Player.js';
|
|
6
|
-
export type { PlayerProps } from './Player.js';
|
|
6
|
+
export type { PlayerProps, PlayerPropsWithoutZod } from './Player.js';
|
|
7
7
|
export type { RenderFullscreenButton, RenderPlayPauseButton, } from './PlayerControls.js';
|
|
8
8
|
export type { ErrorFallback, RenderLoading, RenderPoster } from './PlayerUI.js';
|
|
9
9
|
export { Thumbnail } from './Thumbnail.js';
|
|
10
|
+
export type { ThumbnailProps, ThumbnailPropsWithoutZod } from './Thumbnail.js';
|
|
10
11
|
export type { Size } from './utils/use-element-size.js';
|
|
11
12
|
export type { CallbackListener, PlayerEventTypes as EventTypes };
|
|
12
13
|
export declare const PlayerInternals: {
|
|
@@ -19,7 +20,7 @@ export declare const PlayerInternals: {
|
|
|
19
20
|
isFirstFrame: boolean;
|
|
20
21
|
emitter: PlayerEmitter;
|
|
21
22
|
playing: boolean;
|
|
22
|
-
play: (e?: import("react").SyntheticEvent<Element, Event> |
|
|
23
|
+
play: (e?: PointerEvent | import("react").SyntheticEvent<Element, Event> | undefined) => void;
|
|
23
24
|
pause: () => void;
|
|
24
25
|
pauseAndReturnToPlayStart: () => void;
|
|
25
26
|
seek: (newFrame: number) => void;
|
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.
|
|
6
|
+
"version": "4.0.180",
|
|
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.
|
|
31
|
+
"remotion": "4.0.180"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"react": ">=16.8.0",
|