@remotion/player 3.1.7 → 3.1.11
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/PlayerUI.js +26 -0
- package/dist/error-boundary.d.ts +1 -1
- package/dist/event-emitter.d.ts +5 -0
- package/dist/event-emitter.js +4 -0
- package/dist/utils/browser-supports-fullscreen.d.ts +11 -0
- package/dist/utils/browser-supports-fullscreen.js +5 -0
- package/dist/utils/use-element-size.d.ts +4 -0
- package/dist/utils/use-element-size.js +8 -0
- package/package.json +3 -3
package/dist/PlayerUI.js
CHANGED
|
@@ -119,6 +119,32 @@ const PlayerUI = ({ controls, style, loop, autoPlay, allowFullscreen, inputProps
|
|
|
119
119
|
document.exitFullscreen();
|
|
120
120
|
}
|
|
121
121
|
}, []);
|
|
122
|
+
(0, react_1.useEffect)(() => {
|
|
123
|
+
const { current } = container;
|
|
124
|
+
if (!current) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const fullscreenChange = () => {
|
|
128
|
+
var _a;
|
|
129
|
+
const element = (_a = document.webkitFullscreenElement) !== null && _a !== void 0 ? _a : document.fullscreenElement;
|
|
130
|
+
if (element && element === container.current) {
|
|
131
|
+
player.emitter.dispatchFullscreenChangeUpdate({
|
|
132
|
+
isFullscreen: true,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
player.emitter.dispatchFullscreenChangeUpdate({
|
|
137
|
+
isFullscreen: false,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
current.addEventListener('webkitfullscreenchange', fullscreenChange);
|
|
142
|
+
current.addEventListener('fullscreenchange', fullscreenChange);
|
|
143
|
+
return () => {
|
|
144
|
+
current.removeEventListener('webkitfullscreenchange', fullscreenChange);
|
|
145
|
+
current.removeEventListener('fullscreenchange', fullscreenChange);
|
|
146
|
+
};
|
|
147
|
+
}, [player.emitter]);
|
|
122
148
|
const durationInFrames = (_a = config === null || config === void 0 ? void 0 : config.durationInFrames) !== null && _a !== void 0 ? _a : 1;
|
|
123
149
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
124
150
|
const methods = {
|
package/dist/error-boundary.d.ts
CHANGED
|
@@ -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 | boolean |
|
|
18
|
+
render(): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
|
|
19
19
|
}
|
package/dist/event-emitter.d.ts
CHANGED
|
@@ -10,6 +10,9 @@ declare type TimeUpdateEventPayload = {
|
|
|
10
10
|
declare type RateChangeEventPayload = {
|
|
11
11
|
playbackRate: number;
|
|
12
12
|
};
|
|
13
|
+
declare type FullscreenChangeEventPayload = {
|
|
14
|
+
isFullscreen: boolean;
|
|
15
|
+
};
|
|
13
16
|
declare type StateEventMap = {
|
|
14
17
|
seeked: SeekPayload;
|
|
15
18
|
pause: undefined;
|
|
@@ -18,6 +21,7 @@ declare type StateEventMap = {
|
|
|
18
21
|
ended: undefined;
|
|
19
22
|
error: ErrorPayload;
|
|
20
23
|
timeupdate: TimeUpdateEventPayload;
|
|
24
|
+
fullscreenchange: FullscreenChangeEventPayload;
|
|
21
25
|
};
|
|
22
26
|
export declare type EventTypes = keyof StateEventMap;
|
|
23
27
|
export declare type CallbackListener<T extends EventTypes> = (data: {
|
|
@@ -38,5 +42,6 @@ export declare class PlayerEmitter {
|
|
|
38
42
|
dispatchRatechange(playbackRate: number): void;
|
|
39
43
|
dispatchError(error: Error): void;
|
|
40
44
|
dispatchTimeUpdate(event: TimeUpdateEventPayload): void;
|
|
45
|
+
dispatchFullscreenChangeUpdate(event: FullscreenChangeEventPayload): void;
|
|
41
46
|
}
|
|
42
47
|
export {};
|
package/dist/event-emitter.js
CHANGED
|
@@ -11,6 +11,7 @@ class PlayerEmitter {
|
|
|
11
11
|
ratechange: [],
|
|
12
12
|
seeked: [],
|
|
13
13
|
timeupdate: [],
|
|
14
|
+
fullscreenchange: [],
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
17
|
addEventListener(name, callback) {
|
|
@@ -51,5 +52,8 @@ class PlayerEmitter {
|
|
|
51
52
|
dispatchTimeUpdate(event) {
|
|
52
53
|
this.dispatchEvent('timeupdate', event);
|
|
53
54
|
}
|
|
55
|
+
dispatchFullscreenChangeUpdate(event) {
|
|
56
|
+
this.dispatchEvent('fullscreenchange', event);
|
|
57
|
+
}
|
|
54
58
|
}
|
|
55
59
|
exports.PlayerEmitter = PlayerEmitter;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface Document {
|
|
3
|
+
webkitFullscreenEnabled?: boolean;
|
|
4
|
+
webkitFullscreenElement?: Element;
|
|
5
|
+
webkitExitFullscreen?: Document['exitFullscreen'];
|
|
6
|
+
}
|
|
7
|
+
interface HTMLDivElement {
|
|
8
|
+
webkitRequestFullScreen: HTMLDivElement['requestFullscreen'];
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export declare const browserSupportsFullscreen: boolean | undefined;
|
|
@@ -3,6 +3,10 @@ export declare type Size = {
|
|
|
3
3
|
height: number;
|
|
4
4
|
left: number;
|
|
5
5
|
top: number;
|
|
6
|
+
windowSize: {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
};
|
|
6
10
|
};
|
|
7
11
|
export declare const updateAllElementsSizes: () => void;
|
|
8
12
|
export declare const useElementSize: (ref: React.RefObject<HTMLElement>, options: {
|
|
@@ -36,6 +36,10 @@ const useElementSize = (ref, options) => {
|
|
|
36
36
|
height,
|
|
37
37
|
left: newSize[0].x,
|
|
38
38
|
top: newSize[0].y,
|
|
39
|
+
windowSize: {
|
|
40
|
+
height: window.innerHeight,
|
|
41
|
+
width: window.innerWidth,
|
|
42
|
+
},
|
|
39
43
|
});
|
|
40
44
|
});
|
|
41
45
|
}, [options.shouldApplyCssTransforms]);
|
|
@@ -53,6 +57,10 @@ const useElementSize = (ref, options) => {
|
|
|
53
57
|
height: rect[0].height,
|
|
54
58
|
left: rect[0].x,
|
|
55
59
|
top: rect[0].y,
|
|
60
|
+
windowSize: {
|
|
61
|
+
height: window.innerHeight,
|
|
62
|
+
width: window.innerWidth,
|
|
63
|
+
},
|
|
56
64
|
});
|
|
57
65
|
}, [ref]);
|
|
58
66
|
(0, react_1.useEffect)(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/player",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.11",
|
|
4
4
|
"description": "Remotion Player",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
],
|
|
29
29
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"remotion": "3.1.
|
|
31
|
+
"remotion": "3.1.11"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"react": ">=16.8.0",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "bc4184c9faf944a3bac2fd56bdf990cc74e3ec94"
|
|
67
67
|
}
|