cobe icon indicating copy to clipboard operation
cobe copied to clipboard

The globe spins slower in safari

Open ConsoleTVs opened this issue 4 years ago • 5 comments

Same configuration, globe spins faster in chrome/firefox than safari

ConsoleTVs avatar Apr 17 '22 18:04 ConsoleTVs

Turns out is twice as fast for some reason lol;

workaround meanwhile:

// Detect browser
const isSafari = Boolean(
    navigator.vendor &&
      navigator.vendor.indexOf("Apple") > -1 &&
      navigator.userAgent &&
      navigator.userAgent.indexOf("CriOS") == -1 &&
      navigator.userAgent.indexOf("FxiOS") == -1
  );

// The onRender property on the configuration: (just double the value for safari)
state.phi = phi += isSafari ? 0.006 : 0.003;

ConsoleTVs avatar Apr 17 '22 18:04 ConsoleTVs

That's weird, is it possible that there's some FPS-limiting (requestAnimationFrame) configuration in your Safari browser?

shuding avatar Apr 22 '22 22:04 shuding

I'll check but I have never tweaked those settings, so they should be the default... Does it work well for you?

ConsoleTVs avatar Apr 22 '22 22:04 ConsoleTVs

Yeah it works well for me

shuding avatar Apr 23 '22 14:04 shuding

Alright, ill make some tests and see if I come up with anything

ConsoleTVs avatar Apr 23 '22 15:04 ConsoleTVs

This could be related to safari not supporting high refresh rates in older versions. A possible fix for such animation speed differences would be to compute the delta time as suggested in #13. Here's a good read for the same.

Ensuring Consistent Animation Speeds

Mayank-Sh07 avatar Apr 14 '23 05:04 Mayank-Sh07

Tracking in #13.

shuding avatar May 29 '23 22:05 shuding