Skip to content

Commit 69413ec

Browse files
committed
Fix the rare cases that WebImage will lost animation when visibility changes. Always setup player to play as defaults to avoid this.
1 parent d0afa1c commit 69413ec

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

SDWebImageSwiftUI/Classes/ImagePlayer.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,7 @@ public final class ImagePlayer : ObservableObject {
8282

8383
self.player = imagePlayer
8484

85-
// Setup poster frame
86-
if let cgImage = animatedImage.cgImage {
87-
currentFrame = PlatformImage(cgImage: cgImage, scale: animatedImage.scale, orientation: .up)
88-
} else {
89-
currentFrame = .empty
90-
}
85+
imagePlayer.startPlaying()
9186
}
9287
}
9388
}

0 commit comments

Comments
 (0)