@@ -35,7 +35,7 @@ final class WebImageConfiguration: ObservableObject {
35
35
var maxBufferSize : UInt ?
36
36
var customLoopCount : UInt ?
37
37
var runLoopMode : RunLoop . Mode = . common
38
- var pausable : Bool = true
38
+ var pausable : Bool = false
39
39
var purgeable : Bool = false
40
40
var playbackRate : Double = 1.0
41
41
var playbackMode : SDAnimatedImagePlaybackMode = . normal
@@ -117,11 +117,7 @@ public struct WebImage : View {
117
117
if isAnimating && !imageManager. isIncremental {
118
118
setupPlayer ( )
119
119
} else {
120
- if let currentFrame = imagePlayer. currentFrame {
121
- configure ( image: currentFrame)
122
- } else {
123
- configure ( image: imageManager. image!)
124
- }
120
+ displayImage ( )
125
121
}
126
122
} else {
127
123
// Load Logic
@@ -231,6 +227,16 @@ public struct WebImage : View {
231
227
}
232
228
}
233
229
230
+ /// Static Image Display
231
+ func displayImage( ) -> some View {
232
+ disappearAction ( )
233
+ if let currentFrame = imagePlayer. currentFrame {
234
+ return configure ( image: currentFrame)
235
+ } else {
236
+ return configure ( image: imageManager. image!)
237
+ }
238
+ }
239
+
234
240
/// Animated Image Support
235
241
func setupPlayer( ) -> some View {
236
242
let shouldResetPlayer : Bool
@@ -240,6 +246,9 @@ public struct WebImage : View {
240
246
} else {
241
247
shouldResetPlayer = false
242
248
}
249
+ if !shouldResetPlayer {
250
+ imagePlayer. startPlaying ( )
251
+ }
243
252
if let currentFrame = imagePlayer. currentFrame, !shouldResetPlayer {
244
253
// Bind frame index to ID to ensure onDisappear called with sync
245
254
return configure ( image: currentFrame)
0 commit comments