@@ -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
@@ -115,11 +115,7 @@ public struct WebImage : View {
115
115
if isAnimating && !imageManager. isIncremental {
116
116
setupPlayer ( )
117
117
} else {
118
- if let currentFrame = imagePlayer. currentFrame {
119
- configure ( image: currentFrame)
120
- } else {
121
- configure ( image: imageManager. image!)
122
- }
118
+ displayImage ( )
123
119
}
124
120
} else {
125
121
// Load Logic
@@ -229,6 +225,16 @@ public struct WebImage : View {
229
225
}
230
226
}
231
227
228
+ /// Static Image Display
229
+ func displayImage( ) -> some View {
230
+ disappearAction ( )
231
+ if let currentFrame = imagePlayer. currentFrame {
232
+ return configure ( image: currentFrame)
233
+ } else {
234
+ return configure ( image: imageManager. image!)
235
+ }
236
+ }
237
+
232
238
/// Animated Image Support
233
239
func setupPlayer( ) -> some View {
234
240
let shouldResetPlayer : Bool
@@ -238,6 +244,9 @@ public struct WebImage : View {
238
244
} else {
239
245
shouldResetPlayer = false
240
246
}
247
+ if !shouldResetPlayer {
248
+ imagePlayer. startPlaying ( )
249
+ }
241
250
if let currentFrame = imagePlayer. currentFrame, !shouldResetPlayer {
242
251
// Bind frame index to ID to ensure onDisappear called with sync
243
252
return configure ( image: currentFrame)
0 commit comments