Which headless browser works with HTML5 video elements?

I’m trying to capture screenshots of web pages that contain HTML5 video players. I need to get both the video content and thumbnail images automatically. I tested PhantomJS but it doesn’t handle HTML5 video properly.

// Testing video support with headless browser
const browser = require('my-headless-browser');
const page = browser.createPage();

page.open('http://example.com/video-page', function(status) {
    const videoElement = page.evaluate(function() {
        return document.querySelector('video');
    });
    
    if (videoElement) {
        console.log('Video found:', videoElement.src);
        page.render('screenshot.png');
    } else {
        console.log('No video element detected');
    }
});

When I check browser capabilities, video support shows as missing. Are there any other headless browsers that actually work with HTML5 video tags? I need something that can render video elements properly for my automation script.

selenium + chrome driver is epic for html5 vids. i tested it on streaming sites, and it plays nice with everything. just tweak the chrome options for media playback and you’re good. honestly way better than phantomjs was back in the day.

I’ve been using Chrome headless for HTML5 video since PhantomJS died. Puppeteer controls headless Chrome and handles video way better than the old tools. I capture screenshots of video players using --allow-running-insecure-content and --disable-web-security flags when I need them. Chrome actually supports the full HTML5 spec with all the video codecs, which makes a huge difference. Just watch out - video thumbnails won’t show up right away if the metadata hasn’t loaded yet. Wait for the loadedmetadata event before screenshotting. Firefox headless works too if Chrome gives you codec problems.

Playwright’s been my go-to for video automation. It handles HTML5 videos across Chrome, Firefox, and Safari without the codec headaches I used to deal with. Video support works great right out of the box - no extra flags needed like with raw Chrome headless. What really helped me was adding a wait condition for the video’s readyState before taking screenshots. Your code looks good but check if the video’s actually loaded its first frame. Playwright also lets you control video elements programmatically, which is super handy for grabbing specific frames or testing player features.