@remotion/player 4.0.0-alpha13 → 4.0.0-alpha14
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 +2 -2
- package/dist/cjs/PlayerControls.d.ts +2 -2
- package/dist/cjs/PlayerUI.d.ts +3 -3
- package/dist/cjs/Thumbnail.d.ts +1 -1
- package/dist/cjs/calculate-scale.d.ts +1 -1
- package/dist/cjs/event-emitter.d.ts +16 -16
- package/dist/cjs/player-methods.d.ts +4 -4
- package/dist/cjs/use-player.d.ts +1 -1
- package/dist/cjs/use-thumbnail.d.ts +1 -1
- package/dist/cjs/use-video-controls-resize.d.ts +1 -1
- package/dist/cjs/utils/cancellable-promise.d.ts +1 -1
- package/dist/cjs/utils/preview-size.d.ts +2 -2
- package/dist/cjs/utils/props-if-has-props.d.ts +1 -1
- package/dist/cjs/utils/use-element-size.d.ts +1 -1
- package/dist/esm/Player.d.ts +2 -2
- package/dist/esm/PlayerControls.d.ts +2 -2
- package/dist/esm/PlayerUI.d.ts +3 -3
- package/dist/esm/Thumbnail.d.ts +1 -1
- package/dist/esm/calculate-scale.d.ts +1 -1
- package/dist/esm/event-emitter.d.ts +16 -16
- package/dist/esm/player-methods.d.ts +4 -4
- package/dist/esm/use-player.d.ts +1 -1
- package/dist/esm/use-thumbnail.d.ts +1 -1
- package/dist/esm/use-video-controls-resize.d.ts +1 -1
- package/dist/esm/utils/cancellable-promise.d.ts +1 -1
- package/dist/esm/utils/preview-size.d.ts +2 -2
- package/dist/esm/utils/props-if-has-props.d.ts +1 -1
- package/dist/esm/utils/use-element-size.d.ts +1 -1
- package/dist/tsconfig-esm.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
package/dist/cjs/Player.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ import type { PlayerRef } from './player-methods.js';
|
|
|
6
6
|
import type { RenderFullscreenButton, RenderPlayPauseButton } from './PlayerControls.js';
|
|
7
7
|
import type { RenderLoading, RenderPoster } from './PlayerUI.js';
|
|
8
8
|
import type { PropsIfHasProps } from './utils/props-if-has-props.js';
|
|
9
|
-
export
|
|
9
|
+
export type ErrorFallback = (info: {
|
|
10
10
|
error: Error;
|
|
11
11
|
}) => React.ReactNode;
|
|
12
|
-
export
|
|
12
|
+
export type PlayerProps<Schema extends AnyZodObject, Props> = {
|
|
13
13
|
durationInFrames: number;
|
|
14
14
|
compositionWidth: number;
|
|
15
15
|
compositionHeight: number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { MouseEventHandler, ReactNode } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { usePlayer } from './use-player.js';
|
|
4
|
-
export
|
|
4
|
+
export type RenderPlayPauseButton = (props: {
|
|
5
5
|
playing: boolean;
|
|
6
6
|
}) => ReactNode;
|
|
7
|
-
export
|
|
7
|
+
export type RenderFullscreenButton = (props: {
|
|
8
8
|
isFullscreen: boolean;
|
|
9
9
|
}) => ReactNode;
|
|
10
10
|
declare global {
|
package/dist/cjs/PlayerUI.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PlayerRef } from './player-methods.js';
|
|
3
3
|
import type { RenderFullscreenButton, RenderPlayPauseButton } from './PlayerControls.js';
|
|
4
|
-
export
|
|
4
|
+
export type ErrorFallback = (info: {
|
|
5
5
|
error: Error;
|
|
6
6
|
}) => React.ReactNode;
|
|
7
|
-
export
|
|
7
|
+
export type RenderLoading = (canvas: {
|
|
8
8
|
height: number;
|
|
9
9
|
width: number;
|
|
10
10
|
}) => React.ReactNode;
|
|
11
|
-
export
|
|
11
|
+
export type RenderPoster = RenderLoading;
|
|
12
12
|
declare const _default: React.ForwardRefExoticComponent<{
|
|
13
13
|
controls: boolean;
|
|
14
14
|
loop: boolean;
|
package/dist/cjs/Thumbnail.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ 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
|
-
|
|
7
|
+
type ThumbnailProps<Schema extends AnyZodObject, Props> = PropsIfHasProps<Schema, Props> & CompProps<Schema> & {
|
|
8
8
|
frameToDisplay: number;
|
|
9
9
|
style?: CSSProperties;
|
|
10
10
|
durationInFrames: number;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
type SeekPayload = {
|
|
2
2
|
frame: number;
|
|
3
3
|
};
|
|
4
|
-
|
|
4
|
+
type ErrorPayload = {
|
|
5
5
|
error: Error;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type TimeUpdateEventPayload = {
|
|
8
8
|
frame: number;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
type FrameUpdateEventPayload = {
|
|
11
11
|
frame: number;
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
type RateChangeEventPayload = {
|
|
14
14
|
playbackRate: number;
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
type ScaleChangeEventPayload = {
|
|
17
17
|
scale: number;
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
type VolumeChangeEventPayload = {
|
|
20
20
|
volume: number;
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
type FullscreenChangeEventPayload = {
|
|
23
23
|
isFullscreen: boolean;
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
type MuteChangeEventPayload = {
|
|
26
26
|
isMuted: boolean;
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
type PlayerStateEventMap = {
|
|
29
29
|
seeked: SeekPayload;
|
|
30
30
|
pause: undefined;
|
|
31
31
|
play: undefined;
|
|
@@ -39,18 +39,18 @@ declare type PlayerStateEventMap = {
|
|
|
39
39
|
fullscreenchange: FullscreenChangeEventPayload;
|
|
40
40
|
mutechange: MuteChangeEventPayload;
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
type ThumbnailStateEventMap = {
|
|
43
43
|
error: ErrorPayload;
|
|
44
44
|
};
|
|
45
|
-
export
|
|
46
|
-
export
|
|
47
|
-
export
|
|
45
|
+
export type PlayerEventTypes = keyof PlayerStateEventMap;
|
|
46
|
+
export type ThumbnailEventTypes = keyof ThumbnailStateEventMap;
|
|
47
|
+
export type CallbackListener<T extends PlayerEventTypes> = (data: {
|
|
48
48
|
detail: PlayerStateEventMap[T];
|
|
49
49
|
}) => void;
|
|
50
|
-
|
|
50
|
+
type PlayerListeners = {
|
|
51
51
|
[EventType in PlayerEventTypes]: CallbackListener<EventType>[];
|
|
52
52
|
};
|
|
53
|
-
|
|
53
|
+
type ThumbnailListeners = {
|
|
54
54
|
[EventType in ThumbnailEventTypes]: CallbackListener<EventType>[];
|
|
55
55
|
};
|
|
56
56
|
export declare class PlayerEmitter {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { SyntheticEvent } from 'react';
|
|
2
2
|
import type { PlayerEmitter } from './event-emitter.js';
|
|
3
|
-
export
|
|
3
|
+
export type ThumbnailMethods = {
|
|
4
4
|
getContainerNode: () => HTMLDivElement | null;
|
|
5
5
|
getScale: () => number;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type PlayerMethods = ThumbnailMethods & {
|
|
8
8
|
play: (e?: SyntheticEvent) => void;
|
|
9
9
|
pause: () => void;
|
|
10
10
|
toggle: (e?: SyntheticEvent) => void;
|
|
@@ -20,5 +20,5 @@ export declare type PlayerMethods = ThumbnailMethods & {
|
|
|
20
20
|
mute: () => void;
|
|
21
21
|
unmute: () => void;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
24
|
-
export
|
|
23
|
+
export type ThumbnailRef = PlayerEmitter & ThumbnailMethods;
|
|
24
|
+
export type PlayerRef = PlayerEmitter & PlayerMethods;
|
package/dist/cjs/use-player.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SyntheticEvent } from 'react';
|
|
2
2
|
import type { PlayerEmitter } from './event-emitter.js';
|
|
3
|
-
|
|
3
|
+
type UsePlayerMethods = {
|
|
4
4
|
frameBack: (frames: number) => void;
|
|
5
5
|
frameForward: (frames: number) => void;
|
|
6
6
|
isLastFrame: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AnyZodObject, z } from 'zod';
|
|
2
|
-
export
|
|
2
|
+
export type PropsIfHasProps<Schema extends AnyZodObject, Props> = AnyZodObject extends Schema ? {} extends Props ? {
|
|
3
3
|
inputProps?: z.infer<Schema> & Props;
|
|
4
4
|
} : {
|
|
5
5
|
inputProps: Props;
|
package/dist/esm/Player.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ import type { PlayerRef } from './player-methods.js';
|
|
|
6
6
|
import type { RenderFullscreenButton, RenderPlayPauseButton } from './PlayerControls.js';
|
|
7
7
|
import type { RenderLoading, RenderPoster } from './PlayerUI.js';
|
|
8
8
|
import type { PropsIfHasProps } from './utils/props-if-has-props.js';
|
|
9
|
-
export
|
|
9
|
+
export type ErrorFallback = (info: {
|
|
10
10
|
error: Error;
|
|
11
11
|
}) => React.ReactNode;
|
|
12
|
-
export
|
|
12
|
+
export type PlayerProps<Schema extends AnyZodObject, Props> = {
|
|
13
13
|
durationInFrames: number;
|
|
14
14
|
compositionWidth: number;
|
|
15
15
|
compositionHeight: number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { MouseEventHandler, ReactNode } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { usePlayer } from './use-player.js';
|
|
4
|
-
export
|
|
4
|
+
export type RenderPlayPauseButton = (props: {
|
|
5
5
|
playing: boolean;
|
|
6
6
|
}) => ReactNode;
|
|
7
|
-
export
|
|
7
|
+
export type RenderFullscreenButton = (props: {
|
|
8
8
|
isFullscreen: boolean;
|
|
9
9
|
}) => ReactNode;
|
|
10
10
|
declare global {
|
package/dist/esm/PlayerUI.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PlayerRef } from './player-methods.js';
|
|
3
3
|
import type { RenderFullscreenButton, RenderPlayPauseButton } from './PlayerControls.js';
|
|
4
|
-
export
|
|
4
|
+
export type ErrorFallback = (info: {
|
|
5
5
|
error: Error;
|
|
6
6
|
}) => React.ReactNode;
|
|
7
|
-
export
|
|
7
|
+
export type RenderLoading = (canvas: {
|
|
8
8
|
height: number;
|
|
9
9
|
width: number;
|
|
10
10
|
}) => React.ReactNode;
|
|
11
|
-
export
|
|
11
|
+
export type RenderPoster = RenderLoading;
|
|
12
12
|
declare const _default: React.ForwardRefExoticComponent<{
|
|
13
13
|
controls: boolean;
|
|
14
14
|
loop: boolean;
|
package/dist/esm/Thumbnail.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ 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
|
-
|
|
7
|
+
type ThumbnailProps<Schema extends AnyZodObject, Props> = PropsIfHasProps<Schema, Props> & CompProps<Schema> & {
|
|
8
8
|
frameToDisplay: number;
|
|
9
9
|
style?: CSSProperties;
|
|
10
10
|
durationInFrames: number;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
type SeekPayload = {
|
|
2
2
|
frame: number;
|
|
3
3
|
};
|
|
4
|
-
|
|
4
|
+
type ErrorPayload = {
|
|
5
5
|
error: Error;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type TimeUpdateEventPayload = {
|
|
8
8
|
frame: number;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
type FrameUpdateEventPayload = {
|
|
11
11
|
frame: number;
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
type RateChangeEventPayload = {
|
|
14
14
|
playbackRate: number;
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
type ScaleChangeEventPayload = {
|
|
17
17
|
scale: number;
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
type VolumeChangeEventPayload = {
|
|
20
20
|
volume: number;
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
type FullscreenChangeEventPayload = {
|
|
23
23
|
isFullscreen: boolean;
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
type MuteChangeEventPayload = {
|
|
26
26
|
isMuted: boolean;
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
type PlayerStateEventMap = {
|
|
29
29
|
seeked: SeekPayload;
|
|
30
30
|
pause: undefined;
|
|
31
31
|
play: undefined;
|
|
@@ -39,18 +39,18 @@ declare type PlayerStateEventMap = {
|
|
|
39
39
|
fullscreenchange: FullscreenChangeEventPayload;
|
|
40
40
|
mutechange: MuteChangeEventPayload;
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
type ThumbnailStateEventMap = {
|
|
43
43
|
error: ErrorPayload;
|
|
44
44
|
};
|
|
45
|
-
export
|
|
46
|
-
export
|
|
47
|
-
export
|
|
45
|
+
export type PlayerEventTypes = keyof PlayerStateEventMap;
|
|
46
|
+
export type ThumbnailEventTypes = keyof ThumbnailStateEventMap;
|
|
47
|
+
export type CallbackListener<T extends PlayerEventTypes> = (data: {
|
|
48
48
|
detail: PlayerStateEventMap[T];
|
|
49
49
|
}) => void;
|
|
50
|
-
|
|
50
|
+
type PlayerListeners = {
|
|
51
51
|
[EventType in PlayerEventTypes]: CallbackListener<EventType>[];
|
|
52
52
|
};
|
|
53
|
-
|
|
53
|
+
type ThumbnailListeners = {
|
|
54
54
|
[EventType in ThumbnailEventTypes]: CallbackListener<EventType>[];
|
|
55
55
|
};
|
|
56
56
|
export declare class PlayerEmitter {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { SyntheticEvent } from 'react';
|
|
2
2
|
import type { PlayerEmitter } from './event-emitter.js';
|
|
3
|
-
export
|
|
3
|
+
export type ThumbnailMethods = {
|
|
4
4
|
getContainerNode: () => HTMLDivElement | null;
|
|
5
5
|
getScale: () => number;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type PlayerMethods = ThumbnailMethods & {
|
|
8
8
|
play: (e?: SyntheticEvent) => void;
|
|
9
9
|
pause: () => void;
|
|
10
10
|
toggle: (e?: SyntheticEvent) => void;
|
|
@@ -20,5 +20,5 @@ export declare type PlayerMethods = ThumbnailMethods & {
|
|
|
20
20
|
mute: () => void;
|
|
21
21
|
unmute: () => void;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
24
|
-
export
|
|
23
|
+
export type ThumbnailRef = PlayerEmitter & ThumbnailMethods;
|
|
24
|
+
export type PlayerRef = PlayerEmitter & PlayerMethods;
|
package/dist/esm/use-player.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SyntheticEvent } from 'react';
|
|
2
2
|
import type { PlayerEmitter } from './event-emitter.js';
|
|
3
|
-
|
|
3
|
+
type UsePlayerMethods = {
|
|
4
4
|
frameBack: (frames: number) => void;
|
|
5
5
|
frameForward: (frames: number) => void;
|
|
6
6
|
isLastFrame: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AnyZodObject, z } from 'zod';
|
|
2
|
-
export
|
|
2
|
+
export type PropsIfHasProps<Schema extends AnyZodObject, Props> = AnyZodObject extends Schema ? {} extends Props ? {
|
|
3
3
|
inputProps?: z.infer<Schema> & Props;
|
|
4
4
|
} : {
|
|
5
5
|
inputProps: Props;
|