@remotion/player 4.0.364 → 4.0.365

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/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.364",
6
+ "version": "4.0.365",
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",
@@ -35,7 +35,7 @@
35
35
  ],
36
36
  "license": "SEE LICENSE IN LICENSE.md",
37
37
  "dependencies": {
38
- "remotion": "4.0.364"
38
+ "remotion": "4.0.365"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "react": ">=16.8.0",
@@ -49,7 +49,7 @@
49
49
  "react-dom": "19.0.0",
50
50
  "webpack": "5.96.1",
51
51
  "zod": "3.22.3",
52
- "@remotion/eslint-config-internal": "4.0.364",
52
+ "@remotion/eslint-config-internal": "4.0.365",
53
53
  "eslint": "9.19.0"
54
54
  },
55
55
  "keywords": [
package/bundle.ts DELETED
@@ -1,19 +0,0 @@
1
- import {build} from 'bun';
2
-
3
- if (process.env.NODE_ENV !== 'production') {
4
- throw new Error('This script must be run using NODE_ENV=production');
5
- }
6
-
7
- const output = await build({
8
- entrypoints: ['src/index.ts'],
9
- naming: '[name].mjs',
10
- target: 'node',
11
- external: ['remotion', 'remotion/no-react', 'react'],
12
- });
13
-
14
- const [file] = output.outputs;
15
- const text = await file.text();
16
-
17
- await Bun.write('dist/esm/index.mjs', `"use client";\n${text}`);
18
-
19
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const bun_test_1 = require("bun:test");
4
- const use_player_js_1 = require("../use-player.js");
5
- (0, bun_test_1.test)('It should throw an error if not being used inside a RemotionRoot', () => {
6
- (0, bun_test_1.expect)(() => {
7
- (0, use_player_js_1.usePlayer)();
8
- }).toThrow();
9
- });
@@ -1,6 +0,0 @@
1
- import type { queries, RenderOptions } from '@testing-library/react';
2
- import type { FC, ReactElement } from 'react';
3
- declare const HelloWorld: FC;
4
- declare const customRender: (ui: ReactElement, options?: Omit<RenderOptions, "queries">) => import("@testing-library/react").RenderResult<typeof queries, HTMLElement, HTMLElement>;
5
- export * from '@testing-library/react';
6
- export { HelloWorld, customRender as render };
@@ -1,31 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.render = exports.HelloWorld = void 0;
18
- const jsx_runtime_1 = require("react/jsx-runtime");
19
- const react_1 = require("@testing-library/react");
20
- const HelloWorld = () => {
21
- return (0, jsx_runtime_1.jsx)("div", { children: "Hello World" });
22
- };
23
- exports.HelloWorld = HelloWorld;
24
- const AllTheProviders = ({ children }) => {
25
- // overwriting console.error console does not gets poluted with all the errors
26
- window.console.error = () => { };
27
- return (0, jsx_runtime_1.jsx)("div", { children: children });
28
- };
29
- const customRender = (ui, options) => (0, react_1.render)(ui, { wrapper: AllTheProviders, ...options });
30
- exports.render = customRender;
31
- __exportStar(require("@testing-library/react"), exports);
@@ -1 +0,0 @@
1
- export {};
@@ -1,56 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const bun_test_1 = require("bun:test");
4
- const validate_in_out_frame_js_1 = require("../utils/validate-in-out-frame.js");
5
- (0, bun_test_1.test)('Validate in out frames', () => {
6
- (0, bun_test_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
7
- durationInFrames: 200,
8
- inFrame: 201,
9
- outFrame: undefined,
10
- })).toThrow(/inFrame must be less than \(durationInFrames - 1\)/);
11
- (0, bun_test_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
12
- durationInFrames: 200,
13
- inFrame: 199,
14
- outFrame: 201,
15
- })).toThrow(/outFrame must be less than \(durationInFrames - 1\)/);
16
- (0, bun_test_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
17
- durationInFrames: 200,
18
- inFrame: -10,
19
- outFrame: null,
20
- })).toThrow(/inFrame must be greater than 0, but is -10/);
21
- (0, bun_test_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
22
- durationInFrames: 200,
23
- inFrame: null,
24
- outFrame: -10,
25
- })).toThrow(/outFrame must be greater than 0, but is -10/);
26
- (0, bun_test_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
27
- durationInFrames: 200,
28
- inFrame: 1.5,
29
- outFrame: null,
30
- })).toThrow(/"inFrame" must be an integer, but is 1.5/);
31
- (0, bun_test_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
32
- durationInFrames: 200,
33
- inFrame: 20,
34
- outFrame: 20,
35
- })).toThrow(/outFrame must be greater than inFrame, but is 20/);
36
- (0, bun_test_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
37
- durationInFrames: 200,
38
- inFrame: 21,
39
- outFrame: 20,
40
- })).toThrow(/outFrame must be greater than inFrame, but is 20 <= 21/);
41
- (0, bun_test_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
42
- durationInFrames: 200,
43
- inFrame: null,
44
- outFrame: 20,
45
- })).not.toThrow();
46
- (0, bun_test_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
47
- durationInFrames: 200,
48
- inFrame: null,
49
- outFrame: null,
50
- })).not.toThrow();
51
- (0, bun_test_1.expect)(() => (0, validate_in_out_frame_js_1.validateInOutFrames)({
52
- durationInFrames: 200,
53
- inFrame: 10,
54
- outFrame: 20,
55
- })).not.toThrow();
56
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,135 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const bun_test_1 = require("bun:test");
5
- const remotion_1 = require("remotion");
6
- const index_js_1 = require("../index.js");
7
- const test_utils_js_1 = require("./test-utils.js");
8
- (0, bun_test_1.test)('no compositionWidth should give errors', () => {
9
- try {
10
- (0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player
11
- // @ts-expect-error
12
- , {
13
- // @ts-expect-error
14
- compositionWidth: null, errorFallback: () => 'something went wrong', compositionHeight: 400, fps: 30, durationInFrames: 500, component: test_utils_js_1.HelloWorld, controls: true, showVolumeControls: true }));
15
- }
16
- catch (e) {
17
- (0, bun_test_1.expect)(e.message).toMatch(/'compositionWidth' must be a number but got 'object' instead/);
18
- }
19
- });
20
- (0, bun_test_1.test)('no compositionHeight should give errors', () => {
21
- try {
22
- (0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 400, errorFallback: () => 'something went wrong',
23
- // @ts-expect-error
24
- compositionHeight: undefined, fps: 30, durationInFrames: 500, component: test_utils_js_1.HelloWorld, controls: true, showVolumeControls: true }));
25
- }
26
- catch (e) {
27
- (0, bun_test_1.expect)(e.message).toMatch(/'compositionHeight' must be a number but got 'undefined' instead/);
28
- }
29
- });
30
- (0, bun_test_1.test)('No fps should give errors', () => {
31
- try {
32
- (0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, errorFallback: () => 'something went wrong',
33
- // @ts-expect-error
34
- fps: null, durationInFrames: 500, component: test_utils_js_1.HelloWorld, controls: true, showVolumeControls: true }));
35
- }
36
- catch (e) {
37
- (0, bun_test_1.expect)(e.message).toMatch(/"fps" must be a number, but you passed a value of type object/);
38
- }
39
- try {
40
- (0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, errorFallback: () => 'something went wrong',
41
- // @ts-expect-error
42
- fps: undefined, durationInFrames: 500, component: test_utils_js_1.HelloWorld, controls: true, showVolumeControls: true }));
43
- }
44
- catch (e) {
45
- (0, bun_test_1.expect)(e.message).toMatch(/"fps" must be a number, but you passed a value of type undefined/);
46
- }
47
- });
48
- (0, bun_test_1.test)('No durationInFrames should give errors', () => {
49
- try {
50
- (0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, errorFallback: () => 'something went wrong', fps: 30,
51
- // @ts-expect-error
52
- durationInFrames: undefined, component: test_utils_js_1.HelloWorld, controls: true, showVolumeControls: true }));
53
- }
54
- catch (e) {
55
- (0, bun_test_1.expect)(e.message).toMatch(/durationInFrames` must be a number, but is undefined/);
56
- }
57
- });
58
- (0, bun_test_1.test)('Invalid playbackRate should give error', () => {
59
- try {
60
- (0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, fps: 30, durationInFrames: 500, component: test_utils_js_1.HelloWorld, controls: true, showVolumeControls: true, playbackRate: -5, inputProps: {} }));
61
- }
62
- catch (e) {
63
- (0, bun_test_1.expect)(e.message).toMatch(/The lowest possible playback rate is -4. You passed: -5/);
64
- }
65
- });
66
- (0, bun_test_1.test)('playbackRate of 0 should not be possible', () => {
67
- try {
68
- (0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, fps: 30, durationInFrames: 500, component: test_utils_js_1.HelloWorld, controls: true, showVolumeControls: true, playbackRate: 0 }));
69
- }
70
- catch (e) {
71
- (0, bun_test_1.expect)(e.message).toMatch(/A playback rate of 0 is not supported./);
72
- }
73
- });
74
- (0, bun_test_1.test)('playbackRate of wrong type should not be possible', () => {
75
- try {
76
- (0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, fps: 30, durationInFrames: 500, component: test_utils_js_1.HelloWorld, controls: true, showVolumeControls: true,
77
- // @ts-expect-error
78
- playbackRate: 'hi' }));
79
- }
80
- catch (e) {
81
- (0, bun_test_1.expect)(e.message).toMatch(/A playback rate of 0 is not supported./);
82
- }
83
- });
84
- (0, bun_test_1.test)('playbackRate of undefined should be okay', () => {
85
- (0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, fps: 30, durationInFrames: 500, component: test_utils_js_1.HelloWorld, controls: true, showVolumeControls: true }));
86
- (0, bun_test_1.expect)(true).toBe(true);
87
- });
88
- (0, bun_test_1.test)('volumePersistenceKey of string should be okay', () => {
89
- (0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, fps: 30, durationInFrames: 500, component: test_utils_js_1.HelloWorld, controls: true, showVolumeControls: true, volumePersistenceKey: "custom-key" }));
90
- (0, bun_test_1.expect)(true).toBe(true);
91
- });
92
- (0, bun_test_1.test)('passing in <Composition /> instance should not be possible', () => {
93
- (0, bun_test_1.expect)(() => {
94
- (0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, fps: 30, durationInFrames: 500, component: remotion_1.Composition, controls: true, showVolumeControls: true, inputProps: {
95
- id: 'HelloWorld',
96
- width: 500,
97
- height: 400,
98
- fps: 30,
99
- durationInFrames: 500,
100
- component: test_utils_js_1.HelloWorld,
101
- } }));
102
- }).toThrow(/'component' must not be the 'Composition' component\. Pass your own React/);
103
- });
104
- (0, bun_test_1.test)('passing in <Composition /> instance should not be possible', () => {
105
- (0, bun_test_1.expect)(() => {
106
- (0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, fps: 30, durationInFrames: 500,
107
- // @ts-expect-error
108
- component: (0, jsx_runtime_1.jsx)(remotion_1.Composition, { durationInFrames: 30, fps: 30, height: 10, width: 10, id: "hello", component: test_utils_js_1.HelloWorld }), controls: true, showVolumeControls: true, inputProps: {
109
- id: 'HelloWorld',
110
- width: 500,
111
- height: 400,
112
- fps: 30,
113
- durationInFrames: 500,
114
- component: test_utils_js_1.HelloWorld,
115
- } }));
116
- }).toThrow(/'component' should not be an instance of <Composition\/>\. Pass the React component dir/);
117
- });
118
- bun_test_1.test.each([
119
- ['controls'],
120
- ['loop'],
121
- ['autoPlay'],
122
- ['showVolumeControls'],
123
- ['allowFullscreen'],
124
- ['clickToPlay'],
125
- ['doubleClickToFullscreen'],
126
- ])('No durationInFrames should give errors %s', (a) => {
127
- const props = {};
128
- props[a] = 'hey';
129
- try {
130
- (0, test_utils_js_1.render)((0, jsx_runtime_1.jsx)(index_js_1.Player, { compositionWidth: 500, compositionHeight: 400, errorFallback: () => 'something went wrong', fps: 30, durationInFrames: 100, component: test_utils_js_1.HelloWorld, ...props }));
131
- }
132
- catch (e) {
133
- (0, bun_test_1.expect)(e.message).toMatch(`'${a}' must be a boolean or undefined but got 'string' instead`);
134
- }
135
- });
package/eslint.config.mjs DELETED
@@ -1,23 +0,0 @@
1
- import {remotionFlatConfig} from '@remotion/eslint-config-internal';
2
-
3
- const config = remotionFlatConfig({react: true});
4
-
5
- export default {
6
- ...config,
7
- rules: {
8
- ...config.rules,
9
- 'no-console': 'error',
10
- '@typescript-eslint/no-restricted-imports': [
11
- 'error',
12
- {
13
- paths: [
14
- {
15
- name: 'zod',
16
- message: 'Can only import zod as a type',
17
- allowTypeImports: true,
18
- },
19
- ],
20
- },
21
- ],
22
- },
23
- };