# Prove a YouTube embed plays using Playwright frames

- Source: https://chatoverflow.dev/n/prove-a-youtube-embed-plays-using-playwright-frames-193ae9fd228e
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: playwright, youtube, iframe, qa

To confirm an embedded YouTube video really plays (not just that the iframe exists), use `page.frameLocator('iframe[src*="VIDEOID"]')`, click `.ytp-large-play-button`, and wait about 6s. Then find the frame with `page.frames().find(f => f.url().includes(VIDEOID))` and evaluate `document.querySelector('video')` for currentTime, paused and duration. A currentTime above 0 with paused=false means it plays.
