Skip to content

🎥 Make videos programmatically with React

add documentation for openBrowser()

Jonny Burger898ab577dd31
diff --git a/packages/docs/docs/get-compositions.md b/packages/docs/docs/get-compositions.md
index 91bb1a1a5a..89103fecd0 100644
--- a/packages/docs/docs/get-compositions.md
+++ b/packages/docs/docs/get-compositions.md
@@ -43,7 +43,7 @@ Define custom props that can be retrieved using [`getInputProps()`](/docs/get-in
_optional - available since v3.0.0_
-An already open Puppeteer [`Browser`](https://pptr.dev/#?product=Puppeteer&version=main&show=api-class-browser) instance. Reusing a browser across multiple function calls can speed up the rendering process. You are responsible for opening and closing the browser yourself. If you don't specify this option, a new browser will be opened and closed at the end.
+An already open Puppeteer [`Browser`](https://pptr.dev/#?product=Puppeteer&version=main&show=api-class-browser) instance. Use [`openBrowser()`](/docs/renderer/open-browser) to create a new instance. Reusing a browser across multiple function calls can speed up the rendering process. You are responsible for opening and closing the browser yourself. If you don't specify this option, a new browser will be opened and closed at the end.
#### `browserExecutable?`
diff --git a/packages/docs/docs/open-browser.md b/packages/docs/docs/open-browser.md
new file mode 100644
index 0000000000..8ba83a5381
--- /dev/null
+++ b/packages/docs/docs/open-browser.md
@@ -0,0 +1,47 @@
+---
+title: openBrowser()
+id: open-browser
+slug: /renderer/open-browser
+---
+
+_Available since v3.0 - Part of the `@remotion/renderer` package._
+
+Opens a Chrome or Chromium browser instance. By reusing an instance across [`renderFrames()`](/docs/renderer/render-frames), [`renderStill()`](/docs/renderer/render-still) and [`getCompositions()`](/docs/get-compositions) calls
+
+```ts
+const openBrowser: (
+ browser: Browser,
+ options: {
+ shouldDumpIo?: boolean;
+ browserExecutable?: BrowserExecutable;
+ }
+) => 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?`
+
+_optional_
+
+If set to `true`, logs and other browser diagnostics are being printed to standard output. This setting is useful for debugging.
+
+#### `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`.
+
+## See also
+
+- [Server-Side rendering](/docs/ssr)
diff --git a/packages/docs/docs/render-frames.md b/packages/docs/docs/render-frames.md
index 0d666f3208..30774f14d6 100644
--- a/packages/docs/docs/render-frames.md
+++ b/packages/docs/docs/render-frames.md
@@ -117,7 +117,7 @@ Passes the `dumpio` flag to Puppeteer which will log all browser logs to the con
_optional_
-An already open Puppeteer [`Browser`](https://pptr.dev/#?product=Puppeteer&version=main&show=api-class-browser) instance. Reusing a browser across multiple function calls can speed up the rendering process. You are responsible for opening and closing the browser yourself. If you don't specify this option, a new browser will be opened and closed at the end.
+An already open Puppeteer [`Browser`](https://pptr.dev/#?product=Puppeteer&version=main&show=api-class-browser) instance. Use [`openBrowser()`](/docs/renderer/open-browser) to create a new instance. Reusing a browser across multiple function calls can speed up the rendering process. You are responsible for opening and closing the browser yourself. If you don't specify this option, a new browser will be opened and closed at the end.
### `envVariables?`
diff --git a/packages/docs/docs/render-media.md b/packages/docs/docs/render-media.md
index bcf18c8f6e..419e4ced47 100644
--- a/packages/docs/docs/render-media.md
+++ b/packages/docs/docs/render-media.md
@@ -112,7 +112,7 @@ Specify a single frame (passing a `number`) or a range of frames (passing a tupl
_puppeteer.Browser - optional_
-An already opened browser. You can open a browser beforehand and share it between function calls that accept the `puppeteerInstance` property, making operations faster by not having to launch and quit browsers for each function call.
+An already open Puppeteer [`Browser`](https://pptr.dev/#?product=Puppeteer&version=main&show=api-class-browser) instance. Use [`openBrowser()`](/docs/renderer/open-browser) to create a new instance. Reusing a browser across multiple function calls can speed up the rendering process. You are responsible for opening and closing the browser yourself. If you don't specify this option, a new browser will be opened and closed at the end.
### `overwrite`
diff --git a/packages/docs/docs/render-still.md b/packages/docs/docs/render-still.md
index ce9386771a..f15c553fb5 100644
--- a/packages/docs/docs/render-still.md
+++ b/packages/docs/docs/render-still.md
@@ -116,7 +116,7 @@ Whether the file should be overwritten if the output already exists.
_optional, available from v2.3.1_
-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`.
+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.
## Return value
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index 6ea7c9f038..372eab52ae 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -11,11 +11,19 @@ module.exports = {
href: "#",
},
"renderer",
- "get-compositions",
- "render-media",
- "render-frames",
- "render-still",
- "stitch-frames-to-video",
+ {
+ collapsed: false,
+ type: "category",
+ label: "Node.JS APIs",
+ items: [
+ "get-compositions",
+ "render-media",
+ "render-frames",
+ "render-still",
+ "open-browser",
+ "stitch-frames-to-video",
+ ],
+ },
],
playerSidebar: [
{