Gif animations play at different speeds on iPad vs iPhone
RoboWorldEnt opened this issue · comments
Hello all,
I've been loving SwiftyGif so far. When we implemented it, we noticed gif animations are playing at different speeds on iPad vs iPhone. Here's a few videos to showcase what I mean:
Any ideas about how to fix this?
The error might be around here : https://github.com/kirualex/SwiftyGif/blob/master/SwiftyGif/UIImage%2BSwiftyGif.swift#L207-L215
Could you try changing :
let displayRefreshFactors = [60, 30, 20, 15, 12, 10, 6, 5, 4, 3, 2, 1]
to
let displayRefreshFactors = [30, 20, 15, 12, 10, 6, 5, 4, 3, 2, 1]
@kirualex tried that, didn't help - still get ~2x GIF speed on iPad Pro (11-inch) iOS 13.7.
Same problem on iPad Pro, gif plays abnormally faster.
Tried add 120 to displayRefreshFactors and works.
let displayRefreshFactors = [120, 60, 30, 20, 15, 12, 10, 6, 5, 4, 3, 2, 1]
It might be related to the 120HZ refresh rate on iPad pro?
I'm having the same problem. What's the best workaround?
@amberreyn I've ended up using simple WebView (my case is onboarding screen, with a single looping animation) with SwiftUI like so:
WebView(url: Bundle.main.url(forResource: "fox.gif", withExtension: nil)!)
.frame(width: 240, height: 240)