@remotion/renderer 4.0.0-oops.3 → 4.0.0-preload.13

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.
@@ -2,6 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.cycleBrowserTabs = void 0;
4
4
  const cycleBrowserTabs = (puppeteerInstance, concurrency) => {
5
+ if (concurrency <= 1) {
6
+ return {
7
+ stopCycling: () => undefined,
8
+ };
9
+ }
5
10
  let interval = null;
6
11
  let i = 0;
7
12
  const set = () => {
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -1,6 +1,6 @@
1
1
  import puppeteer from 'puppeteer-core';
2
2
  import { Browser } from 'remotion';
3
- declare const validRenderers: readonly ["angle", "egl", "swiftshader"];
3
+ declare const validRenderers: readonly ["swangle", "angle", "egl", "swiftshader"];
4
4
  declare type OpenGlRenderer = typeof validRenderers[number];
5
5
  export declare type ChromiumOptions = {
6
6
  ignoreCertificateErrors?: boolean;
@@ -13,5 +13,6 @@ export declare const openBrowser: (browser: Browser, options?: {
13
13
  shouldDumpIo?: boolean | undefined;
14
14
  browserExecutable?: string | null | undefined;
15
15
  chromiumOptions?: ChromiumOptions | undefined;
16
+ forceDeviceScaleFactor?: number | undefined;
16
17
  } | undefined) => Promise<puppeteer.Browser>;
17
18
  export {};
@@ -10,11 +10,17 @@ const path_1 = __importDefault(require("path"));
10
10
  const puppeteer_core_1 = __importDefault(require("puppeteer-core"));
11
11
  const remotion_1 = require("remotion");
12
12
  const get_local_browser_executable_1 = require("./get-local-browser-executable");
13
- const validRenderers = ['angle', 'egl', 'swiftshader'];
13
+ const validRenderers = ['swangle', 'angle', 'egl', 'swiftshader'];
14
14
  const getOpenGlRenderer = (option) => {
15
15
  const renderer = option !== null && option !== void 0 ? option : remotion_1.Internals.DEFAULT_OPENGL_RENDERER;
16
16
  remotion_1.Internals.validateOpenGlRenderer(renderer);
17
- return renderer;
17
+ if (renderer === 'swangle') {
18
+ return [`--use-gl=angle`, `--use-angle=swiftshader`];
19
+ }
20
+ if (renderer === null) {
21
+ return [];
22
+ }
23
+ return [`--use-gl=${renderer}`];
18
24
  };
19
25
  const browserInstances = [];
20
26
  const killAllBrowsers = async () => {
@@ -35,15 +41,52 @@ const openBrowser = async (browser, options) => {
35
41
  const executablePath = (0, get_local_browser_executable_1.getLocalBrowserExecutable)(browser, (_b = options === null || options === void 0 ? void 0 : options.browserExecutable) !== null && _b !== void 0 ? _b : null);
36
42
  const customGlRenderer = getOpenGlRenderer((_d = (_c = options === null || options === void 0 ? void 0 : options.chromiumOptions) === null || _c === void 0 ? void 0 : _c.gl) !== null && _d !== void 0 ? _d : null);
37
43
  const browserInstance = await puppeteer_core_1.default.launch({
38
- executablePath: '/Users/jonathanburger/chromium/src/out/Default/Chromium.app/Contents/MacOS/Chromium',
44
+ executablePath,
39
45
  product: browser,
40
46
  dumpio: (_e = options === null || options === void 0 ? void 0 : options.shouldDumpIo) !== null && _e !== void 0 ? _e : false,
41
- headless: (_g = (_f = options === null || options === void 0 ? void 0 : options.chromiumOptions) === null || _f === void 0 ? void 0 : _f.headless) !== null && _g !== void 0 ? _g : true,
47
+ ignoreDefaultArgs: true,
42
48
  args: [
49
+ 'about:blank',
50
+ '--allow-pre-commit-input',
51
+ '--disable-background-networking',
52
+ '--enable-features=NetworkService,NetworkServiceInProcess',
53
+ '--disable-background-timer-throttling',
54
+ '--disable-backgrounding-occluded-windows',
55
+ '--disable-breakpad',
56
+ '--disable-client-side-phishing-detection',
57
+ '--disable-component-extensions-with-background-pages',
58
+ '--disable-default-apps',
59
+ '--disable-dev-shm-usage',
60
+ '--disable-extensions',
61
+ '--no-proxy-server',
62
+ "--proxy-server='direct://'",
63
+ '--proxy-bypass-list=*',
64
+ // TODO: remove AvoidUnnecessaryBeforeUnloadCheckSync below
65
+ // once crbug.com/1324138 is fixed and released.
66
+ '--disable-features=Translate,BackForwardCache,AvoidUnnecessaryBeforeUnloadCheckSync',
67
+ '--disable-hang-monitor',
68
+ '--disable-ipc-flooding-protection',
69
+ '--disable-popup-blocking',
70
+ '--disable-prompt-on-repost',
71
+ '--disable-renderer-backgrounding',
72
+ '--disable-sync',
73
+ '--force-color-profile=srgb',
74
+ '--metrics-recording-only',
75
+ '--no-first-run',
76
+ '--video-threads=16',
77
+ '--enable-automation',
78
+ '--password-store=basic',
79
+ '--use-mock-keychain',
80
+ // TODO(sadym): remove '--enable-blink-features=IdleDetection'
81
+ // once IdleDetection is turned on by default.
82
+ '--enable-blink-features=IdleDetection',
83
+ '--export-tagged-pdf',
84
+ '--intensive-wake-up-throttling-policy=0',
85
+ ((_g = (_f = options === null || options === void 0 ? void 0 : options.chromiumOptions) === null || _f === void 0 ? void 0 : _f.headless) !== null && _g !== void 0 ? _g : true) ? '--headless' : null,
43
86
  '--no-sandbox',
44
87
  '--disable-setuid-sandbox',
45
- '--disable-dev-shm-usage',
46
- customGlRenderer ? `--use-gl=${customGlRenderer}` : null,
88
+ ...customGlRenderer,
89
+ '--disable-background-media-suspend',
47
90
  process.platform === 'linux' ? '--single-process' : null,
48
91
  '--allow-running-insecure-content',
49
92
  '--disable-component-update',
@@ -51,15 +94,14 @@ const openBrowser = async (browser, options) => {
51
94
  '--disable-features=AudioServiceOutOfProcess,IsolateOrigins,site-per-process',
52
95
  '--disable-print-preview',
53
96
  '--disable-site-isolation-trials',
54
- '--disk-cache-size=33554432',
97
+ '--disk-cache-size=268435456',
55
98
  '--hide-scrollbars',
56
99
  '--no-default-browser-check',
57
100
  '--no-pings',
58
101
  '--no-zygote',
59
- '--disable-background-media-suspend',
60
- '--force-gpu-mem-available-mb=1024',
61
- '--disable-rtc-smoothness-algorithm',
62
- '--max_old_space_size=1024',
102
+ (options === null || options === void 0 ? void 0 : options.forceDeviceScaleFactor)
103
+ ? `--force-device-scale-factor=${options.forceDeviceScaleFactor}`
104
+ : null,
63
105
  ((_h = options === null || options === void 0 ? void 0 : options.chromiumOptions) === null || _h === void 0 ? void 0 : _h.ignoreCertificateErrors)
64
106
  ? '--ignore-certificate-errors'
65
107
  : null,
@@ -187,7 +187,7 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, inputProps
187
187
  return returnValue;
188
188
  };
189
189
  const renderFrames = async (options) => {
190
- var _a, _b;
190
+ var _a, _b, _c;
191
191
  const composition = getComposition(options);
192
192
  if (!composition) {
193
193
  throw new Error('No `composition` option has been specified for renderFrames()');
@@ -207,8 +207,9 @@ const renderFrames = async (options) => {
207
207
  shouldDumpIo: options.dumpBrowserLogs,
208
208
  browserExecutable: options.browserExecutable,
209
209
  chromiumOptions: options.chromiumOptions,
210
+ forceDeviceScaleFactor: (_b = options.scale) !== null && _b !== void 0 ? _b : 1,
210
211
  }));
211
- const actualParallelism = (0, get_concurrency_1.getActualConcurrency)((_b = options.parallelism) !== null && _b !== void 0 ? _b : null);
212
+ const actualParallelism = (0, get_concurrency_1.getActualConcurrency)((_c = options.parallelism) !== null && _c !== void 0 ? _c : null);
212
213
  const { stopCycling } = (0, cycle_browser_tabs_1.cycleBrowserTabs)(browserInstance, actualParallelism);
213
214
  const openedPages = [];
214
215
  return new Promise((resolve, reject) => {
@@ -68,6 +68,7 @@ const innerRenderStill = async ({ composition, quality, imageFormat = 'png', ser
68
68
  browserExecutable,
69
69
  shouldDumpIo: dumpBrowserLogs,
70
70
  chromiumOptions,
71
+ forceDeviceScaleFactor: scale !== null && scale !== void 0 ? scale : 1,
71
72
  }));
72
73
  const page = await browserInstance.newPage();
73
74
  page.setViewport({
@@ -24,9 +24,9 @@ const setPropsAndEnv = async ({ inputProps, envVariables, page, serveUrl, initia
24
24
  window.remotion_envVariables = input;
25
25
  }, [JSON.stringify(envVariables)]);
26
26
  }
27
- await page.evaluateOnNewDocument((key, value) => {
28
- window.localStorage.setItem(key, value);
29
- }, [remotion_1.Internals.INITIAL_FRAME_LOCAL_STORAGE_KEY, initialFrame]);
27
+ await page.evaluateOnNewDocument((key) => {
28
+ window.remotion_initialFrame = key;
29
+ }, [initialFrame]);
30
30
  const pageRes = await page.goto(urlToVisit);
31
31
  const status = pageRes.status();
32
32
  if (status !== 200 &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/renderer",
3
- "version": "4.0.0-oops.3+31c506229",
3
+ "version": "4.0.0-preload.13+f7b159495",
4
4
  "description": "Renderer for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,10 +20,10 @@
20
20
  "url": "https://github.com/remotion-dev/remotion/issues"
21
21
  },
22
22
  "dependencies": {
23
- "@remotion/bundler": "4.0.0-oops.3+31c506229",
23
+ "@remotion/bundler": "4.0.0-preload.13+f7b159495",
24
24
  "execa": "5.1.1",
25
25
  "puppeteer-core": "13.5.1",
26
- "remotion": "4.0.0-oops.3+31c506229",
26
+ "remotion": "4.0.0-preload.13+f7b159495",
27
27
  "serve-handler": "6.1.3",
28
28
  "source-map": "^0.8.0-beta.0"
29
29
  },
@@ -60,5 +60,5 @@
60
60
  "publishConfig": {
61
61
  "access": "public"
62
62
  },
63
- "gitHead": "31c506229ccf43f67dee263b0edce90ebbb2e22e"
63
+ "gitHead": "f7b1594951e881444050f2f9d4af8d442bbec942"
64
64
  }