openBrowser()
Available since v3.0 - Part of the @remotion/renderer
package.
Opens a Chrome or Chromium browser instance. By reusing an instance across renderFrames()
, renderStill()
, renderMedia()
and getCompositions()
calls, you can save time by not opening and closing browsers for each call.
ts
const openBrowser: (browser: Browser,options: {shouldDumpIo?: boolean;browserExecutable?: string | null;chromiumOptions?: ChromiumOptions;},) => Promise<puppeteer.Browser>;
Arguments
browser
Currently the only valid option is "chrome"
. This field is reserved for future compatibility with other browsers.
options?
optional
An object containing one or more of the following options:
shouldDumpIo?
shouldDumpIo?
optional, deprecated since v4.0.189, scheduled for removal in v5.0
If set to true
, logs and other browser diagnostics are being printed to standard output. This setting is useful for debugging.
Will be removed in 5.0: Use logLevel
instead.
logLevel?
v4.0.189
optional
One oftrace
, verbose
, info
, warn
, error
.Determines how much info is being logged to the console.
Default
info
.
browserExecutable?
optional
A string defining the absolute path on disk of the browser executable that should be used. By default Remotion will try to detect it automatically and download one if none is available. If puppeteerInstance
is defined, it will take precedence over browserExecutable
.
chromiumOptions?
optional
Allows you to set certain Chromium / Google Chrome flags. See: Chromium flags.
Chromium flags need to be set at browser launch. If you pass an instance to SSR APIs like renderMedia()
, the chromiumOptions
option of that API will not apply, but rather the flags that have been passed to openBrowser()
.
forceDeviceScaleFactor?
Set a scale. If you plan to use scaling, you already need to set it when opening the browser.
onBrowserDownload?
v4.0.137
Gets called when no compatible local browser is detected on the system and this API needs to download a browser. Return a callback to observe progress. See here for how to use this option.
chromeMode?
v4.0.248
One of headless-shell,
chrome-for-testing
. Default headless-shell
. Use chrome-for-testing
to take advantage of GPU drivers on Linux.