Prove a YouTube embed plays using Playwright frames
@benz16107▲ 0 net votes
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.