@remotion/renderer 4.0.254 → 4.0.256
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.
- package/dist/browser/Browser.d.ts +23 -6
- package/dist/browser/Browser.js +22 -12
- package/dist/browser/BrowserConnector.d.ts +19 -0
- package/dist/browser/BrowserConnector.js +17 -0
- package/dist/browser/BrowserPage.d.ts +5 -2
- package/dist/browser/BrowserPage.js +4 -2
- package/dist/browser/Launcher.js +1 -1
- package/dist/browser/PuppeteerNode.d.ts +30 -0
- package/dist/browser/PuppeteerNode.js +52 -0
- package/dist/browser/Target.d.ts +7 -1
- package/dist/browser/Target.js +6 -1
- package/dist/browser/mitt/index.js +3 -3
- package/dist/browser/node.d.ts +2 -0
- package/dist/browser/node.js +5 -0
- package/dist/browser-instances.js +1 -1
- package/dist/can-use-parallel-encoding.d.ts +1 -0
- package/dist/can-use-parallel-encoding.js +9 -1
- package/dist/client.d.ts +2 -2
- package/dist/copy-to-clipboard.d.ts +2 -0
- package/dist/copy-to-clipboard.js +18 -0
- package/dist/cycle-browser-tabs.d.ts +6 -1
- package/dist/cycle-browser-tabs.js +2 -2
- package/dist/example-videos.d.ts +34 -0
- package/dist/example-videos.js +43 -0
- package/dist/get-browser-instance.d.ts +2 -1
- package/dist/get-browser-instance.js +14 -4
- package/dist/get-codec-name.d.ts +1 -1
- package/dist/get-compositions.js +1 -0
- package/dist/get-local-browser.d.ts +1 -0
- package/dist/get-local-browser.js +19 -0
- package/dist/index.d.ts +3 -3
- package/dist/make-page.d.ts +27 -0
- package/dist/make-page.js +71 -0
- package/dist/next-frame-to-render.d.ts +10 -0
- package/dist/next-frame-to-render.js +35 -0
- package/dist/open-browser.js +3 -3
- package/dist/options/gl.d.ts +1 -1
- package/dist/options/index.d.ts +2 -2
- package/dist/options/metadata.d.ts +1 -1
- package/dist/options/webhook-custom-data.d.ts +1 -1
- package/dist/pool.d.ts +7 -6
- package/dist/render-frame-and-retry-target-close.d.ts +50 -0
- package/dist/render-frame-and-retry-target-close.js +165 -0
- package/dist/render-frame-with-option-to-reject.d.ts +43 -0
- package/dist/render-frame-with-option-to-reject.js +136 -0
- package/dist/render-frame.d.ts +43 -0
- package/dist/render-frame.js +46 -0
- package/dist/render-frames.js +86 -312
- package/dist/render-partitions.d.ts +7 -0
- package/dist/render-partitions.js +50 -0
- package/dist/render-still.js +7 -2
- package/dist/replace-browser.js +1 -1
- package/dist/select-composition.js +1 -0
- package/dist/take-frame-and-compose.d.ts +22 -0
- package/dist/take-frame-and-compose.js +100 -0
- package/dist/test-gpu.js +1 -0
- package/ensure-browser.mjs +458 -514
- package/package.json +12 -12
|
@@ -50,12 +50,24 @@ export declare class HeadlessBrowser extends EventEmitter {
|
|
|
50
50
|
runner: BrowserRunner;
|
|
51
51
|
});
|
|
52
52
|
browserContexts(): BrowserContext[];
|
|
53
|
-
newPage(context
|
|
54
|
-
|
|
53
|
+
newPage({ context, logLevel, indent, pageIndex, }: {
|
|
54
|
+
context: SourceMapGetter;
|
|
55
|
+
logLevel: LogLevel;
|
|
56
|
+
indent: boolean;
|
|
57
|
+
pageIndex: number;
|
|
58
|
+
}): Promise<Page>;
|
|
59
|
+
_createPageInContext({ context, logLevel, indent, pageIndex, }: {
|
|
60
|
+
context: SourceMapGetter;
|
|
61
|
+
logLevel: LogLevel;
|
|
62
|
+
indent: boolean;
|
|
63
|
+
pageIndex: number;
|
|
64
|
+
}): Promise<Page>;
|
|
55
65
|
targets(): Target[];
|
|
56
66
|
waitForTarget(predicate: (x: Target) => boolean | Promise<boolean>, options?: WaitForTargetOptions): Promise<Target>;
|
|
57
|
-
pages(
|
|
58
|
-
close(silent
|
|
67
|
+
pages(): Promise<Page[]>;
|
|
68
|
+
close({ silent }: {
|
|
69
|
+
silent: boolean;
|
|
70
|
+
}): Promise<void>;
|
|
59
71
|
disconnect(): void;
|
|
60
72
|
}
|
|
61
73
|
export declare class BrowserContext extends EventEmitter {
|
|
@@ -65,8 +77,13 @@ export declare class BrowserContext extends EventEmitter {
|
|
|
65
77
|
waitForTarget(predicate: (x: Target) => boolean | Promise<boolean>, options?: {
|
|
66
78
|
timeout?: number;
|
|
67
79
|
}): Promise<Target>;
|
|
68
|
-
pages(
|
|
69
|
-
newPage(context
|
|
80
|
+
pages(): Promise<Page[]>;
|
|
81
|
+
newPage({ context, logLevel, indent, pageIndex, }: {
|
|
82
|
+
context: SourceMapGetter;
|
|
83
|
+
logLevel: LogLevel;
|
|
84
|
+
indent: boolean;
|
|
85
|
+
pageIndex: number;
|
|
86
|
+
}): Promise<Page>;
|
|
70
87
|
browser(): HeadlessBrowser;
|
|
71
88
|
}
|
|
72
89
|
export {};
|
package/dist/browser/Browser.js
CHANGED
|
@@ -75,10 +75,10 @@ class HeadlessBrowser extends EventEmitter_1.EventEmitter {
|
|
|
75
75
|
browserContexts() {
|
|
76
76
|
return [__classPrivateFieldGet(this, _HeadlessBrowser_defaultContext, "f"), ...Array.from(__classPrivateFieldGet(this, _HeadlessBrowser_contexts, "f").values())];
|
|
77
77
|
}
|
|
78
|
-
newPage(context, logLevel, indent) {
|
|
79
|
-
return __classPrivateFieldGet(this, _HeadlessBrowser_defaultContext, "f").newPage(context, logLevel, indent);
|
|
78
|
+
newPage({ context, logLevel, indent, pageIndex, }) {
|
|
79
|
+
return __classPrivateFieldGet(this, _HeadlessBrowser_defaultContext, "f").newPage({ context, logLevel, indent, pageIndex });
|
|
80
80
|
}
|
|
81
|
-
async _createPageInContext(context, logLevel, indent) {
|
|
81
|
+
async _createPageInContext({ context, logLevel, indent, pageIndex, }) {
|
|
82
82
|
const { value: { targetId }, } = await this.connection.send('Target.createTarget', {
|
|
83
83
|
url: 'about:blank',
|
|
84
84
|
browserContextId: undefined,
|
|
@@ -91,7 +91,12 @@ class HeadlessBrowser extends EventEmitter_1.EventEmitter {
|
|
|
91
91
|
if (!initialized) {
|
|
92
92
|
throw new Error(`Failed to create target for page (id = ${targetId})`);
|
|
93
93
|
}
|
|
94
|
-
const page = await target.page(
|
|
94
|
+
const page = await target.page({
|
|
95
|
+
sourceMapGetter: context,
|
|
96
|
+
logLevel,
|
|
97
|
+
indent,
|
|
98
|
+
pageIndex,
|
|
99
|
+
});
|
|
95
100
|
if (!page) {
|
|
96
101
|
throw new Error(`Failed to create a page for context`);
|
|
97
102
|
}
|
|
@@ -129,18 +134,18 @@ class HeadlessBrowser extends EventEmitter_1.EventEmitter {
|
|
|
129
134
|
}
|
|
130
135
|
}
|
|
131
136
|
}
|
|
132
|
-
async pages(
|
|
137
|
+
async pages() {
|
|
133
138
|
const contextPages = await Promise.all(this.browserContexts().map((context) => {
|
|
134
|
-
return context.pages(
|
|
139
|
+
return context.pages();
|
|
135
140
|
}));
|
|
136
141
|
// Flatten array.
|
|
137
142
|
return contextPages.reduce((acc, x) => {
|
|
138
143
|
return acc.concat(x);
|
|
139
144
|
}, []);
|
|
140
145
|
}
|
|
141
|
-
async close(silent
|
|
146
|
+
async close({ silent }) {
|
|
142
147
|
await this.runner.closeProcess();
|
|
143
|
-
(await this.pages(
|
|
148
|
+
(await this.pages()).forEach((page) => {
|
|
144
149
|
page.emit("disposed" /* PageEmittedEvents.Disposed */);
|
|
145
150
|
page.closed = true;
|
|
146
151
|
});
|
|
@@ -207,16 +212,21 @@ class BrowserContext extends EventEmitter_1.EventEmitter {
|
|
|
207
212
|
return target.browserContext() === this && predicate(target);
|
|
208
213
|
}, options);
|
|
209
214
|
}
|
|
210
|
-
async pages(
|
|
215
|
+
async pages() {
|
|
211
216
|
const pages = await Promise.all(this.targets()
|
|
212
217
|
.filter((target) => target.type() === 'page')
|
|
213
|
-
.map((target) => target.
|
|
218
|
+
.map((target) => target.expectPage()));
|
|
214
219
|
return pages.filter((page) => {
|
|
215
220
|
return Boolean(page);
|
|
216
221
|
});
|
|
217
222
|
}
|
|
218
|
-
newPage(context, logLevel, indent) {
|
|
219
|
-
return __classPrivateFieldGet(this, _BrowserContext_browser, "f")._createPageInContext(
|
|
223
|
+
newPage({ context, logLevel, indent, pageIndex, }) {
|
|
224
|
+
return __classPrivateFieldGet(this, _BrowserContext_browser, "f")._createPageInContext({
|
|
225
|
+
context,
|
|
226
|
+
logLevel,
|
|
227
|
+
indent,
|
|
228
|
+
pageIndex,
|
|
229
|
+
});
|
|
220
230
|
}
|
|
221
231
|
browser() {
|
|
222
232
|
return __classPrivateFieldGet(this, _BrowserContext_browser, "f");
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2020 Google Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { Viewport } from './PuppeteerViewport';
|
|
17
|
+
export interface BrowserConnectOptions {
|
|
18
|
+
defaultViewport: Viewport;
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2020 Google Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -27,7 +27,7 @@ interface PageEventObject {
|
|
|
27
27
|
export declare class Page extends EventEmitter {
|
|
28
28
|
#private;
|
|
29
29
|
id: string;
|
|
30
|
-
static _create({ client, target, defaultViewport, browser, sourceMapGetter, logLevel, indent, }: {
|
|
30
|
+
static _create({ client, target, defaultViewport, browser, sourceMapGetter, logLevel, indent, pageIndex, }: {
|
|
31
31
|
client: CDPSession;
|
|
32
32
|
target: Target;
|
|
33
33
|
defaultViewport: Viewport;
|
|
@@ -35,19 +35,22 @@ export declare class Page extends EventEmitter {
|
|
|
35
35
|
sourceMapGetter: SourceMapGetter;
|
|
36
36
|
logLevel: LogLevel;
|
|
37
37
|
indent: boolean;
|
|
38
|
+
pageIndex: number;
|
|
38
39
|
}): Promise<Page>;
|
|
39
40
|
closed: boolean;
|
|
40
41
|
browser: HeadlessBrowser;
|
|
41
42
|
screenshotTaskQueue: TaskQueue;
|
|
42
43
|
sourceMapGetter: SourceMapGetter;
|
|
43
44
|
logLevel: LogLevel;
|
|
44
|
-
|
|
45
|
+
pageIndex: number;
|
|
46
|
+
constructor({ client, target, browser, sourceMapGetter, logLevel, indent, pageIndex, }: {
|
|
45
47
|
client: CDPSession;
|
|
46
48
|
target: Target;
|
|
47
49
|
browser: HeadlessBrowser;
|
|
48
50
|
sourceMapGetter: SourceMapGetter;
|
|
49
51
|
logLevel: LogLevel;
|
|
50
52
|
indent: boolean;
|
|
53
|
+
pageIndex: number;
|
|
51
54
|
});
|
|
52
55
|
/**
|
|
53
56
|
* Listen to page events.
|
|
@@ -49,7 +49,7 @@ const shouldHideWarning = (log) => {
|
|
|
49
49
|
return false;
|
|
50
50
|
};
|
|
51
51
|
class Page extends EventEmitter_1.EventEmitter {
|
|
52
|
-
static async _create({ client, target, defaultViewport, browser, sourceMapGetter, logLevel, indent, }) {
|
|
52
|
+
static async _create({ client, target, defaultViewport, browser, sourceMapGetter, logLevel, indent, pageIndex, }) {
|
|
53
53
|
const page = new Page({
|
|
54
54
|
client,
|
|
55
55
|
target,
|
|
@@ -57,12 +57,13 @@ class Page extends EventEmitter_1.EventEmitter {
|
|
|
57
57
|
sourceMapGetter,
|
|
58
58
|
logLevel,
|
|
59
59
|
indent,
|
|
60
|
+
pageIndex,
|
|
60
61
|
});
|
|
61
62
|
await __classPrivateFieldGet(page, _Page_instances, "m", _Page_initialize).call(page);
|
|
62
63
|
await page.setViewport(defaultViewport);
|
|
63
64
|
return page;
|
|
64
65
|
}
|
|
65
|
-
constructor({ client, target, browser, sourceMapGetter, logLevel, indent, }) {
|
|
66
|
+
constructor({ client, target, browser, sourceMapGetter, logLevel, indent, pageIndex, }) {
|
|
66
67
|
super();
|
|
67
68
|
_Page_instances.add(this);
|
|
68
69
|
this.closed = false;
|
|
@@ -79,6 +80,7 @@ class Page extends EventEmitter_1.EventEmitter {
|
|
|
79
80
|
this.id = String(Math.random());
|
|
80
81
|
this.sourceMapGetter = sourceMapGetter;
|
|
81
82
|
this.logLevel = logLevel;
|
|
83
|
+
this.pageIndex = pageIndex;
|
|
82
84
|
client.on('Target.attachedToTarget', (event) => {
|
|
83
85
|
switch (event.targetInfo.type) {
|
|
84
86
|
case 'iframe':
|
package/dist/browser/Launcher.js
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2020 Google Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { HeadlessBrowser } from './Browser';
|
|
17
|
+
import type { BrowserConnectOptions } from './BrowserConnector';
|
|
18
|
+
import type { ProductLauncher } from './Launcher';
|
|
19
|
+
import type { BrowserLaunchArgumentOptions, LaunchOptions } from './LaunchOptions';
|
|
20
|
+
interface PuppeteerLaunchOptions extends LaunchOptions, BrowserLaunchArgumentOptions, BrowserConnectOptions {
|
|
21
|
+
extraPrefsFirefox?: Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
export declare class PuppeteerNode {
|
|
24
|
+
#private;
|
|
25
|
+
constructor();
|
|
26
|
+
launch(options: PuppeteerLaunchOptions): Promise<HeadlessBrowser>;
|
|
27
|
+
executablePath(channel?: string): string;
|
|
28
|
+
get _launcher(): ProductLauncher;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2020 Google Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
18
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
19
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
20
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
21
|
+
};
|
|
22
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
23
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
24
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
25
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
26
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
27
|
+
};
|
|
28
|
+
var _PuppeteerNode_lazyLauncher;
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.PuppeteerNode = void 0;
|
|
31
|
+
const Launcher_1 = require("./Launcher");
|
|
32
|
+
class PuppeteerNode {
|
|
33
|
+
constructor() {
|
|
34
|
+
_PuppeteerNode_lazyLauncher.set(this, void 0);
|
|
35
|
+
this.launch = this.launch.bind(this);
|
|
36
|
+
this.executablePath = this.executablePath.bind(this);
|
|
37
|
+
}
|
|
38
|
+
launch(options) {
|
|
39
|
+
return this._launcher.launch(options);
|
|
40
|
+
}
|
|
41
|
+
executablePath(channel) {
|
|
42
|
+
return this._launcher.executablePath(channel);
|
|
43
|
+
}
|
|
44
|
+
get _launcher() {
|
|
45
|
+
if (!__classPrivateFieldGet(this, _PuppeteerNode_lazyLauncher, "f")) {
|
|
46
|
+
__classPrivateFieldSet(this, _PuppeteerNode_lazyLauncher, new Launcher_1.ChromeLauncher(), "f");
|
|
47
|
+
}
|
|
48
|
+
return __classPrivateFieldGet(this, _PuppeteerNode_lazyLauncher, "f");
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.PuppeteerNode = PuppeteerNode;
|
|
52
|
+
_PuppeteerNode_lazyLauncher = new WeakMap();
|
package/dist/browser/Target.d.ts
CHANGED
|
@@ -37,7 +37,13 @@ export declare class Target {
|
|
|
37
37
|
/**
|
|
38
38
|
* If the target is not of type `"page"` or `"background_page"`, returns `null`.
|
|
39
39
|
*/
|
|
40
|
-
page(sourceMapGetter
|
|
40
|
+
page({ sourceMapGetter, logLevel, indent, pageIndex, }: {
|
|
41
|
+
sourceMapGetter: SourceMapGetter;
|
|
42
|
+
logLevel: LogLevel;
|
|
43
|
+
indent: boolean;
|
|
44
|
+
pageIndex: number;
|
|
45
|
+
}): Promise<Page | null>;
|
|
46
|
+
expectPage(): Promise<Page | null>;
|
|
41
47
|
url(): string;
|
|
42
48
|
/**
|
|
43
49
|
* Identifies what kind of target this is.
|
package/dist/browser/Target.js
CHANGED
|
@@ -79,7 +79,7 @@ class Target {
|
|
|
79
79
|
/**
|
|
80
80
|
* If the target is not of type `"page"` or `"background_page"`, returns `null`.
|
|
81
81
|
*/
|
|
82
|
-
async page(sourceMapGetter, logLevel, indent) {
|
|
82
|
+
async page({ sourceMapGetter, logLevel, indent, pageIndex, }) {
|
|
83
83
|
var _a;
|
|
84
84
|
if (isPagetTarget(__classPrivateFieldGet(this, _Target_targetInfo, "f")) && !__classPrivateFieldGet(this, _Target_pagePromise, "f")) {
|
|
85
85
|
__classPrivateFieldSet(this, _Target_pagePromise, __classPrivateFieldGet(this, _Target_sessionFactory, "f").call(this).then((client) => {
|
|
@@ -92,11 +92,16 @@ class Target {
|
|
|
92
92
|
sourceMapGetter,
|
|
93
93
|
logLevel,
|
|
94
94
|
indent,
|
|
95
|
+
pageIndex,
|
|
95
96
|
});
|
|
96
97
|
}), "f");
|
|
97
98
|
}
|
|
98
99
|
return (_a = (await __classPrivateFieldGet(this, _Target_pagePromise, "f"))) !== null && _a !== void 0 ? _a : null;
|
|
99
100
|
}
|
|
101
|
+
async expectPage() {
|
|
102
|
+
var _a;
|
|
103
|
+
return (_a = (await __classPrivateFieldGet(this, _Target_pagePromise, "f"))) !== null && _a !== void 0 ? _a : null;
|
|
104
|
+
}
|
|
100
105
|
url() {
|
|
101
106
|
return __classPrivateFieldGet(this, _Target_targetInfo, "f").url;
|
|
102
107
|
}
|
|
@@ -19,21 +19,21 @@ function mitt(all) {
|
|
|
19
19
|
* @param {Function} handler Function to call in response to given event
|
|
20
20
|
* @memberOf mitt
|
|
21
21
|
*/
|
|
22
|
-
on(type, handler) {
|
|
22
|
+
on: (type, handler) => {
|
|
23
23
|
const handlers = all === null || all === void 0 ? void 0 : all.get(type);
|
|
24
24
|
const added = handlers === null || handlers === void 0 ? void 0 : handlers.push(handler);
|
|
25
25
|
if (!added) {
|
|
26
26
|
all === null || all === void 0 ? void 0 : all.set(type, [handler]);
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
|
-
off(type, handler) {
|
|
29
|
+
off: (type, handler) => {
|
|
30
30
|
const handlers = all === null || all === void 0 ? void 0 : all.get(type);
|
|
31
31
|
if (handlers) {
|
|
32
32
|
// eslint-disable-next-line no-bitwise
|
|
33
33
|
handlers.splice(handlers.indexOf(handler) >>> 0, 1);
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
emit(type, evt) {
|
|
36
|
+
emit: (type, evt) => {
|
|
37
37
|
((all === null || all === void 0 ? void 0 : all.get(type)) || [])
|
|
38
38
|
.slice()
|
|
39
39
|
.forEach((handler) => {
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.canUseParallelEncoding = void 0;
|
|
3
|
+
exports.getShouldUsePartitionedRendering = exports.canUseParallelEncoding = void 0;
|
|
4
4
|
const is_audio_codec_1 = require("./is-audio-codec");
|
|
5
5
|
const canUseParallelEncoding = (codec) => {
|
|
6
|
+
if ((0, exports.getShouldUsePartitionedRendering)()) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
6
9
|
if ((0, is_audio_codec_1.isAudioCodec)(codec)) {
|
|
7
10
|
return false;
|
|
8
11
|
}
|
|
9
12
|
return codec === 'h264' || codec === 'h264-mkv' || codec === 'h265';
|
|
10
13
|
};
|
|
11
14
|
exports.canUseParallelEncoding = canUseParallelEncoding;
|
|
15
|
+
const getShouldUsePartitionedRendering = () => {
|
|
16
|
+
const shouldUsePartitionedRendering = process.env.REMOTION_PARTITIONED_RENDERING === 'true';
|
|
17
|
+
return shouldUsePartitionedRendering;
|
|
18
|
+
};
|
|
19
|
+
exports.getShouldUsePartitionedRendering = getShouldUsePartitionedRendering;
|
package/dist/client.d.ts
CHANGED
|
@@ -394,7 +394,7 @@ export declare const BrowserSafeApis: {
|
|
|
394
394
|
webhookCustomDataOption: {
|
|
395
395
|
name: string;
|
|
396
396
|
cliFlag: "webhook-custom-data";
|
|
397
|
-
description: (type: "
|
|
397
|
+
description: (type: "cli" | "ssr") => import("react/jsx-runtime").JSX.Element;
|
|
398
398
|
ssrName: "customData";
|
|
399
399
|
docLink: string;
|
|
400
400
|
type: Record<string, unknown> | null;
|
|
@@ -807,7 +807,7 @@ export declare const BrowserSafeApis: {
|
|
|
807
807
|
metadataOption: {
|
|
808
808
|
name: string;
|
|
809
809
|
cliFlag: "metadata";
|
|
810
|
-
description: (mode: "
|
|
810
|
+
description: (mode: "cli" | "ssr") => import("react/jsx-runtime").JSX.Element;
|
|
811
811
|
docLink: string;
|
|
812
812
|
type: import("./options/metadata").Metadata;
|
|
813
813
|
getValue: ({ commandLine }: {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.copyImageToClipboard = void 0;
|
|
4
|
+
const compositor_1 = require("./compositor/compositor");
|
|
5
|
+
const copyImageToClipboard = async (src, logLevel, binariesDirectory) => {
|
|
6
|
+
const compositor = (0, compositor_1.startLongRunningCompositor)({
|
|
7
|
+
maximumFrameCacheItemsInBytes: null,
|
|
8
|
+
logLevel,
|
|
9
|
+
indent: false,
|
|
10
|
+
binariesDirectory,
|
|
11
|
+
});
|
|
12
|
+
await compositor.executeCommand('CopyImageToClipboard', {
|
|
13
|
+
src,
|
|
14
|
+
});
|
|
15
|
+
await compositor.finishCommands();
|
|
16
|
+
await compositor.waitForDone();
|
|
17
|
+
};
|
|
18
|
+
exports.copyImageToClipboard = copyImageToClipboard;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { LogLevel } from './log-level';
|
|
2
2
|
import type { BrowserReplacer } from './replace-browser';
|
|
3
|
-
export declare const cycleBrowserTabs: (puppeteerInstance
|
|
3
|
+
export declare const cycleBrowserTabs: ({ puppeteerInstance, concurrency, logLevel, indent, }: {
|
|
4
|
+
puppeteerInstance: BrowserReplacer;
|
|
5
|
+
concurrency: number;
|
|
6
|
+
logLevel: LogLevel;
|
|
7
|
+
indent: boolean;
|
|
8
|
+
}) => {
|
|
4
9
|
stopCycling: () => void;
|
|
5
10
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.cycleBrowserTabs = void 0;
|
|
4
4
|
const logger_1 = require("./logger");
|
|
5
|
-
const cycleBrowserTabs = (puppeteerInstance, concurrency, logLevel, indent) => {
|
|
5
|
+
const cycleBrowserTabs = ({ puppeteerInstance, concurrency, logLevel, indent, }) => {
|
|
6
6
|
if (concurrency <= 1) {
|
|
7
7
|
return {
|
|
8
8
|
stopCycling: () => undefined,
|
|
@@ -15,7 +15,7 @@ const cycleBrowserTabs = (puppeteerInstance, concurrency, logLevel, indent) => {
|
|
|
15
15
|
interval = setTimeout(() => {
|
|
16
16
|
puppeteerInstance
|
|
17
17
|
.getBrowser()
|
|
18
|
-
.pages(
|
|
18
|
+
.pages()
|
|
19
19
|
.then((pages) => {
|
|
20
20
|
if (pages.length === 0) {
|
|
21
21
|
return;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const exampleVideos: {
|
|
2
|
+
bigBuckBunny: string;
|
|
3
|
+
transparentWebm: string;
|
|
4
|
+
framerWithoutFileExtension: string;
|
|
5
|
+
corrupted: string;
|
|
6
|
+
customDar: string;
|
|
7
|
+
screenrecording: string;
|
|
8
|
+
nofps: string;
|
|
9
|
+
variablefps: string;
|
|
10
|
+
zerotimestamp: string;
|
|
11
|
+
webcam: string;
|
|
12
|
+
iphonevideo: string;
|
|
13
|
+
av1: string;
|
|
14
|
+
framer24fps: string;
|
|
15
|
+
music: string;
|
|
16
|
+
notavideo: string;
|
|
17
|
+
notafile: string;
|
|
18
|
+
transparentwithdar: string;
|
|
19
|
+
prores: string;
|
|
20
|
+
iphonehevc: string;
|
|
21
|
+
matroskaPcm16: string;
|
|
22
|
+
mp4withmp3: string;
|
|
23
|
+
av1bbb: string;
|
|
24
|
+
av1mp4: string;
|
|
25
|
+
av1mp4WithColr: string;
|
|
26
|
+
vp8Vorbis: string;
|
|
27
|
+
vp9: string;
|
|
28
|
+
stretchedVp8: string;
|
|
29
|
+
matroskaMp3: string;
|
|
30
|
+
matroskaH265Aac: string;
|
|
31
|
+
opusWebm: string;
|
|
32
|
+
avi: string;
|
|
33
|
+
opus51Webm: string;
|
|
34
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
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.exampleVideos = void 0;
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
+
const examplePackage = node_path_1.default.join(__dirname, '..', '..', 'example');
|
|
9
|
+
const docsPackage = node_path_1.default.join(__dirname, '..', '..', 'docs');
|
|
10
|
+
exports.exampleVideos = {
|
|
11
|
+
bigBuckBunny: node_path_1.default.join(examplePackage, 'public/bigbuckbunny.mp4'),
|
|
12
|
+
transparentWebm: node_path_1.default.join(docsPackage, '/static/img/transparent-video.webm'),
|
|
13
|
+
framerWithoutFileExtension: node_path_1.default.join(examplePackage, 'public', 'framermp4withoutfileextension'),
|
|
14
|
+
corrupted: node_path_1.default.join(examplePackage, 'public', 'corrupted.mp4'),
|
|
15
|
+
customDar: node_path_1.default.join(examplePackage, 'public', 'custom-dar.mp4'),
|
|
16
|
+
screenrecording: node_path_1.default.join(examplePackage, 'public', 'quick.mov'),
|
|
17
|
+
nofps: node_path_1.default.join(examplePackage, 'public', 'nofps.webm'),
|
|
18
|
+
variablefps: node_path_1.default.join(examplePackage, 'public', 'variablefps.webm'),
|
|
19
|
+
zerotimestamp: node_path_1.default.join(examplePackage, 'public', 'zero-timestamp.mp4'),
|
|
20
|
+
webcam: node_path_1.default.join(examplePackage, 'public', 'webcam.webm'),
|
|
21
|
+
iphonevideo: node_path_1.default.join(examplePackage, 'public', 'iphonevideo.mov'),
|
|
22
|
+
av1: node_path_1.default.join(examplePackage, 'public', 'av1.webm'),
|
|
23
|
+
framer24fps: node_path_1.default.join(examplePackage, 'src', 'resources', 'framer-24fps.mp4'),
|
|
24
|
+
music: node_path_1.default.join(examplePackage, 'public', 'music.mp3'),
|
|
25
|
+
notavideo: node_path_1.default.join(examplePackage, 'public', 'giphy.gif'),
|
|
26
|
+
notafile: node_path_1.default.join(examplePackage, 'public', 'doesnotexist'),
|
|
27
|
+
transparentwithdar: node_path_1.default.join(examplePackage, 'public', 'transparent-with-dar.webm'),
|
|
28
|
+
prores: node_path_1.default.join(examplePackage, 'public', 'prores.mov'),
|
|
29
|
+
iphonehevc: node_path_1.default.join(examplePackage, 'public', 'iphone-hevc.mov'),
|
|
30
|
+
matroskaPcm16: node_path_1.default.join(examplePackage, 'public', 'matroska-pcm16.mkv'),
|
|
31
|
+
mp4withmp3: node_path_1.default.join(examplePackage, 'public', 'mp4-mp3.mp4'),
|
|
32
|
+
av1bbb: node_path_1.default.join(examplePackage, 'public', 'av1-bbb.webm'),
|
|
33
|
+
av1mp4: node_path_1.default.join(examplePackage, 'public', 'av1-bbb.mp4'),
|
|
34
|
+
av1mp4WithColr: node_path_1.default.join(examplePackage, 'public', 'av1.mp4'),
|
|
35
|
+
vp8Vorbis: node_path_1.default.join(examplePackage, 'public', 'vp8-vorbis.webm'),
|
|
36
|
+
vp9: node_path_1.default.join(examplePackage, 'public', 'vp9.webm'),
|
|
37
|
+
stretchedVp8: node_path_1.default.join(examplePackage, 'public', 'stretched-vp8.webm'),
|
|
38
|
+
matroskaMp3: node_path_1.default.join(examplePackage, 'public', 'matroska-mp3.mkv'),
|
|
39
|
+
matroskaH265Aac: node_path_1.default.join(examplePackage, 'public', 'matroska-h265-aac.mkv'),
|
|
40
|
+
opusWebm: node_path_1.default.join(examplePackage, 'public', 'opus.webm'),
|
|
41
|
+
avi: node_path_1.default.join(examplePackage, 'public', 'example.avi'),
|
|
42
|
+
opus51Webm: node_path_1.default.join(examplePackage, 'public', 'vp8-opus-5-1-channels.webm'),
|
|
43
|
+
};
|
|
@@ -5,7 +5,7 @@ import type { LogLevel } from './log-level';
|
|
|
5
5
|
import type { ChromiumOptions } from './open-browser';
|
|
6
6
|
import type { ChromeMode } from './options/chrome-mode';
|
|
7
7
|
import type { OnBrowserDownload } from './options/on-browser-download';
|
|
8
|
-
export declare const getPageAndCleanupFn: ({ passedInInstance, browserExecutable, chromiumOptions, forceDeviceScaleFactor, indent, logLevel, onBrowserDownload, chromeMode, }: {
|
|
8
|
+
export declare const getPageAndCleanupFn: ({ passedInInstance, browserExecutable, chromiumOptions, forceDeviceScaleFactor, indent, logLevel, onBrowserDownload, chromeMode, pageIndex, }: {
|
|
9
9
|
passedInInstance: HeadlessBrowser | undefined;
|
|
10
10
|
browserExecutable: BrowserExecutable | null;
|
|
11
11
|
chromiumOptions: ChromiumOptions;
|
|
@@ -14,6 +14,7 @@ export declare const getPageAndCleanupFn: ({ passedInInstance, browserExecutable
|
|
|
14
14
|
logLevel: LogLevel;
|
|
15
15
|
onBrowserDownload: OnBrowserDownload;
|
|
16
16
|
chromeMode: ChromeMode;
|
|
17
|
+
pageIndex: number;
|
|
17
18
|
}) => Promise<{
|
|
18
19
|
cleanupPage: () => Promise<void>;
|
|
19
20
|
page: Page;
|
|
@@ -4,9 +4,14 @@ exports.getPageAndCleanupFn = void 0;
|
|
|
4
4
|
const browser_1 = require("./browser");
|
|
5
5
|
const logger_1 = require("./logger");
|
|
6
6
|
const open_browser_1 = require("./open-browser");
|
|
7
|
-
const getPageAndCleanupFn = async ({ passedInInstance, browserExecutable, chromiumOptions, forceDeviceScaleFactor, indent, logLevel, onBrowserDownload, chromeMode, }) => {
|
|
7
|
+
const getPageAndCleanupFn = async ({ passedInInstance, browserExecutable, chromiumOptions, forceDeviceScaleFactor, indent, logLevel, onBrowserDownload, chromeMode, pageIndex, }) => {
|
|
8
8
|
if (passedInInstance) {
|
|
9
|
-
const page = await passedInInstance.newPage(
|
|
9
|
+
const page = await passedInInstance.newPage({
|
|
10
|
+
context: () => null,
|
|
11
|
+
logLevel,
|
|
12
|
+
indent,
|
|
13
|
+
pageIndex,
|
|
14
|
+
});
|
|
10
15
|
return {
|
|
11
16
|
page,
|
|
12
17
|
cleanupPage: () => {
|
|
@@ -32,12 +37,17 @@ const getPageAndCleanupFn = async ({ passedInInstance, browserExecutable, chromi
|
|
|
32
37
|
onBrowserDownload,
|
|
33
38
|
chromeMode,
|
|
34
39
|
});
|
|
35
|
-
const browserPage = await browserInstance.newPage(
|
|
40
|
+
const browserPage = await browserInstance.newPage({
|
|
41
|
+
context: () => null,
|
|
42
|
+
logLevel,
|
|
43
|
+
indent,
|
|
44
|
+
pageIndex,
|
|
45
|
+
});
|
|
36
46
|
return {
|
|
37
47
|
page: browserPage,
|
|
38
48
|
cleanupPage: () => {
|
|
39
49
|
// Close whole browser that was just created and don't wait for it to finish.
|
|
40
|
-
browserInstance.close(true
|
|
50
|
+
browserInstance.close({ silent: true }).catch((err) => {
|
|
41
51
|
if (!err.message.includes('Target closed')) {
|
|
42
52
|
logger_1.Log.error({ indent, logLevel }, 'Was not able to close puppeteer page', err);
|
|
43
53
|
}
|