Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Headless browser that supports HTML 5 video?

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?

like image 469
user3813948 Avatar asked Nov 10 '15 04:11

user3813948


1 Answers

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

like image 75
Lalith J. Avatar answered Oct 06 '22 14:10

Lalith J.