mirror of
				https://github.com/yattee/yattee.git
				synced 2025-11-04 06:32:03 +00:00 
			
		
		
		
	Show asset loading error from AVPlayer
This commit is contained in:
		@@ -459,7 +459,9 @@ final class AVPlayerBackend: PlayerBackend {
 | 
			
		||||
                    self.model.play()
 | 
			
		||||
                }
 | 
			
		||||
            case .failed:
 | 
			
		||||
                self.model.playerError = item.error
 | 
			
		||||
                DispatchQueue.main.async {
 | 
			
		||||
                    self.model.playerError = item.error
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
            default:
 | 
			
		||||
                return
 | 
			
		||||
 
 | 
			
		||||
@@ -149,13 +149,10 @@ final class PlayerModel: ObservableObject {
 | 
			
		||||
    var pipController: AVPictureInPictureController?
 | 
			
		||||
    var pipDelegate = PiPDelegate()
 | 
			
		||||
 | 
			
		||||
    @Published var presentingErrorDetails = false
 | 
			
		||||
    var playerError: Error? { didSet {
 | 
			
		||||
        #if !os(tvOS)
 | 
			
		||||
            if !playerError.isNil {
 | 
			
		||||
                presentingErrorDetails = true
 | 
			
		||||
            }
 | 
			
		||||
        #endif
 | 
			
		||||
        if let error = playerError {
 | 
			
		||||
            navigation.presentAlert(title: "Failed loading video", message: error.localizedDescription)
 | 
			
		||||
        }
 | 
			
		||||
    }}
 | 
			
		||||
 | 
			
		||||
    @Default(.qualityProfiles) var qualityProfiles
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user