kean / NukeUI

Lazy image loading for Apple platforms: SwiftUI, UIKit, AppKit
MIT License
20 stars 34 forks source link

Nothing shows when using content closure & url points to a video #30

Closed alexisbronchart closed 2 years ago

alexisbronchart commented 2 years ago

I'm using LazyImage like so:

LazyImage(source: imageUrl) { state in
                if let image = state.image {
                    image
                } else if state.error != nil {
                    Image(systemName: "xmark.octagon")
                        .resizable()
                        .padding()
                        .scaledToFit()
                        .foregroundColor(.red)
                } else {
                    ProgressView()
                }
            }

and it works just fine for images. However if the imageUrl is a video then nothing is displayed. If I remove the trailing closure then the video shows up but then I loose my error icon & loading indicator. I didn't see anything related to videos in LazyImageState. How can I make this work?

kean commented 2 years ago

Same issue as https://github.com/kean/NukeUI/issues. It's going to be addressed in 0.8.0.