PlayerError
Written by
Updated at May 28, 2026
Contents
PlayerError
public protocol PlayerError: Error
Player error protocol.
Discussion
All errors occurring in the player conform to this protocol. You can get the error stream via YaPlayer/errorDidDetected(queue:).
Inheritance
Error
Properties
| Name | Type | Description |
|---|---|---|
type |
PlayerErrorType |
Error type: Determines the severity. |
details |
PlayerErrorDetails |
Detailed error information |
Examples
player.errorDidDetected()
.sink { error in
if error.type == .fatal {
showErrorScreen()
}
}
.store(in: &cancellables)
AnyPlayerError
public struct AnyPlayerError: PlayerError
Specific implementation of PlayerError returned by the player.
Inheritance
PlayerError
Properties
| Name | Type | Description |
|---|---|---|
type |
PlayerErrorType |
Error type. |
details |
PlayerErrorDetails |
Detailed error information. |
PlayerErrorDetails
public struct PlayerErrorDetails
Detailed player error information.
Properties
| Name | Type | Description |
|---|---|---|
code |
Int |
Error code |
domain |
String |
Error domain |
description |
String |
Error description |
userInfo |
[String: Any] |
Additional error information |
PlayerErrorType
public enum PlayerErrorType: String, Encodable
Player error type (severity).
Inheritance
StringEncodable
Cases
| Case | Description |
|---|---|
error |
Non-critical error: Playback may continue. |
fatal |
Fatal error: Playback is impossible. |