Skip to content

createAssets

createAssets<T>(assetsMap): Assets<T>

Defined in: asset.ts:90

Creates a set of typed asset controllers, one per key in the map.

Calling a controller marks the asset in the recording timeline. The renderer places the asset at that point and plays it for its natural duration.

T extends Record<string, AssetConfig>

{ [K in string | number | symbol]: T[K] }

Assets<T>

const assets = createAssets({
logo: { path: './logo.png', audio: 0, fullScreen: false },
intro: { path: './intro.mp4', audio: 1.0, fullScreen: true },
})
video('Product demo', async ({ page }) => {
await assets.intro()
await page.goto('/dashboard')
await assets.logo()
})