Capturing website with webgl-canvas only captures initial angle
ollejj opened this issue · 4 comments
When using the "captureWebsite.file" function on a page with a 360-degree panorama image on a webgl-canvas is only screenshotting the initial 'angle'.
No matter what angle i position the panorama in, it will always generate the output from the same angle.
Try using some of the options to delay the capture.
I did, but it's like your API reads the page before any user-update no matter what.
(No critisism btw, I like this API)
These are the steps:
- My page loads
- An async function loads properties from an XML-file
- The cameras Pan/Tilt are predefined in this XML
- I manually pan to a random angle
- I run the code with 'node capture.js'
- I get the output.png
capture.js
const captureWebsite = require('capture-website');
(() => {
captureWebsite.file('http://localhost:61828/ayeW2Mw6/index.html', 'screenshot.png', {
delay: 10
});
})();
Solved it by some quirky method.
For any future readers that are experiencing the same issue:
I had an XML that stored the start-angle of the camera. Changing these angles (pan/tilt) and then screenshotting
will grab the graphics at that specific angle.
My solution:
- Before screenshotting, send the angle that you want to screenshot to backend.
- Update the hard-coded angles in the file that you're storing them in to the new ones.
- Grab the screenshot.
However the weird thing about this (maybe @sindresorhus can answer this) is that this library doesn't read from the XML at all. So I have NO idea why this worked.