Create Screenshot Using Render Target nor working on safari (IOS)

Looks like CreateScreenshotUsingRenderTarget is broken on safari (IOS).
pg: CreateScreenshotUsingRenderTarget

any thoughts or workarounds would be appreciated?

It does work for me on a iPhone SE, but I had to use a timeout of 8s instead of 2s because the scene takes more time to be ready.

You should use scene.executeWhenReady before taking the screenshot to make sure the screenshot will work:

1 Like

turns out this was an ios version issue. i was trying this on ios14 and the sceen was black. Upgrading to latest fixed it. For support on older devices, not sure what to do there except to tell the user to upgrade :slight_smile:

1 Like

@Evgeni_Popov . we are coming across some issues with people on older browsers or ios versions resulting in black screenshots. We just need to validate this a little more gracefully. Do you have any tricks to check if the resulting base64 image is all black?

No, except by decoding the base64 and checking that all the r/g/b components are 0 for all pixels.

@Evgeni_Popov revising this. we have a few customers who are on older iphones and it seems the screenshot utility wants webgl2 on newer phones. Is there a workaround to this, we just want a screenshot of the canvas at a specific resolution . canvas.toDataURL() ?

Yes, something like engine.getRenderingCanvas().toDataURL("image/png") does work.

yep seems to work: