I need to automate screenshots of HTML 5 video player pages and their thumbnails, but after looking at some of the more popular headless browsers like PhantomJS they don't support HTML 5 video.
>phantomjs examples\features.js
Detected features (using Modernizr 2.0.6):
Supported:
touch
generatedcontent
fontface
flexbox
canvas
canvastext
postmessage
websqldatabase
hashchange
history
draganddrop
websockets
rgba
hsla
multiplebgs
backgroundsize
borderimage
borderradius
boxshadow
textshadow
opacity
cssanimations
csscolumns
cssgradients
cssreflections
csstransforms
csstransitions
localstorage
sessionstorage
webworkers
applicationcache
svg
inlinesvg
smil
svgclippaths
Not supported:
csstransforms3d
webgl
geolocation
indexeddb
video
audio
Note that HTML 5 video is not supported above, what lightweight headless browser DOES support HTML 5 video?
There is a solution but it is not ightweight.(It is pretty fast though) Now you can run Firefox with headless option. Here some code how to do it with Selenium.
options = new FirefoxOptions();
options.addArguments("--headless"); // This will make Firefox to run in headless mode.
System.setProperty("webdriver.gecko.driver", "lib/firefox/geckodriver.exe");
FirefoxProfile profile = new FirefoxProfile();
FirefoxBinary binary = new FirefoxBinary(new File("lib/firefox/firefox.exe"));
options.setBinary(binary);
options.setProfile(profile);
driver = new FirefoxDriver(options);
or you can Build PanthomJS to support HTML5. Follow this, https://github.com/ariya/phantomjs/issues/10839#issuecomment-331457673
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With