@remotion/renderer 4.0.380 → 4.0.381

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.
@@ -3051,6 +3051,18 @@ class Page extends EventEmitter {
3051
3051
  async bringToFront() {
3052
3052
  await this.#client.send("Page.bringToFront");
3053
3053
  }
3054
+ async setAutoDarkModeOverride() {
3055
+ const result = await this.#client.send("Emulation.setEmulatedMedia", {
3056
+ media: "screen",
3057
+ features: [
3058
+ {
3059
+ name: "prefers-color-scheme",
3060
+ value: "dark"
3061
+ }
3062
+ ]
3063
+ });
3064
+ console.log(result);
3065
+ }
3054
3066
  evaluate(pageFunction, ...args) {
3055
3067
  return this.#frameManager.mainFrame().evaluate(pageFunction, ...args);
3056
3068
  }
@@ -16386,7 +16398,8 @@ var innerSetPropsAndEnv = async ({
16386
16398
  onServeUrlVisited,
16387
16399
  isMainTab,
16388
16400
  mediaCacheSizeInBytes,
16389
- initialMemoryAvailable
16401
+ initialMemoryAvailable,
16402
+ darkMode
16390
16403
  }) => {
16391
16404
  validatePuppeteerTimeout(timeoutInMilliseconds);
16392
16405
  const actualTimeout = timeoutInMilliseconds ?? DEFAULT_TIMEOUT;
@@ -16412,6 +16425,9 @@ var innerSetPropsAndEnv = async ({
16412
16425
  window.remotion_envVariables = input;
16413
16426
  }, JSON.stringify(envVariables));
16414
16427
  }
16428
+ if (darkMode) {
16429
+ await page.setAutoDarkModeOverride();
16430
+ }
16415
16431
  await page.evaluateOnNewDocument((input, key, port, audEnabled, vidEnabled, level) => {
16416
16432
  window.remotion_inputProps = input;
16417
16433
  window.remotion_initialFrame = key;
@@ -16458,7 +16474,8 @@ var innerSetPropsAndEnv = async ({
16458
16474
  onServeUrlVisited,
16459
16475
  isMainTab,
16460
16476
  mediaCacheSizeInBytes,
16461
- initialMemoryAvailable
16477
+ initialMemoryAvailable,
16478
+ darkMode
16462
16479
  });
16463
16480
  };
16464
16481
  const [pageRes, error] = await gotoPageOrThrow(page, urlToVisit, actualTimeout);
@@ -16709,7 +16726,8 @@ var innerGetCompositions = async ({
16709
16726
  timeoutInMilliseconds,
16710
16727
  indent,
16711
16728
  logLevel,
16712
- mediaCacheSizeInBytes
16729
+ mediaCacheSizeInBytes,
16730
+ darkMode
16713
16731
  }) => {
16714
16732
  validatePuppeteerTimeout(timeoutInMilliseconds);
16715
16733
  await setPropsAndEnv({
@@ -16730,7 +16748,8 @@ var innerGetCompositions = async ({
16730
16748
  },
16731
16749
  isMainTab: true,
16732
16750
  mediaCacheSizeInBytes,
16733
- initialMemoryAvailable: getAvailableMemory(logLevel)
16751
+ initialMemoryAvailable: getAvailableMemory(logLevel),
16752
+ darkMode
16734
16753
  });
16735
16754
  await puppeteerEvaluateWithCatch({
16736
16755
  page,
@@ -16864,7 +16883,8 @@ var internalGetCompositionsRaw = async ({
16864
16883
  onBrowserDownload,
16865
16884
  chromeMode,
16866
16885
  offthreadVideoThreads,
16867
- mediaCacheSizeInBytes
16886
+ mediaCacheSizeInBytes,
16887
+ darkMode: chromiumOptions.darkMode ?? false
16868
16888
  });
16869
16889
  }).then((comp) => {
16870
16890
  return resolve2(comp);
@@ -17895,7 +17915,8 @@ var makePage = async ({
17895
17915
  pageIndex,
17896
17916
  isMainTab,
17897
17917
  mediaCacheSizeInBytes,
17898
- onLog
17918
+ onLog,
17919
+ darkMode
17899
17920
  }) => {
17900
17921
  const page = await browserReplacer.getBrowser().newPage({ context, logLevel, indent, pageIndex, onBrowserLog, onLog });
17901
17922
  pagesArray.push(page);
@@ -17922,7 +17943,8 @@ var makePage = async ({
17922
17943
  },
17923
17944
  isMainTab,
17924
17945
  mediaCacheSizeInBytes,
17925
- initialMemoryAvailable: getAvailableMemory(logLevel)
17946
+ initialMemoryAvailable: getAvailableMemory(logLevel),
17947
+ darkMode
17926
17948
  });
17927
17949
  await puppeteerEvaluateWithCatch({
17928
17950
  pageFunction: (id, props, durationInFrames, fps, height, width, defaultCodec, defaultOutName, defaultVideoImageFormat, defaultPixelFormat, defaultProResProfile) => {
@@ -18880,7 +18902,8 @@ var innerRenderFrames = async ({
18880
18902
  binariesDirectory,
18881
18903
  imageSequencePattern,
18882
18904
  mediaCacheSizeInBytes,
18883
- onLog
18905
+ onLog,
18906
+ darkMode
18884
18907
  }) => {
18885
18908
  if (outputDir) {
18886
18909
  if (!fs14.existsSync(outputDir)) {
@@ -18928,7 +18951,8 @@ var innerRenderFrames = async ({
18928
18951
  pageIndex,
18929
18952
  isMainTab: pageIndex === 0,
18930
18953
  mediaCacheSizeInBytes,
18931
- onLog
18954
+ onLog,
18955
+ darkMode
18932
18956
  });
18933
18957
  };
18934
18958
  const getPool = async () => {
@@ -19177,7 +19201,8 @@ var internalRenderFramesRaw = ({
19177
19201
  offthreadVideoThreads,
19178
19202
  imageSequencePattern,
19179
19203
  mediaCacheSizeInBytes,
19180
- onLog
19204
+ onLog,
19205
+ darkMode: chromiumOptions.darkMode ?? false
19181
19206
  });
19182
19207
  })
19183
19208
  ]).then((res) => {
@@ -22154,7 +22179,8 @@ var innerRenderStill = async ({
22154
22179
  },
22155
22180
  isMainTab: true,
22156
22181
  mediaCacheSizeInBytes,
22157
- initialMemoryAvailable: getAvailableMemory(logLevel)
22182
+ initialMemoryAvailable: getAvailableMemory(logLevel),
22183
+ darkMode: chromiumOptions.darkMode ?? false
22158
22184
  });
22159
22185
  await puppeteerEvaluateWithCatch({
22160
22186
  pageFunction: (id, props, durationInFrames, fps, height, width, defaultCodec, defaultOutName, defaultVideoImageFormat, defaultPixelFormat, defaultProResProfile) => {
@@ -22397,7 +22423,8 @@ var innerSelectComposition = async ({
22397
22423
  indent,
22398
22424
  logLevel,
22399
22425
  onServeUrlVisited,
22400
- mediaCacheSizeInBytes
22426
+ mediaCacheSizeInBytes,
22427
+ chromiumOptions
22401
22428
  }) => {
22402
22429
  validatePuppeteerTimeout(timeoutInMilliseconds);
22403
22430
  await setPropsAndEnv({
@@ -22416,7 +22443,8 @@ var innerSelectComposition = async ({
22416
22443
  onServeUrlVisited,
22417
22444
  isMainTab: true,
22418
22445
  mediaCacheSizeInBytes,
22419
- initialMemoryAvailable: getAvailableMemory(logLevel)
22446
+ initialMemoryAvailable: getAvailableMemory(logLevel),
22447
+ darkMode: chromiumOptions.darkMode ?? false
22420
22448
  });
22421
22449
  await puppeteerEvaluateWithCatch({
22422
22450
  page,
@@ -16,7 +16,7 @@ const seek_to_frame_1 = require("./seek-to-frame");
16
16
  const set_props_and_env_1 = require("./set-props-and-env");
17
17
  const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
18
18
  const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
19
- const innerGetCompositions = async ({ envVariables, serializedInputPropsWithCustomSchema, page, proxyPort, serveUrl, timeoutInMilliseconds, indent, logLevel, mediaCacheSizeInBytes, }) => {
19
+ const innerGetCompositions = async ({ envVariables, serializedInputPropsWithCustomSchema, page, proxyPort, serveUrl, timeoutInMilliseconds, indent, logLevel, mediaCacheSizeInBytes, darkMode, }) => {
20
20
  (0, validate_puppeteer_timeout_1.validatePuppeteerTimeout)(timeoutInMilliseconds);
21
21
  await (0, set_props_and_env_1.setPropsAndEnv)({
22
22
  serializedInputPropsWithCustomSchema,
@@ -35,6 +35,7 @@ const innerGetCompositions = async ({ envVariables, serializedInputPropsWithCust
35
35
  isMainTab: true,
36
36
  mediaCacheSizeInBytes,
37
37
  initialMemoryAvailable: (0, get_available_memory_1.getAvailableMemory)(logLevel),
38
+ darkMode,
38
39
  });
39
40
  await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
40
41
  page,
@@ -118,6 +119,7 @@ const internalGetCompositionsRaw = async ({ browserExecutable, chromiumOptions,
118
119
  onDownload: () => undefined,
119
120
  })
120
121
  .then(({ server: { serveUrl, offthreadPort, sourceMap }, cleanupServer }) => {
122
+ var _a;
121
123
  page.setBrowserSourceMapGetter(sourceMap);
122
124
  cleanup.push(() => {
123
125
  return cleanupServer(true);
@@ -137,6 +139,7 @@ const internalGetCompositionsRaw = async ({ browserExecutable, chromiumOptions,
137
139
  chromeMode,
138
140
  offthreadVideoThreads,
139
141
  mediaCacheSizeInBytes,
142
+ darkMode: (_a = chromiumOptions.darkMode) !== null && _a !== void 0 ? _a : false,
140
143
  });
141
144
  })
142
145
  .then((comp) => {
@@ -5,7 +5,7 @@ import type { SourceMapGetter } from './browser/source-map-getter';
5
5
  import type { VideoImageFormat } from './image-format';
6
6
  import type { LogLevel } from './log-level';
7
7
  import type { BrowserReplacer } from './replace-browser';
8
- export declare const makePage: ({ context, initialFrame, browserReplacer, logLevel, indent, pagesArray, onBrowserLog, scale, timeoutInMilliseconds, composition, proxyPort, serveUrl, muted, envVariables, serializedInputPropsWithCustomSchema, imageFormat, serializedResolvedPropsWithCustomSchema, pageIndex, isMainTab, mediaCacheSizeInBytes, onLog, }: {
8
+ export declare const makePage: ({ context, initialFrame, browserReplacer, logLevel, indent, pagesArray, onBrowserLog, scale, timeoutInMilliseconds, composition, proxyPort, serveUrl, muted, envVariables, serializedInputPropsWithCustomSchema, imageFormat, serializedResolvedPropsWithCustomSchema, pageIndex, isMainTab, mediaCacheSizeInBytes, onLog, darkMode, }: {
9
9
  context: SourceMapGetter;
10
10
  initialFrame: number;
11
11
  browserReplacer: BrowserReplacer;
@@ -27,4 +27,5 @@ export declare const makePage: ({ context, initialFrame, browserReplacer, logLev
27
27
  isMainTab: boolean;
28
28
  mediaCacheSizeInBytes: number | null;
29
29
  onLog: OnLog;
30
+ darkMode: boolean;
30
31
  }) => Promise<Page>;
package/dist/make-page.js CHANGED
@@ -4,7 +4,7 @@ exports.makePage = void 0;
4
4
  const get_available_memory_1 = require("./memory/get-available-memory");
5
5
  const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
6
6
  const set_props_and_env_1 = require("./set-props-and-env");
7
- const makePage = async ({ context, initialFrame, browserReplacer, logLevel, indent, pagesArray, onBrowserLog, scale, timeoutInMilliseconds, composition, proxyPort, serveUrl, muted, envVariables, serializedInputPropsWithCustomSchema, imageFormat, serializedResolvedPropsWithCustomSchema, pageIndex, isMainTab, mediaCacheSizeInBytes, onLog, }) => {
7
+ const makePage = async ({ context, initialFrame, browserReplacer, logLevel, indent, pagesArray, onBrowserLog, scale, timeoutInMilliseconds, composition, proxyPort, serveUrl, muted, envVariables, serializedInputPropsWithCustomSchema, imageFormat, serializedResolvedPropsWithCustomSchema, pageIndex, isMainTab, mediaCacheSizeInBytes, onLog, darkMode, }) => {
8
8
  const page = await browserReplacer
9
9
  .getBrowser()
10
10
  .newPage({ context, logLevel, indent, pageIndex, onBrowserLog, onLog });
@@ -31,6 +31,7 @@ const makePage = async ({ context, initialFrame, browserReplacer, logLevel, inde
31
31
  isMainTab,
32
32
  mediaCacheSizeInBytes,
33
33
  initialMemoryAvailable: (0, get_available_memory_1.getAvailableMemory)(logLevel),
34
+ darkMode,
34
35
  });
35
36
  await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
36
37
  // eslint-disable-next-line max-params
@@ -21,6 +21,7 @@ export type ChromiumOptions = {
21
21
  gl?: OpenGlRenderer | null;
22
22
  userAgent?: string | null;
23
23
  enableMultiProcessOnLinux?: boolean;
24
+ darkMode?: boolean;
24
25
  } & OnlyV4Options;
25
26
  type InternalOpenBrowserOptions = {
26
27
  browserExecutable: string | null;
@@ -0,0 +1,15 @@
1
+ export declare const darkModeOption: {
2
+ name: string;
3
+ cliFlag: "dark-mode";
4
+ description: () => import("react/jsx-runtime").JSX.Element;
5
+ ssrName: string;
6
+ docLink: string;
7
+ type: boolean;
8
+ getValue: ({ commandLine }: {
9
+ commandLine: Record<string, unknown>;
10
+ }) => {
11
+ source: string;
12
+ value: boolean;
13
+ };
14
+ setConfig: (value: boolean) => void;
15
+ };
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.darkModeOption = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const DEFAULT_VALUE = false;
6
+ let darkMode = DEFAULT_VALUE;
7
+ const cliFlag = 'dark-mode';
8
+ exports.darkModeOption = {
9
+ name: 'Dark Mode',
10
+ cliFlag,
11
+ description: () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Whether Chromium should pretend to be in dark mode by emulating the media feature 'prefers-color-scheme: dark'. Default is", ' ', (0, jsx_runtime_1.jsx)("code", { children: String(DEFAULT_VALUE) }), "."] })),
12
+ ssrName: 'darkMode',
13
+ docLink: 'https://www.remotion.dev/docs/chromium-flags#--dark-mode',
14
+ type: false,
15
+ getValue: ({ commandLine }) => {
16
+ if (commandLine[cliFlag] !== undefined) {
17
+ return {
18
+ source: 'cli',
19
+ value: commandLine[cliFlag],
20
+ };
21
+ }
22
+ if (darkMode !== DEFAULT_VALUE) {
23
+ return {
24
+ source: 'config',
25
+ value: darkMode,
26
+ };
27
+ }
28
+ return {
29
+ source: 'default',
30
+ value: DEFAULT_VALUE,
31
+ };
32
+ },
33
+ setConfig: (value) => {
34
+ darkMode = value;
35
+ },
36
+ };
@@ -742,6 +742,21 @@ export declare const allOptions: {
742
742
  };
743
743
  setConfig: (size: number | null) => void;
744
744
  };
745
+ darkModeOption: {
746
+ name: string;
747
+ cliFlag: "dark-mode";
748
+ description: () => import("react/jsx-runtime").JSX.Element;
749
+ ssrName: string;
750
+ docLink: string;
751
+ type: boolean;
752
+ getValue: ({ commandLine }: {
753
+ commandLine: Record<string, unknown>;
754
+ }) => {
755
+ source: string;
756
+ value: boolean;
757
+ };
758
+ setConfig: (value: boolean) => void;
759
+ };
745
760
  };
746
761
  export type AvailableOptions = keyof typeof allOptions;
747
762
  export type TypeOfOption<Type> = Type extends AnyRemotionOption<infer X> ? X : never;
@@ -10,6 +10,7 @@ const chrome_mode_1 = require("./chrome-mode");
10
10
  const color_space_1 = require("./color-space");
11
11
  const crf_1 = require("./crf");
12
12
  const cross_site_isolation_1 = require("./cross-site-isolation");
13
+ const dark_mode_1 = require("./dark-mode");
13
14
  const delete_after_1 = require("./delete-after");
14
15
  const disable_git_source_1 = require("./disable-git-source");
15
16
  const disallow_parallel_encoding_1 = require("./disallow-parallel-encoding");
@@ -94,4 +95,5 @@ exports.allOptions = {
94
95
  enableCrossSiteIsolationOption: cross_site_isolation_1.enableCrossSiteIsolationOption,
95
96
  imageSequencePatternOption: image_sequence_pattern_1.imageSequencePatternOption,
96
97
  mediaCacheSizeInBytesOption: video_cache_size_1.mediaCacheSizeInBytesOption,
98
+ darkModeOption: dark_mode_1.darkModeOption,
97
99
  };
@@ -35,7 +35,7 @@ const validate_1 = require("./validate");
35
35
  const validate_scale_1 = require("./validate-scale");
36
36
  const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
37
37
  const MAX_RETRIES_PER_FRAME = 1;
38
- const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, jpegQuality, imageFormat, frameRange, onError, envVariables, onBrowserLog, onFrameBuffer, onDownload, pagesArray, serveUrl, composition, timeoutInMilliseconds, scale, resolvedConcurrency, everyNthFrame, proxyPort, cancelSignal, downloadMap, muted, makeBrowser, browserReplacer, sourceMapGetter, logLevel, indent, parallelEncodingEnabled, compositionStart, forSeamlessAacConcatenation, onArtifact, binariesDirectory, imageSequencePattern, mediaCacheSizeInBytes, onLog, }) => {
38
+ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, jpegQuality, imageFormat, frameRange, onError, envVariables, onBrowserLog, onFrameBuffer, onDownload, pagesArray, serveUrl, composition, timeoutInMilliseconds, scale, resolvedConcurrency, everyNthFrame, proxyPort, cancelSignal, downloadMap, muted, makeBrowser, browserReplacer, sourceMapGetter, logLevel, indent, parallelEncodingEnabled, compositionStart, forSeamlessAacConcatenation, onArtifact, binariesDirectory, imageSequencePattern, mediaCacheSizeInBytes, onLog, darkMode, }) => {
39
39
  if (outputDir) {
40
40
  if (!node_fs_1.default.existsSync(outputDir)) {
41
41
  node_fs_1.default.mkdirSync(outputDir, {
@@ -77,6 +77,7 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serialized
77
77
  isMainTab: pageIndex === 0,
78
78
  mediaCacheSizeInBytes,
79
79
  onLog,
80
+ darkMode,
80
81
  });
81
82
  };
82
83
  const getPool = async () => {
@@ -246,6 +247,7 @@ const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOpti
246
247
  }),
247
248
  browserInstance,
248
249
  ]).then(([{ server: openedServer, cleanupServer }, pInstance]) => {
250
+ var _a;
249
251
  const { serveUrl, offthreadPort, sourceMap, downloadMap } = openedServer;
250
252
  const browserReplacer = (0, replace_browser_1.handleBrowserCrash)(pInstance, logLevel, indent);
251
253
  const cycle = (0, cycle_browser_tabs_1.cycleBrowserTabs)({
@@ -300,6 +302,7 @@ const internalRenderFramesRaw = ({ browserExecutable, cancelSignal, chromiumOpti
300
302
  imageSequencePattern,
301
303
  mediaCacheSizeInBytes,
302
304
  onLog,
305
+ darkMode: (_a = chromiumOptions.darkMode) !== null && _a !== void 0 ? _a : false,
303
306
  });
304
307
  }),
305
308
  ])
@@ -68,6 +68,7 @@ const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
68
68
  const validate_scale_1 = require("./validate-scale");
69
69
  const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
70
70
  const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFAULT_STILL_IMAGE_FORMAT, serveUrl, puppeteerInstance, onError, serializedInputPropsWithCustomSchema, envVariables, output, frame = 0, overwrite, browserExecutable, timeoutInMilliseconds, chromiumOptions, scale, proxyPort, cancelSignal, jpegQuality, onBrowserLog, sourceMapGetter, logLevel, indent, serializedResolvedPropsWithCustomSchema, onBrowserDownload, onArtifact, chromeMode, mediaCacheSizeInBytes, onLog, }) => {
71
+ var _a;
71
72
  (0, validate_1.validateDimension)(composition.height, 'height', 'in the `config` object passed to `renderStill()`');
72
73
  (0, validate_1.validateDimension)(composition.width, 'width', 'in the `config` object passed to `renderStill()`');
73
74
  (0, validate_1.validateFps)(composition.fps, 'in the `config` object of `renderStill()`', false);
@@ -166,6 +167,7 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
166
167
  isMainTab: true,
167
168
  mediaCacheSizeInBytes,
168
169
  initialMemoryAvailable: (0, get_available_memory_1.getAvailableMemory)(logLevel),
170
+ darkMode: (_a = chromiumOptions.darkMode) !== null && _a !== void 0 ? _a : false,
169
171
  });
170
172
  await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
171
173
  // eslint-disable-next-line max-params
@@ -16,7 +16,8 @@ const seek_to_frame_1 = require("./seek-to-frame");
16
16
  const set_props_and_env_1 = require("./set-props-and-env");
17
17
  const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
18
18
  const wrap_with_error_handling_1 = require("./wrap-with-error-handling");
19
- const innerSelectComposition = async ({ page, serializedInputPropsWithCustomSchema, envVariables, serveUrl, timeoutInMilliseconds, port, id, indent, logLevel, onServeUrlVisited, mediaCacheSizeInBytes, }) => {
19
+ const innerSelectComposition = async ({ page, serializedInputPropsWithCustomSchema, envVariables, serveUrl, timeoutInMilliseconds, port, id, indent, logLevel, onServeUrlVisited, mediaCacheSizeInBytes, chromiumOptions, }) => {
20
+ var _a;
20
21
  (0, validate_puppeteer_timeout_1.validatePuppeteerTimeout)(timeoutInMilliseconds);
21
22
  await (0, set_props_and_env_1.setPropsAndEnv)({
22
23
  serializedInputPropsWithCustomSchema,
@@ -35,6 +36,7 @@ const innerSelectComposition = async ({ page, serializedInputPropsWithCustomSche
35
36
  isMainTab: true,
36
37
  mediaCacheSizeInBytes,
37
38
  initialMemoryAvailable: (0, get_available_memory_1.getAvailableMemory)(logLevel),
39
+ darkMode: (_a = chromiumOptions.darkMode) !== null && _a !== void 0 ? _a : false,
38
40
  });
39
41
  await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
40
42
  page,
@@ -7,6 +7,7 @@ type SetPropsAndEnv = {
7
7
  serveUrl: string;
8
8
  initialFrame: number;
9
9
  timeoutInMilliseconds: number | undefined;
10
+ darkMode: boolean;
10
11
  proxyPort: number;
11
12
  retriesRemaining: number;
12
13
  audioEnabled: boolean;
@@ -10,7 +10,7 @@ const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
10
10
  const redirect_status_codes_1 = require("./redirect-status-codes");
11
11
  const truthy_1 = require("./truthy");
12
12
  const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
13
- const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVariables, page, serveUrl, initialFrame, timeoutInMilliseconds, proxyPort, retriesRemaining, audioEnabled, videoEnabled, indent, logLevel, onServeUrlVisited, isMainTab, mediaCacheSizeInBytes, initialMemoryAvailable, }) => {
13
+ const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVariables, page, serveUrl, initialFrame, timeoutInMilliseconds, proxyPort, retriesRemaining, audioEnabled, videoEnabled, indent, logLevel, onServeUrlVisited, isMainTab, mediaCacheSizeInBytes, initialMemoryAvailable, darkMode, }) => {
14
14
  (0, validate_puppeteer_timeout_1.validatePuppeteerTimeout)(timeoutInMilliseconds);
15
15
  const actualTimeout = timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : TimeoutSettings_1.DEFAULT_TIMEOUT;
16
16
  page.setDefaultTimeout(actualTimeout);
@@ -37,6 +37,9 @@ const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVa
37
37
  window.remotion_envVariables = input;
38
38
  }, JSON.stringify(envVariables));
39
39
  }
40
+ if (darkMode) {
41
+ await page.setAutoDarkModeOverride();
42
+ }
40
43
  await page.evaluateOnNewDocument((input, key, port, audEnabled, vidEnabled, level) => {
41
44
  window.remotion_inputProps = input;
42
45
  window.remotion_initialFrame = key;
@@ -86,6 +89,7 @@ const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVa
86
89
  isMainTab,
87
90
  mediaCacheSizeInBytes,
88
91
  initialMemoryAvailable,
92
+ darkMode,
89
93
  });
90
94
  };
91
95
  const [pageRes, error] = await (0, goto_page_or_throw_1.gotoPageOrThrow)(page, urlToVisit, actualTimeout);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/renderer"
4
4
  },
5
5
  "name": "@remotion/renderer",
6
- "version": "4.0.380",
6
+ "version": "4.0.381",
7
7
  "description": "Render Remotion videos using Node.js or Bun",
8
8
  "main": "dist/index.js",
9
9
  "types": "dist/index.d.ts",
@@ -22,11 +22,11 @@
22
22
  "dependencies": {
23
23
  "execa": "5.1.1",
24
24
  "extract-zip": "2.0.1",
25
- "remotion": "4.0.380",
26
- "@remotion/streaming": "4.0.380",
25
+ "remotion": "4.0.381",
26
+ "@remotion/streaming": "4.0.381",
27
27
  "source-map": "^0.8.0-beta.0",
28
28
  "ws": "8.17.1",
29
- "@remotion/licensing": "4.0.380"
29
+ "@remotion/licensing": "4.0.381"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "react": ">=16.8.0",
@@ -39,19 +39,19 @@
39
39
  "react": "19.0.0",
40
40
  "react-dom": "19.0.0",
41
41
  "@types/ws": "8.5.10",
42
- "@remotion/example-videos": "4.0.380",
43
- "@remotion/eslint-config-internal": "4.0.380",
42
+ "@remotion/example-videos": "4.0.381",
43
+ "@remotion/eslint-config-internal": "4.0.381",
44
44
  "eslint": "9.19.0",
45
45
  "@types/node": "20.12.14"
46
46
  },
47
47
  "optionalDependencies": {
48
- "@remotion/compositor-darwin-arm64": "4.0.380",
49
- "@remotion/compositor-darwin-x64": "4.0.380",
50
- "@remotion/compositor-linux-arm64-gnu": "4.0.380",
51
- "@remotion/compositor-linux-arm64-musl": "4.0.380",
52
- "@remotion/compositor-linux-x64-gnu": "4.0.380",
53
- "@remotion/compositor-linux-x64-musl": "4.0.380",
54
- "@remotion/compositor-win32-x64-msvc": "4.0.380"
48
+ "@remotion/compositor-darwin-arm64": "4.0.381",
49
+ "@remotion/compositor-darwin-x64": "4.0.381",
50
+ "@remotion/compositor-linux-arm64-gnu": "4.0.381",
51
+ "@remotion/compositor-linux-arm64-musl": "4.0.381",
52
+ "@remotion/compositor-linux-x64-gnu": "4.0.381",
53
+ "@remotion/compositor-linux-x64-musl": "4.0.381",
54
+ "@remotion/compositor-win32-x64-msvc": "4.0.381"
55
55
  },
56
56
  "keywords": [
57
57
  "remotion",