1 Commits

Author SHA1 Message Date
epickiwi c4538c77fc wip arrière plan vidéo 2026-04-07 09:20:29 +02:00
4 changed files with 89 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
node_modules
+56
View File
@@ -0,0 +1,56 @@
{
"name": "background-video",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"dependencies": {
"playwright": "^1.59.1"
}
},
"node_modules/fsevents": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
"hasInstallScript": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/playwright": {
"version": "1.59.1",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.59.1.tgz",
"integrity": "sha512-C8oWjPR3F81yljW9o5OxcWzfh6avkVwDD2VYdwIGqTkl+OGFISgypqzfu7dOe4QNLL2aqcWBmI3PMtLIK233lw==",
"license": "Apache-2.0",
"dependencies": {
"playwright-core": "1.59.1"
},
"bin": {
"playwright": "cli.js"
},
"engines": {
"node": ">=18"
},
"optionalDependencies": {
"fsevents": "2.3.2"
}
},
"node_modules/playwright-core": {
"version": "1.59.1",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.59.1.tgz",
"integrity": "sha512-HBV/RJg81z5BiiZ9yPzIiClYV/QMsDCKUyogwH9p3MCP6IYjUFu/MActgYAvK0oWyV9NlwM3GLBjADyWgydVyg==",
"license": "Apache-2.0",
"bin": {
"playwright-core": "cli.js"
},
"engines": {
"node": ">=18"
}
}
}
}
+6
View File
@@ -0,0 +1,6 @@
{
"dependencies": {
"playwright": "^1.59.1"
},
"type": "module"
}
+26
View File
@@ -0,0 +1,26 @@
#!/bin/env node
import {firefox} from "playwright"
const SCREENCAST_DURATION = 10000
const SCREEN_SIZE = {width: 1920, height: 1080}
const browser = await firefox.launch()
const page = await browser.newPage()
await page.setViewportSize(SCREEN_SIZE)
await page.goto("http://localhost:8080/")
await page.evaluate(() => document.getElementById("app").style.display = "none")
await page.screenshot({path: "screenshot.png"})
await page.screencast.start({
onFrame: (data) => {
console.log('received frame', data);
},
quality: 100,
size: SCREEN_SIZE
})
await new Promise((res) => setTimeout(res, SCREENCAST_DURATION))
await page.screencast.stop()
await browser.close()