@remotion/player 3.0.0-debug.11 → 3.0.0-eslint.6

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/README.md CHANGED
@@ -1,8 +1,86 @@
1
1
  ### Remotion Player
2
2
 
3
- [![NPM Version](http://img.shields.io/npm/v/@remotion/player.svg?style=flat)](https://www.npmjs.org/package/@remotion/player)
3
+ [![NPM Version](https://img.shields.io/npm/v/@remotion/player.svg?style=flat)](https://www.npmjs.org/package/@remotion/player)
4
4
  [![NPM Downloads](https://img.shields.io/npm/dm/@remotion/player.svg?style=flat)](https://npmcharts.com/compare/@remotion/player?minimal=true)
5
5
  [![Install Size](https://packagephobia.now.sh/badge?p=@remotion/player)](https://packagephobia.now.sh/result?p=@remotion/player)
6
6
 
7
- This package allows you to include a Remotion video in your React app.
8
- Full documentation can be found under http://remotion.dev/docs/player.
7
+ The `@remotion/player` package allows you to embed a video powered by Remotion in a React application.
8
+
9
+ ## Installation and prerequisites
10
+
11
+ The dependencies that Remotion requires you to have pre-installed on your machine are Node.js and FFMPEG. You can take a look at this [guide](https://github.com/adaptlearning/adapt_authoring/wiki/Installing-FFmpeg) on how to get FFMPEG on your machine.
12
+
13
+ Install this package and Remotion with the package manager that you use for project:
14
+
15
+ ```bash
16
+ npm i remotion @remotion/player
17
+ ```
18
+
19
+ ```bash
20
+ yarn add remotion @remotion/player
21
+ ```
22
+
23
+ ```bash
24
+ pnpm i remotion @remotion/player
25
+ ```
26
+
27
+ > Make sure all Remotion packages you install (`remotion`, `@remotion/player`, `@remotion/gif`...) [have the same version](https://remotion.dev/docs/version-mismatch).
28
+
29
+ ## Getting started
30
+
31
+ Now that you have this package as a dependency in your React project, it is time to see some of the basic examples that you can spin up with this package.
32
+
33
+ The `@remotion/player` package can be imported as a React component from the library, which you can make use of in your components, either by nesting it in a custom component of yours or simply making it a standalone component.
34
+
35
+ ```javascript
36
+ // components/MyVideo.js
37
+ import React from 'react';
38
+ import {useCurrentFrame} from 'remotion';
39
+
40
+ const MyVideo = () => {
41
+ const frame = useCurrentFrame();
42
+
43
+ return (
44
+ <div
45
+ style={{
46
+ flex: 1,
47
+ textAlign: 'center',
48
+ fontSize: '7em',
49
+ }}
50
+ >
51
+ The current frame is {frame}.
52
+ </div>
53
+ );
54
+ };
55
+ ```
56
+
57
+ ```javascript
58
+ import {Player} from '@remotion/player';
59
+ import {MyVideo} from '../components/MyVideo';
60
+
61
+ export const App = () => {
62
+ return (
63
+ <Player
64
+ component={MyVideo}
65
+ durationInFrames={120}
66
+ compositionWidth={1920}
67
+ compositionHeight={1080}
68
+ fps={30}
69
+ />
70
+ );
71
+ };
72
+ ```
73
+
74
+ ## API
75
+
76
+ The most important props accepted:
77
+
78
+ | Props | Function |
79
+ | ----------------- | ---------------------------------------- |
80
+ | component | A React component that renders the video |
81
+ | durationInFrames | The duration of the video in frames |
82
+ | compositionHeight | The height of the composition in pixels |
83
+ | compositionWidth | The width of the composition in pixels |
84
+ | fps | The frame rate of the video |
85
+
86
+ For a complete reference of the available props, refer to [@remotion/player API](https://www.remotion.dev/docs/player/api).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/player",
3
- "version": "3.0.0-debug.11+551deae5b",
3
+ "version": "3.0.0-eslint.6+4bb89116f",
4
4
  "description": "Remotion Player",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -14,6 +14,9 @@
14
14
  "repository": {
15
15
  "url": "https://github.com/remotion-dev/remotion"
16
16
  },
17
+ "bugs": {
18
+ "url": "https://github.com/remotion-dev/remotion/issues"
19
+ },
17
20
  "files": [
18
21
  "dist",
19
22
  "README.md"
@@ -25,7 +28,7 @@
25
28
  ],
26
29
  "license": "SEE LICENSE IN LICENSE.md",
27
30
  "dependencies": {
28
- "remotion": "3.0.0-debug.11+551deae5b"
31
+ "remotion": "3.0.0-eslint.6+4bb89116f"
29
32
  },
30
33
  "peerDependencies": {
31
34
  "react": ">=16.8.0",
@@ -49,8 +52,16 @@
49
52
  "typescript": "^4.5.5",
50
53
  "webpack": "5.60.0"
51
54
  },
55
+ "keywords": [
56
+ "remotion",
57
+ "ffmpeg",
58
+ "video",
59
+ "react",
60
+ "puppeteer",
61
+ "player"
62
+ ],
52
63
  "publishConfig": {
53
64
  "access": "public"
54
65
  },
55
- "gitHead": "551deae5bf60be2870550eff64b2ca5f3ff03ee7"
66
+ "gitHead": "4bb89116fd71d0e03d92e1442a5e47b85bb3b8ae"
56
67
  }
package/dist/Freeze.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- declare type FreezeProps = {
3
- frame: number;
4
- };
5
- export declare const Freeze: React.FC<FreezeProps>;
6
- export {};
7
- //# sourceMappingURL=Freeze.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Freeze.d.ts","sourceRoot":"","sources":["../src/Freeze.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,aAAK,WAAW,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAcxC,CAAC"}
package/dist/Freeze.js DELETED
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Freeze = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const remotion_1 = require("remotion");
7
- const Freeze = (props) => {
8
- const context = react_1.useContext(remotion_1.Internals.Timeline.TimelineContext);
9
- const value = react_1.useMemo(() => {
10
- return {
11
- ...context,
12
- frame: props.frame,
13
- };
14
- }, [context, props.frame]);
15
- return (jsx_runtime_1.jsx(remotion_1.Internals.Timeline.TimelineContext.Provider, Object.assign({ value: value }, { children: props.children }), void 0));
16
- };
17
- exports.Freeze = Freeze;
18
- //# sourceMappingURL=Freeze.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Freeze.js","sourceRoot":"","sources":["../src/Freeze.tsx"],"names":[],"mappings":";;;;AAAA,iCAAiD;AACjD,uCAAyD;AAMlD,MAAM,MAAM,GAA0B,CAAC,KAAK,EAAE,EAAE;IACtD,MAAM,OAAO,GAAG,kBAAU,CAAC,oBAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;IAC/D,MAAM,KAAK,GAAyB,eAAO,CAAC,GAAG,EAAE;QAChD,OAAO;YACN,GAAG,OAAO;YACV,KAAK,EAAE,KAAK,CAAC,KAAK;SAClB,CAAC;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAE3B,OAAO,CACN,kBAAC,oBAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,QAAQ,kBAAC,KAAK,EAAE,KAAK,gBACvD,KAAK,CAAC,QAAQ,YAC8B,CAC9C,CAAC;AACH,CAAC,CAAC;AAdW,QAAA,MAAM,UAcjB"}
package/dist/Loading.d.ts DELETED
@@ -1 +0,0 @@
1
- //# sourceMappingURL=Loading.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Loading.d.ts","sourceRoot":"","sources":["../src/Loading.tsx"],"names":[],"mappings":""}
package/dist/Loading.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=Loading.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Loading.js","sourceRoot":"","sources":["../src/Loading.tsx"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- declare const root: false | typeof globalThis;
2
- declare function isConstructor(fn: any): boolean;
3
- //# sourceMappingURL=event-target-polyfill.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event-target-polyfill.d.ts","sourceRoot":"","sources":["../src/event-target-polyfill.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,IAAI,2BAGgC,CAAC;AAE3C,iBAAS,aAAa,CAAC,EAAE,KAAA,WASxB"}
@@ -1,114 +0,0 @@
1
- "use strict";
2
- // https://raw.githubusercontent.com/benlesh/event-target-polyfill/master/index.js
3
- // @ts-nocheck
4
- const root = (typeof globalThis !== 'undefined' && globalThis) ||
5
- (typeof self !== 'undefined' && self) ||
6
- (typeof global !== 'undefined' && global);
7
- function isConstructor(fn) {
8
- try {
9
- // eslint-disable-next-line
10
- new fn();
11
- }
12
- catch (error) {
13
- return false;
14
- }
15
- return true;
16
- }
17
- if (typeof root.Event !== 'function' || !isConstructor(root.Event)) {
18
- root.Event = (function () {
19
- function Event(type, options) {
20
- this.bubbles = Boolean(options) && Boolean(options.bubbles);
21
- this.cancelable = Boolean(options) && Boolean(options.cancelable);
22
- this.composed = Boolean(options) && Boolean(options.composed);
23
- this.type = type;
24
- }
25
- return Event;
26
- })();
27
- }
28
- if (typeof root.EventTarget === 'undefined' || !isConstructor(root.Event)) {
29
- root.EventTarget = (function () {
30
- function EventTarget() {
31
- this.__listeners = new Map();
32
- }
33
- EventTarget.prototype = Object.create(Object.prototype);
34
- EventTarget.prototype.addEventListener = function (type, listener, options) {
35
- if (arguments.length < 2) {
36
- throw new TypeError(`TypeError: Failed to execute 'addEventListener'
37
- on 'EventTarget': 2 arguments required, but only $ {
38
- arguments.length
39
- }
40
- present.`);
41
- }
42
- const { __listeners } = this;
43
- const actualType = type.toString();
44
- if (!__listeners.has(actualType)) {
45
- __listeners.set(actualType, new Map());
46
- }
47
- const listenersForType = __listeners.get(actualType);
48
- if (!listenersForType.has(listener)) {
49
- // Any given listener is only registered once
50
- listenersForType.set(listener, options);
51
- }
52
- };
53
- EventTarget.prototype.removeEventListener = function (type, listener) {
54
- if (arguments.length < 2) {
55
- throw new TypeError(`TypeError: Failed to execute 'addEventListener'
56
- on 'EventTarget': 2 arguments required, but only $ {
57
- arguments.length
58
- }
59
- present.`);
60
- }
61
- const { __listeners } = this;
62
- const actualType = type.toString();
63
- if (__listeners.has(actualType)) {
64
- const listenersForType = __listeners.get(actualType);
65
- if (listenersForType.has(listener)) {
66
- listenersForType.delete(listener);
67
- }
68
- }
69
- };
70
- EventTarget.prototype.dispatchEvent = function (event) {
71
- if (!(event instanceof Event)) {
72
- throw new TypeError(`Failed to execute 'dispatchEvent'
73
- on 'EventTarget': parameter 1 is not of type 'Event'.`);
74
- }
75
- const { type } = event;
76
- const { __listeners } = this;
77
- const listenersForType = __listeners.get(type);
78
- if (listenersForType) {
79
- for (const [listener, options] of listenersForType.entries()) {
80
- try {
81
- if (typeof listener === 'function') {
82
- // Listener functions must be executed with the EventTarget as the `this` context.
83
- listener.call(this, event);
84
- }
85
- else if (listener && typeof listener.handleEvent === 'function') {
86
- // Listener objects have their handleEvent method called, if they have one
87
- listener.handleEvent(event);
88
- }
89
- }
90
- catch (err) {
91
- // We need to report the error to the global error handling event,
92
- // but we do not want to break the loop that is executing the events.
93
- // Unfortunately, this is the best we can do, which isn't great, because the
94
- // native EventTarget will actually do this synchronously before moving to the next
95
- // event in the loop.
96
- setTimeout(() => {
97
- throw err;
98
- });
99
- }
100
- if (options === null || options === void 0 ? void 0 : options.once) {
101
- // If this was registered with { once: true }, we need
102
- // to remove it now.
103
- listenersForType.delete(listener);
104
- }
105
- }
106
- }
107
- // Since there are no cancellable events on a base EventTarget,
108
- // this should always return true.
109
- return true;
110
- };
111
- return EventTarget;
112
- })();
113
- }
114
- //# sourceMappingURL=event-target-polyfill.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event-target-polyfill.js","sourceRoot":"","sources":["../src/event-target-polyfill.ts"],"names":[],"mappings":";AAAA,kFAAkF;AAElF,cAAc;AACd,MAAM,IAAI,GACT,CAAC,OAAO,UAAU,KAAK,WAAW,IAAI,UAAU,CAAC;IACjD,CAAC,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC;IACrC,CAAC,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,CAAC;AAE3C,SAAS,aAAa,CAAC,EAAE;IACxB,IAAI;QACH,2BAA2B;QAC3B,IAAI,EAAE,EAAE,CAAC;KACT;IAAC,OA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