wip arrière plan vidéo
This commit is contained in:
Executable
+26
@@ -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()
|
||||
Reference in New Issue
Block a user