@remotion/cli 3.3.77 → 3.3.79

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.
Files changed (163) hide show
  1. package/dist/better-opn/index.d.ts +6 -0
  2. package/dist/better-opn/index.js +202 -0
  3. package/dist/editor/helpers/get-timeline-sequence-layout.js +1 -1
  4. package/dist/handle-common-errors.js +16 -0
  5. package/dist/parse-command-line.d.ts +2 -0
  6. package/dist/preview.js +8 -3
  7. package/package.json +7 -7
  8. package/dist/convert-entry-point-to-serve-url.d.ts +0 -1
  9. package/dist/convert-entry-point-to-serve-url.js +0 -15
  10. package/dist/editor/components/Checkbox.d.ts +0 -5
  11. package/dist/editor/components/Checkbox.js +0 -38
  12. package/dist/editor/components/CollapsableOptions.d.ts +0 -6
  13. package/dist/editor/components/CollapsableOptions.js +0 -35
  14. package/dist/editor/components/CurrentCompositionSideEffects.d.ts +0 -3
  15. package/dist/editor/components/CurrentCompositionSideEffects.js +0 -43
  16. package/dist/editor/components/InlineAction.d.ts +0 -5
  17. package/dist/editor/components/InlineAction.js +0 -34
  18. package/dist/editor/components/Modals.d.ts +0 -2
  19. package/dist/editor/components/Modals.js +0 -23
  20. package/dist/editor/components/RenderButton.d.ts +0 -6
  21. package/dist/editor/components/RenderButton.js +0 -67
  22. package/dist/editor/components/RenderModal/CrfSetting.d.ts +0 -15
  23. package/dist/editor/components/RenderModal/CrfSetting.js +0 -43
  24. package/dist/editor/components/RenderModal/EnforceAudioTrackSetting.d.ts +0 -5
  25. package/dist/editor/components/RenderModal/EnforceAudioTrackSetting.js +0 -14
  26. package/dist/editor/components/RenderModal/FrameRangeSetting.d.ts +0 -8
  27. package/dist/editor/components/RenderModal/FrameRangeSetting.js +0 -42
  28. package/dist/editor/components/RenderModal/MutedSetting.d.ts +0 -5
  29. package/dist/editor/components/RenderModal/MutedSetting.js +0 -14
  30. package/dist/editor/components/RenderModal/NumberOfLoopsSetting.d.ts +0 -5
  31. package/dist/editor/components/RenderModal/NumberOfLoopsSetting.js +0 -26
  32. package/dist/editor/components/RenderModal/NumberSetting.d.ts +0 -9
  33. package/dist/editor/components/RenderModal/NumberSetting.js +0 -26
  34. package/dist/editor/components/RenderModal/QualitySetting.d.ts +0 -5
  35. package/dist/editor/components/RenderModal/QualitySetting.js +0 -27
  36. package/dist/editor/components/RenderModal/RenderErrorModal.d.ts +0 -5
  37. package/dist/editor/components/RenderModal/RenderErrorModal.js +0 -64
  38. package/dist/editor/components/RenderModal/RenderModal.d.ts +0 -28
  39. package/dist/editor/components/RenderModal/RenderModal.js +0 -484
  40. package/dist/editor/components/RenderModal/RenderModalAdvanced.d.ts +0 -11
  41. package/dist/editor/components/RenderModal/RenderModalAdvanced.js +0 -15
  42. package/dist/editor/components/RenderModal/RenderModalAudio.d.ts +0 -13
  43. package/dist/editor/components/RenderModal/RenderModalAudio.js +0 -22
  44. package/dist/editor/components/RenderModal/RenderModalBasic.d.ts +0 -24
  45. package/dist/editor/components/RenderModal/RenderModalBasic.js +0 -87
  46. package/dist/editor/components/RenderModal/RenderModalGif.d.ts +0 -9
  47. package/dist/editor/components/RenderModal/RenderModalGif.js +0 -16
  48. package/dist/editor/components/RenderModal/RenderModalHr.d.ts +0 -2
  49. package/dist/editor/components/RenderModal/RenderModalHr.js +0 -18
  50. package/dist/editor/components/RenderModal/RenderModalPicture.d.ts +0 -28
  51. package/dist/editor/components/RenderModal/RenderModalPicture.js +0 -51
  52. package/dist/editor/components/RenderModal/ScaleSetting.d.ts +0 -5
  53. package/dist/editor/components/RenderModal/ScaleSetting.js +0 -11
  54. package/dist/editor/components/RenderModal/human-readable-audio-codecs.d.ts +0 -2
  55. package/dist/editor/components/RenderModal/human-readable-audio-codecs.js +0 -18
  56. package/dist/editor/components/RenderModal/human-readable-codec.d.ts +0 -2
  57. package/dist/editor/components/RenderModal/human-readable-codec.js +0 -36
  58. package/dist/editor/components/RenderModal/layout.d.ts +0 -5
  59. package/dist/editor/components/RenderModal/layout.js +0 -31
  60. package/dist/editor/components/RenderQueue/CircularProgress.d.ts +0 -5
  61. package/dist/editor/components/RenderQueue/CircularProgress.js +0 -18
  62. package/dist/editor/components/RenderQueue/RenderQueueError.d.ts +0 -5
  63. package/dist/editor/components/RenderQueue/RenderQueueError.js +0 -26
  64. package/dist/editor/components/RenderQueue/RenderQueueItem.d.ts +0 -5
  65. package/dist/editor/components/RenderQueue/RenderQueueItem.js +0 -39
  66. package/dist/editor/components/RenderQueue/RenderQueueItemCancelButton.d.ts +0 -5
  67. package/dist/editor/components/RenderQueue/RenderQueueItemCancelButton.js +0 -22
  68. package/dist/editor/components/RenderQueue/RenderQueueItemStatus.d.ts +0 -5
  69. package/dist/editor/components/RenderQueue/RenderQueueItemStatus.js +0 -27
  70. package/dist/editor/components/RenderQueue/RenderQueueOutputName.d.ts +0 -5
  71. package/dist/editor/components/RenderQueue/RenderQueueOutputName.js +0 -24
  72. package/dist/editor/components/RenderQueue/RenderQueueProgressMessage.d.ts +0 -5
  73. package/dist/editor/components/RenderQueue/RenderQueueProgressMessage.js +0 -27
  74. package/dist/editor/components/RenderQueue/RenderQueueRemoveItem.d.ts +0 -5
  75. package/dist/editor/components/RenderQueue/RenderQueueRemoveItem.js +0 -23
  76. package/dist/editor/components/RenderQueue/RenderQueueRepeat.d.ts +0 -5
  77. package/dist/editor/components/RenderQueue/RenderQueueRepeat.js +0 -22
  78. package/dist/editor/components/RenderQueue/actions.d.ts +0 -49
  79. package/dist/editor/components/RenderQueue/actions.js +0 -98
  80. package/dist/editor/components/RenderQueue/context.d.ts +0 -19
  81. package/dist/editor/components/RenderQueue/context.js +0 -56
  82. package/dist/editor/components/RenderQueue/index.d.ts +0 -2
  83. package/dist/editor/components/RenderQueue/index.js +0 -18
  84. package/dist/editor/components/RenderQueue/item-style.d.ts +0 -2
  85. package/dist/editor/components/RenderQueue/item-style.js +0 -21
  86. package/dist/editor/components/RenderToolbarIcon.d.ts +0 -2
  87. package/dist/editor/components/RenderToolbarIcon.js +0 -78
  88. package/dist/editor/components/RendersTab.d.ts +0 -6
  89. package/dist/editor/components/RendersTab.js +0 -43
  90. package/dist/editor/components/SegmentedControl.d.ts +0 -16
  91. package/dist/editor/components/SegmentedControl.js +0 -63
  92. package/dist/editor/components/SidebarContent.d.ts +0 -5
  93. package/dist/editor/components/SidebarContent.js +0 -52
  94. package/dist/editor/components/Tabs/index.d.ts +0 -11
  95. package/dist/editor/components/Tabs/index.js +0 -51
  96. package/dist/editor/helpers/client-id.d.ts +0 -17
  97. package/dist/editor/helpers/client-id.js +0 -46
  98. package/dist/editor/helpers/use-file-existence.d.ts +0 -1
  99. package/dist/editor/helpers/use-file-existence.js +0 -66
  100. package/dist/editor/icons/RenderStillIcon.d.ts +0 -3
  101. package/dist/editor/icons/RenderStillIcon.js +0 -8
  102. package/dist/editor/icons/audio.d.ts +0 -2
  103. package/dist/editor/icons/audio.js +0 -6
  104. package/dist/editor/icons/file.d.ts +0 -2
  105. package/dist/editor/icons/file.js +0 -6
  106. package/dist/editor/icons/frame.d.ts +0 -2
  107. package/dist/editor/icons/frame.js +0 -6
  108. package/dist/editor/icons/gear.d.ts +0 -2
  109. package/dist/editor/icons/gear.js +0 -6
  110. package/dist/editor/icons/gif.d.ts +0 -2
  111. package/dist/editor/icons/gif.js +0 -6
  112. package/dist/editor/icons/render.d.ts +0 -5
  113. package/dist/editor/icons/render.js +0 -8
  114. package/dist/editor/icons/video.d.ts +0 -5
  115. package/dist/editor/icons/video.js +0 -8
  116. package/dist/ffmpeg.d.ts +0 -2
  117. package/dist/ffmpeg.js +0 -21
  118. package/dist/file-watcher.d.ts +0 -9
  119. package/dist/file-watcher.js +0 -35
  120. package/dist/gcp-command.d.ts +0 -1
  121. package/dist/gcp-command.js +0 -27
  122. package/dist/get-default-out-name.d.ts +0 -5
  123. package/dist/get-default-out-name.js +0 -10
  124. package/dist/preview-server/api-routes.d.ts +0 -4
  125. package/dist/preview-server/api-routes.js +0 -17
  126. package/dist/preview-server/api-types.d.ts +0 -27
  127. package/dist/preview-server/api-types.js +0 -2
  128. package/dist/preview-server/file-existence-watchers.d.ts +0 -13
  129. package/dist/preview-server/file-existence-watchers.js +0 -62
  130. package/dist/preview-server/handler.d.ts +0 -9
  131. package/dist/preview-server/handler.js +0 -34
  132. package/dist/preview-server/parse-body.d.ts +0 -2
  133. package/dist/preview-server/parse-body.js +0 -16
  134. package/dist/preview-server/render-queue/get-default-video-contexts.d.ts +0 -10
  135. package/dist/preview-server/render-queue/get-default-video-contexts.js +0 -13
  136. package/dist/preview-server/render-queue/job.d.ts +0 -114
  137. package/dist/preview-server/render-queue/job.js +0 -2
  138. package/dist/preview-server/render-queue/make-retry-payload.d.ts +0 -3
  139. package/dist/preview-server/render-queue/make-retry-payload.js +0 -79
  140. package/dist/preview-server/render-queue/open-directory-in-finder.d.ts +0 -1
  141. package/dist/preview-server/render-queue/open-directory-in-finder.js +0 -34
  142. package/dist/preview-server/render-queue/process-still.d.ts +0 -8
  143. package/dist/preview-server/render-queue/process-still.js +0 -47
  144. package/dist/preview-server/render-queue/process-video.d.ts +0 -8
  145. package/dist/preview-server/render-queue/process-video.js +0 -64
  146. package/dist/preview-server/render-queue/queue.d.ts +0 -21
  147. package/dist/preview-server/render-queue/queue.js +0 -185
  148. package/dist/preview-server/routes/add-render.d.ts +0 -3
  149. package/dist/preview-server/routes/add-render.js +0 -68
  150. package/dist/preview-server/routes/cancel-render.d.ts +0 -3
  151. package/dist/preview-server/routes/cancel-render.js +0 -9
  152. package/dist/preview-server/routes/open-in-file-explorer.d.ts +0 -3
  153. package/dist/preview-server/routes/open-in-file-explorer.js +0 -14
  154. package/dist/preview-server/routes/remove-render.d.ts +0 -3
  155. package/dist/preview-server/routes/remove-render.js +0 -9
  156. package/dist/preview-server/routes/subscribe-to-file-existence.d.ts +0 -3
  157. package/dist/preview-server/routes/subscribe-to-file-existence.js +0 -13
  158. package/dist/preview-server/routes/unsubscribe-from-file-existence.d.ts +0 -3
  159. package/dist/preview-server/routes/unsubscribe-from-file-existence.js +0 -13
  160. package/dist/render-flows/render.d.ts +0 -46
  161. package/dist/render-flows/render.js +0 -279
  162. package/dist/render-flows/still.d.ts +0 -29
  163. package/dist/render-flows/still.js +0 -171
@@ -0,0 +1,6 @@
1
+ /// <reference types="node" />
2
+ export declare const openBrowser: ({ url, browserFlag, browserArgs, }: {
3
+ url: string;
4
+ browserFlag: string | undefined;
5
+ browserArgs: string | undefined;
6
+ }) => Promise<boolean | import("child_process").ChildProcess>;
@@ -0,0 +1,202 @@
1
+ "use strict";
2
+ // Copied from https://github.com/michaellzc/better-opn#readme
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.openBrowser = void 0;
5
+ const child_process_1 = require("child_process");
6
+ const open = require("open");
7
+ const normalizeURLToMatch = (target) => {
8
+ // We may encounter URL parse error but want to fallback to default behavior
9
+ try {
10
+ // Url module is deprecated on newer version of NodeJS, only use it when URL class is not supported (like Node 8)
11
+ const URL = typeof global.URL === 'undefined' ? require('url').URL : global.URL;
12
+ const url = new URL(target);
13
+ return url.origin;
14
+ }
15
+ catch (_a) {
16
+ return target;
17
+ }
18
+ };
19
+ // Copy from
20
+ // https://github.com/facebook/create-react-app/blob/master/packages/react-dev-utils/openBrowser.js#L64
21
+ const startBrowserProcess = async ({ browser, url, args, }) => {
22
+ const tryNewInstance = args.length > 0;
23
+ const shouldTryOpenChromiumWithAppleScript = process.platform === 'darwin' &&
24
+ !tryNewInstance &&
25
+ (typeof browser !== 'string' ||
26
+ browser === 'google chrome' ||
27
+ browser === 'chrome');
28
+ if (shouldTryOpenChromiumWithAppleScript) {
29
+ let appleScriptDenied = false;
30
+ // Will use the first open browser found from list
31
+ const supportedChromiumBrowsers = [
32
+ 'Google Chrome',
33
+ 'Google Chrome Canary',
34
+ 'Microsoft Edge',
35
+ 'Brave Browser',
36
+ 'Vivaldi',
37
+ 'Chromium',
38
+ 'Arc',
39
+ ];
40
+ const processes = await new Promise((resolve, reject) => {
41
+ (0, child_process_1.exec)('ps cax', (err, stdout) => {
42
+ if (err) {
43
+ reject(err);
44
+ }
45
+ else {
46
+ resolve(stdout);
47
+ }
48
+ });
49
+ });
50
+ const browsersToTry = supportedChromiumBrowsers.filter((b) => processes.includes(b));
51
+ for (const chromiumBrowser of browsersToTry) {
52
+ if (appleScriptDenied) {
53
+ continue;
54
+ }
55
+ try {
56
+ // Try our best to reuse existing tab
57
+ // on OSX Chromium-based browser with AppleScript
58
+ const appleScript = `
59
+ (*
60
+ Copyright (c) 2015-present, Facebook, Inc.
61
+ This source code is licensed under the MIT license found in the
62
+ LICENSE file in the root directory of this source tree.
63
+ *)
64
+
65
+ property targetTab: null
66
+ property targetTabIndex: -1
67
+ property targetWindow: null
68
+ property theProgram: "${chromiumBrowser}"
69
+
70
+ on run argv
71
+ set theURL to "${encodeURI(url)}"
72
+ set matchURL to "${process.env.OPEN_MATCH_HOST_ONLY === 'true'
73
+ ? encodeURI(normalizeURLToMatch(url))
74
+ : encodeURI(url)}"
75
+
76
+ using terms from application "Google Chrome"
77
+ tell application theProgram
78
+
79
+ if (count every window) = 0 then
80
+ make new window
81
+ end if
82
+
83
+ -- 1: Looking for tab running debugger
84
+ -- then, Reload debugging tab if found
85
+ -- then return
86
+ set found to my lookupTabWithUrl(matchURL)
87
+ if found then
88
+ set targetWindow's active tab index to targetTabIndex
89
+ tell targetTab to reload
90
+ tell targetWindow to activate
91
+ set index of targetWindow to 1
92
+ return
93
+ end if
94
+
95
+ -- 2: Looking for Empty tab
96
+ -- In case debugging tab was not found
97
+ -- We try to find an empty tab instead
98
+ set found to my lookupTabWithUrl("chrome://newtab/")
99
+ if found then
100
+ set targetWindow's active tab index to targetTabIndex
101
+ set URL of targetTab to theURL
102
+ tell targetWindow to activate
103
+ return
104
+ end if
105
+
106
+ -- 3: Create new tab
107
+ -- both debugging and empty tab were not found
108
+ -- make a new tab with url
109
+ tell window 1
110
+ activate
111
+ make new tab with properties {URL:theURL}
112
+ end tell
113
+ end tell
114
+ end using terms from
115
+ end run
116
+
117
+ -- Function:
118
+ -- Lookup tab with given url
119
+ -- if found, store tab, index, and window in properties
120
+ -- (properties were declared on top of file)
121
+ on lookupTabWithUrl(lookupUrl)
122
+ using terms from application "Google Chrome"
123
+ tell application theProgram
124
+ -- Find a tab with the given url
125
+ set found to false
126
+ set theTabIndex to -1
127
+ repeat with theWindow in every window
128
+ set theTabIndex to 0
129
+ repeat with theTab in every tab of theWindow
130
+ set theTabIndex to theTabIndex + 1
131
+ if (theTab's URL as string) contains lookupUrl then
132
+ -- assign tab, tab index, and window to properties
133
+ set targetTab to theTab
134
+ set targetTabIndex to theTabIndex
135
+ set targetWindow to theWindow
136
+ set found to true
137
+ exit repeat
138
+ end if
139
+ end repeat
140
+
141
+ if found then
142
+ exit repeat
143
+ end if
144
+ end repeat
145
+ end tell
146
+ end using terms from
147
+ return found
148
+ end lookupTabWithUrl
149
+ `.trim();
150
+ await new Promise((resolve, reject) => {
151
+ const proc = (0, child_process_1.exec)(`osascript -`, (error) => {
152
+ if (error) {
153
+ reject(error);
154
+ }
155
+ else {
156
+ // Ignore errors.
157
+ // It it breaks, it will fallback to `opn` anyway
158
+ resolve();
159
+ }
160
+ });
161
+ proc.stdin.write(appleScript);
162
+ proc.stdin.end();
163
+ });
164
+ return Promise.resolve(true);
165
+ }
166
+ catch (error) {
167
+ const appleScriptError = error.message;
168
+ if (appleScriptError
169
+ .toLowerCase()
170
+ .includes('not authorised to send apple events')) {
171
+ appleScriptDenied = true;
172
+ }
173
+ // Ignore errors.
174
+ // It it breaks, it will fallback to `opn` anyway
175
+ }
176
+ }
177
+ }
178
+ // Fallback to opn
179
+ // (It will always open new tab)
180
+ return open(url, {
181
+ ...(browser ? { app: { name: browser, arguments: args } } : {}),
182
+ newInstance: tryNewInstance,
183
+ wait: false,
184
+ });
185
+ };
186
+ const getBrowserArgs = (browserArgs) => {
187
+ if (browserArgs) {
188
+ return browserArgs.split(' ');
189
+ }
190
+ if (process.env.BROWSER_ARGS) {
191
+ return process.env.BROWSER_ARGS.split(' ');
192
+ }
193
+ return [];
194
+ };
195
+ const openBrowser = ({ url, browserFlag, browserArgs, }) => {
196
+ return startBrowserProcess({
197
+ browser: browserFlag !== null && browserFlag !== void 0 ? browserFlag : process.env.BROWSER,
198
+ url,
199
+ args: getBrowserArgs(browserArgs),
200
+ });
201
+ };
202
+ exports.openBrowser = openBrowser;
@@ -13,8 +13,8 @@ const getWidthOfTrack = ({ durationInFrames, lastFrame, windowWidth, spatialDura
13
13
  const getTimelineSequenceLayout = ({ durationInFrames, startFrom, maxMediaDuration, startFromMedia, video, windowWidth, }) => {
14
14
  var _a;
15
15
  const maxMediaSequenceDuration = (maxMediaDuration !== null && maxMediaDuration !== void 0 ? maxMediaDuration : Infinity) - startFromMedia;
16
- let spatialDuration = Math.min(maxMediaSequenceDuration, durationInFrames - 1);
17
16
  const lastFrame = ((_a = video.durationInFrames) !== null && _a !== void 0 ? _a : 1) - 1;
17
+ let spatialDuration = Math.min(maxMediaSequenceDuration, durationInFrames - 1, lastFrame - startFrom);
18
18
  const shouldAddHalfAFrameAtEnd = startFrom + durationInFrames < lastFrame;
19
19
  const shouldAddHalfAFrameAtStart = startFrom > 0;
20
20
  if (shouldAddHalfAFrameAtEnd) {
@@ -4,7 +4,9 @@ exports.handleCommonError = void 0;
4
4
  const chalk_1 = require("./chalk");
5
5
  const log_1 = require("./log");
6
6
  const print_error_1 = require("./print-error");
7
+ const truthy_1 = require("./truthy");
7
8
  const handleCommonError = async (err) => {
9
+ var _a;
8
10
  await (0, print_error_1.printError)(err);
9
11
  if (err.message.includes('Could not play video with')) {
10
12
  log_1.Log.info();
@@ -32,5 +34,19 @@ const handleCommonError = async (err) => {
32
34
  log_1.Log.info();
33
35
  log_1.Log.info(chalk_1.chalk.green('💡 Fix this issue https://remotion.dev/docs/lambda/troubleshooting/bucket-disallows-acl'));
34
36
  }
37
+ if (err.message.includes('Minified React error #306')) {
38
+ const componentName = (_a = err.message.match(/<\w+>/)) === null || _a === void 0 ? void 0 : _a[0];
39
+ log_1.Log.info([
40
+ '💡 This error indicates that the component',
41
+ componentName ? `(${componentName})` : null,
42
+ 'you are trying to render is not imported correctly.',
43
+ ]
44
+ .filter(truthy_1.truthy)
45
+ .join(' '));
46
+ log_1.Log.info();
47
+ log_1.Log.info(' Check the root file and ensure that the component is not undefined.');
48
+ log_1.Log.info(' Oftentimes, this happens if the component is missing the `export` keyword');
49
+ log_1.Log.info(' or if the component was renamed and the import statement not properly adjusted.');
50
+ }
35
51
  };
36
52
  exports.handleCommonError = handleCommonError;
@@ -48,6 +48,8 @@ export declare type CommandLineOptions = {
48
48
  ['package-manager']: string;
49
49
  ['webpack-poll']: number;
50
50
  ['no-open']: boolean;
51
+ ['browser']: string;
52
+ ['browser-args']: string;
51
53
  };
52
54
  export declare const BooleanFlags: string[];
53
55
  export declare const parsedCli: CommandLineOptions & {
package/dist/preview.js CHANGED
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.previewCommand = void 0;
7
- const better_opn_1 = __importDefault(require("better-opn"));
8
7
  const crypto_1 = __importDefault(require("crypto"));
9
8
  const path_1 = __importDefault(require("path"));
9
+ const better_opn_1 = require("./better-opn");
10
10
  const chalk_1 = require("./chalk");
11
11
  const config_1 = require("./config");
12
12
  const entry_point_1 = require("./entry-point");
@@ -36,13 +36,14 @@ const waitForLiveEventsListener = () => {
36
36
  });
37
37
  };
38
38
  const getShouldOpenBrowser = () => {
39
+ var _a;
39
40
  if (parse_command_line_1.parsedCli['no-open']) {
40
41
  return {
41
42
  shouldOpenBrowser: false,
42
43
  reasonForBrowserDecision: '--no-open specified',
43
44
  };
44
45
  }
45
- if (process.env.BROWSER === 'none') {
46
+ if (((_a = process.env.BROWSER) !== null && _a !== void 0 ? _a : '').toLowerCase() === 'none') {
46
47
  return {
47
48
  shouldOpenBrowser: false,
48
49
  reasonForBrowserDecision: 'env BROWSER=none was set',
@@ -136,7 +137,11 @@ const previewCommand = async (remotionRoot, args) => {
136
137
  }
137
138
  const { reasonForBrowserDecision, shouldOpenBrowser } = getShouldOpenBrowser();
138
139
  if (shouldOpenBrowser) {
139
- (0, better_opn_1.default)(`http://localhost:${port}`);
140
+ await (0, better_opn_1.openBrowser)({
141
+ url: `http://localhost:${port}`,
142
+ browserArgs: parse_command_line_1.parsedCli['browser-args'],
143
+ browserFlag: parse_command_line_1.parsedCli.browser,
144
+ });
140
145
  }
141
146
  else {
142
147
  log_1.Log.verbose(`Not opening browser, reason: ${reasonForBrowserDecision}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/cli",
3
- "version": "3.3.77",
3
+ "version": "3.3.79",
4
4
  "description": "CLI for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -16,16 +16,16 @@
16
16
  "author": "Jonny Burger <jonny@remotion.dev>",
17
17
  "license": "SEE LICENSE IN LICENSE.md",
18
18
  "dependencies": {
19
- "@remotion/bundler": "3.3.77",
20
- "@remotion/media-utils": "3.3.77",
21
- "@remotion/player": "3.3.77",
22
- "@remotion/renderer": "3.3.77",
23
- "better-opn": "2.1.1",
19
+ "@remotion/bundler": "3.3.79",
20
+ "@remotion/media-utils": "3.3.79",
21
+ "@remotion/player": "3.3.79",
22
+ "@remotion/renderer": "3.3.79",
24
23
  "dotenv": "9.0.2",
25
24
  "memfs": "3.4.3",
26
25
  "minimist": "1.2.6",
26
+ "open": "^8.4.2",
27
27
  "prompts": "2.4.1",
28
- "remotion": "3.3.77",
28
+ "remotion": "3.3.79",
29
29
  "semver": "7.3.5",
30
30
  "source-map": "0.6.1"
31
31
  },
@@ -1 +0,0 @@
1
- export declare const convertEntryPointToServeUrl: (entryPoint: string) => string;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.convertEntryPointToServeUrl = void 0;
7
- const renderer_1 = require("@remotion/renderer");
8
- const path_1 = __importDefault(require("path"));
9
- const convertEntryPointToServeUrl = (entryPoint) => {
10
- const fullPath = renderer_1.RenderInternals.isServeUrl(entryPoint)
11
- ? entryPoint
12
- : path_1.default.resolve(process.cwd(), entryPoint);
13
- return fullPath;
14
- };
15
- exports.convertEntryPointToServeUrl = convertEntryPointToServeUrl;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- export declare const Checkbox: React.FC<{
3
- checked: boolean;
4
- onChange: React.ChangeEventHandler<HTMLInputElement>;
5
- }>;
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Checkbox = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const colors_1 = require("../helpers/colors");
6
- const Checkmark_1 = require("../icons/Checkmark");
7
- const size = 20;
8
- const background = {
9
- height: size,
10
- width: size,
11
- position: 'relative',
12
- };
13
- const input = {
14
- appearance: 'none',
15
- background: colors_1.INPUT_BACKGROUND,
16
- border: '1px solid ' + colors_1.INPUT_BORDER_COLOR_UNHOVERED,
17
- height: size,
18
- width: size,
19
- top: 0,
20
- left: 0,
21
- position: 'absolute',
22
- margin: 0,
23
- };
24
- const box = {
25
- display: 'flex',
26
- justifyContent: 'center',
27
- alignItems: 'center',
28
- position: 'absolute',
29
- height: size,
30
- width: size,
31
- top: 0,
32
- left: 0,
33
- pointerEvents: 'none',
34
- };
35
- const Checkbox = ({ checked, onChange }) => {
36
- return ((0, jsx_runtime_1.jsxs)("div", { style: background, children: [(0, jsx_runtime_1.jsx)("input", { style: input, type: 'checkbox', checked: checked, onChange: onChange }), (0, jsx_runtime_1.jsx)("div", { style: box, children: checked ? (0, jsx_runtime_1.jsx)(Checkmark_1.Checkmark, {}) : null })] }));
37
- };
38
- exports.Checkbox = Checkbox;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- export declare const CollapsableOptions: React.FC<{
3
- children: React.ReactNode;
4
- showLabel: string;
5
- hideLabel: string;
6
- }>;
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CollapsableOptions = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const colors_1 = require("../helpers/colors");
7
- const z_index_1 = require("../state/z-index");
8
- const layout_1 = require("./layout");
9
- const TimelineCollapseToggle_1 = require("./Timeline/TimelineCollapseToggle");
10
- const container = {
11
- marginLeft: 16,
12
- height: 40,
13
- display: 'flex',
14
- flexDirection: 'row',
15
- alignItems: 'center',
16
- };
17
- const buttonStyle = {
18
- border: 'none',
19
- padding: 0,
20
- appearance: 'none',
21
- display: 'flex',
22
- flexDirection: 'row',
23
- alignItems: 'center',
24
- fontSize: 14,
25
- color: colors_1.LIGHT_TEXT,
26
- };
27
- const CollapsableOptions = ({ children, showLabel, hideLabel }) => {
28
- const [show, setShow] = (0, react_1.useState)(false);
29
- const { tabIndex } = (0, z_index_1.useZIndex)();
30
- const onClick = (0, react_1.useCallback)(() => {
31
- setShow((s) => !s);
32
- }, []);
33
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { style: container, children: (0, jsx_runtime_1.jsxs)("button", { style: buttonStyle, tabIndex: tabIndex, onClick: onClick, type: "button", children: [(0, jsx_runtime_1.jsx)(TimelineCollapseToggle_1.TimelineCollapseToggle, { color: colors_1.LIGHT_TEXT, collapsed: !show }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { block: true, x: 1 }), show ? hideLabel : showLabel] }) }), show ? children : null] }));
34
- };
35
- exports.CollapsableOptions = CollapsableOptions;
@@ -1,3 +0,0 @@
1
- import type React from 'react';
2
- export declare const TitleUpdater: React.FC;
3
- export declare const CurrentCompositionKeybindings: React.FC;
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CurrentCompositionKeybindings = exports.TitleUpdater = void 0;
4
- const react_1 = require("react");
5
- const remotion_1 = require("remotion");
6
- const use_keybinding_1 = require("../helpers/use-keybinding");
7
- const TitleUpdater = () => {
8
- const video = remotion_1.Internals.useVideo();
9
- (0, react_1.useEffect)(() => {
10
- if (!video) {
11
- document.title = 'Remotion Preview';
12
- return;
13
- }
14
- document.title = `${video.id} / ${window.remotion_projectName} - Remotion Preview`;
15
- }, [video]);
16
- return null;
17
- };
18
- exports.TitleUpdater = TitleUpdater;
19
- const CurrentCompositionKeybindings = () => {
20
- const keybindings = (0, use_keybinding_1.useKeybinding)();
21
- const video = remotion_1.Internals.useVideo();
22
- const openRenderModal = (0, react_1.useCallback)(() => {
23
- if (!video) {
24
- return null;
25
- }
26
- const renderButton = document.getElementById('render-modal-button');
27
- renderButton.click();
28
- }, [video]);
29
- (0, react_1.useEffect)(() => {
30
- const binding = keybindings.registerKeybinding({
31
- event: 'keydown',
32
- key: 'r',
33
- commandCtrlKey: false,
34
- callback: openRenderModal,
35
- preventDefault: true,
36
- });
37
- return () => {
38
- binding.unregister();
39
- };
40
- }, [keybindings, openRenderModal]);
41
- return null;
42
- };
43
- exports.CurrentCompositionKeybindings = CurrentCompositionKeybindings;
@@ -1,5 +0,0 @@
1
- import type { PropsWithChildren } from 'react';
2
- import React from 'react';
3
- export declare const InlineAction: React.FC<PropsWithChildren<{
4
- onClick: React.MouseEventHandler<HTMLAnchorElement> | undefined;
5
- }>>;
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InlineAction = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const colors_1 = require("../helpers/colors");
7
- const z_index_1 = require("../state/z-index");
8
- const InlineAction = ({ children, onClick }) => {
9
- const { tabIndex } = (0, z_index_1.useZIndex)();
10
- const [hovered, setHovered] = (0, react_1.useState)(false);
11
- const onPointerEnter = (0, react_1.useCallback)(() => {
12
- setHovered(true);
13
- }, []);
14
- const onPointerLeave = (0, react_1.useCallback)(() => {
15
- setHovered(false);
16
- }, []);
17
- const style = (0, react_1.useMemo)(() => {
18
- return {
19
- border: 'none',
20
- background: hovered ? colors_1.CLEAR_HOVER : 'transparent',
21
- height: 24,
22
- width: 24,
23
- display: 'inline-flex',
24
- justifyContent: 'center',
25
- alignItems: 'center',
26
- borderRadius: 3,
27
- opacity: hovered ? 1 : 0.6,
28
- };
29
- }, [hovered]);
30
- return (
31
- // <div> because cannot use button inside a button
32
- (0, jsx_runtime_1.jsx)("a", { onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, onClick: onClick, style: style, tabIndex: tabIndex, children: children }));
33
- };
34
- exports.InlineAction = InlineAction;
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const Modals: React.FC;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Modals = void 0;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- const react_1 = require("react");
9
- const client_id_1 = require("../helpers/client-id");
10
- const modals_1 = require("../state/modals");
11
- const NewComposition_1 = __importDefault(require("./NewComposition/NewComposition"));
12
- const QuickSwitcher_1 = __importDefault(require("./QuickSwitcher/QuickSwitcher"));
13
- const RenderErrorModal_1 = require("./RenderModal/RenderErrorModal");
14
- const RenderModal_1 = require("./RenderModal/RenderModal");
15
- const UpdateModal_1 = require("./UpdateModal/UpdateModal");
16
- const Modals = () => {
17
- const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
18
- const canRender = (0, react_1.useContext)(client_id_1.PreviewServerConnectionCtx).type === 'connected';
19
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && ((0, jsx_runtime_1.jsx)(NewComposition_1.default, { initialCompType: modalContextType.compType })), modalContextType && canRender && modalContextType.type === 'render' && ((0, jsx_runtime_1.jsx)(RenderModal_1.RenderModal, { initialFrame: modalContextType.initialFrame, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialQuality: modalContextType.initialQuality, initialOutName: modalContextType.initialOutName, initialScale: modalContextType.initialScale, initialVerbose: modalContextType.initialVerbose, initialRenderType: modalContextType.initialRenderType, initialAudioCodec: modalContextType.initialAudioCodec, initialVideoCodec: modalContextType.initialVideoCodec, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout })), modalContextType &&
20
- canRender &&
21
- modalContextType.type === 'render-error' && ((0, jsx_runtime_1.jsx)(RenderErrorModal_1.RenderErrorModal, { job: modalContextType.job })), modalContextType && modalContextType.type === 'update' && ((0, jsx_runtime_1.jsx)(UpdateModal_1.UpdateModal, { info: modalContextType.info })), modalContextType && modalContextType.type === 'quick-switcher' && ((0, jsx_runtime_1.jsx)(QuickSwitcher_1.default, { invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode }))] }));
22
- };
23
- exports.Modals = Modals;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import type { TCompMetadata } from 'remotion';
3
- export declare const RenderButton: React.FC<{
4
- composition: TCompMetadata;
5
- visible: boolean;
6
- }>;
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RenderButton = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const get_default_out_name_1 = require("../../get-default-out-name");
7
- const get_default_video_contexts_1 = require("../../preview-server/render-queue/get-default-video-contexts");
8
- const render_1 = require("../icons/render");
9
- const modals_1 = require("../state/modals");
10
- const InlineAction_1 = require("./InlineAction");
11
- const RenderButton = ({ composition, visible }) => {
12
- const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
13
- const iconStyle = (0, react_1.useMemo)(() => {
14
- return {
15
- style: {
16
- height: 12,
17
- },
18
- };
19
- }, []);
20
- const isVideo = composition.durationInFrames > 1;
21
- const onClick = (0, react_1.useCallback)((e) => {
22
- const defaults = window.remotion_renderDefaults;
23
- if (!defaults) {
24
- throw new Error('expected defaults');
25
- }
26
- e.stopPropagation();
27
- const { initialAudioCodec, initialRenderType, initialVideoCodec } = (0, get_default_video_contexts_1.getDefaultCodecs)({
28
- defaultCodec: defaults.codec,
29
- isStill: !isVideo,
30
- });
31
- setSelectedModal({
32
- type: 'render',
33
- compositionId: composition.id,
34
- initialFrame: 0,
35
- initialVideoImageFormat: defaults.videoImageFormat,
36
- initialStillImageFormat: defaults.stillImageFormat,
37
- initialQuality: defaults.quality,
38
- initialScale: defaults.scale,
39
- initialVerbose: defaults.logLevel === 'verbose',
40
- initialOutName: (0, get_default_out_name_1.getDefaultOutLocation)({
41
- compositionName: composition.id,
42
- defaultExtension: isVideo ? 'mp4' : 'png',
43
- type: 'asset',
44
- }),
45
- initialAudioCodec,
46
- initialRenderType,
47
- initialVideoCodec,
48
- initialConcurrency: defaults.concurrency,
49
- maxConcurrency: defaults.maxConcurrency,
50
- minConcurrency: defaults.minConcurrency,
51
- initialMuted: defaults.muted,
52
- initialEnforceAudioTrack: defaults.enforceAudioTrack,
53
- initialProResProfile: defaults.proResProfile,
54
- initialPixelFormat: defaults.pixelFormat,
55
- initialAudioBitrate: defaults.audioBitrate,
56
- initialVideoBitrate: defaults.videoBitrate,
57
- initialEveryNthFrame: defaults.everyNthFrame,
58
- initialNumberOfGifLoops: defaults.numberOfGifLoops,
59
- initialDelayRenderTimeout: defaults.delayRenderTimeout,
60
- });
61
- }, [composition.id, isVideo, setSelectedModal]);
62
- if (!visible) {
63
- return null;
64
- }
65
- return ((0, jsx_runtime_1.jsx)(InlineAction_1.InlineAction, { onClick: onClick, children: (0, jsx_runtime_1.jsx)(render_1.RenderIcon, { svgProps: iconStyle }) }));
66
- };
67
- exports.RenderButton = RenderButton;
@@ -1,15 +0,0 @@
1
- /// <reference types="react" />
2
- import type { Codec } from '@remotion/renderer';
3
- export declare const useCrfState: (codec: Codec) => {
4
- crf: number;
5
- setCrf: import("react").Dispatch<import("react").SetStateAction<number>>;
6
- minCrf: number;
7
- maxCrf: number;
8
- shouldDisplayOption: boolean;
9
- };
10
- export declare const CrfSetting: React.FC<{
11
- crf: number;
12
- setCrf: React.Dispatch<React.SetStateAction<number>>;
13
- min: number;
14
- max: number;
15
- }>;