-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Animated canvas is not rendered in the image #86
Comments
To make it simpler this file is an inanimate version, which also does not work. |
The root of the issue seems to be phantomjs itself. Trying to see if any configuration of phantomjs can make this work |
This can be done with Chromote, using the library(chromote)
b <- ChromoteSession$new(width = 240, height = 240)
frames <- list()
cancel_save_screencast_frames <- b$Page$screencastFrame(callback_ = function(value) {
frames[[length(frames) + 1]] <<- value
cat(".")
})
# You'll need to provide the correct file path
b$Page$navigate("file:///path/to/hede.html")
b$Page$startScreencast(format = "png", everyNthFrame = 1)
# Record for 5 seconds, then stop.
later(
function() {
b$Page$stopScreencast()
cancel_save_screencast_frames()
lapply(seq_along(frames), function(i) {
writeBin(jsonlite::base64_dec(frames[[i]]$data), sprintf("frame%02d.png", i))
})
b$close()
message("done")
},
5
) |
Oh this is the elsewhere you were talking about. Thanks again. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a small html file that creates a simple animation on canvas using a javascript library. However all I see with webshot is the empty canvas with the background color. I am unsure if webshot is supposed to capture animated frames but couldn't find a "known issues" section to see if this is within scope.
To replicate, download this file and do
After changing the file extension
Had to change the extension to paste the file to github. If you open it with a browser as an html file, you'll see the animation working
The text was updated successfully, but these errors were encountered: