player.error.collect { error ->
when (error) {
VideoPlayerError.NOT_BOUND -> { /* player not yet passed to video() */}
VideoPlayerError.STREAM_REJECTED -> { /* device rejected the stream */}
VideoPlayerError.INVALID_URL -> { /* invalid video URL */}
VideoPlayerError.ALREADY_PLAYING -> { /* another video is active */}
VideoPlayerError.PLAYBACK_FAILED -> { /* playback failed on device */}
VideoPlayerError.INVALID_DIMENSIONS -> { /* video too large for device */}
VideoPlayerError.UNEXPECTED_ERROR -> { /* unknown error */}
null -> { /* no error */}
}
}
enum VideoPlayerError : Enum<VideoPlayerError> , DatError
| Member | Description |
|---|---|
NOT_BOUND |
The player is not bound to a display.
This error occurs when calling VideoPlayer.play before the player has been passed to video() inside sendContent. Send content first, then call play().
|
STREAM_REJECTED |
The video stream was rejected by the wearable device.
|
INVALID_URL |
The video URL is invalid.
This error occurs when the URL provided to VideoSource.Url is blank or has an unsupported scheme. Supported schemes are http and https.
|
ALREADY_PLAYING |
A video is already playing or loading on the device. Stop the current video first.
|
PLAYBACK_FAILED |
Video playback failed on the device (e.g., codec error, surface unavailable).
|
INVALID_DIMENSIONS |
The video dimensions exceed the device limits (max 400px per side, 70,000 total pixels).
|
UNEXPECTED_ERROR |
An unexpected error occurred during video playback.
|
description
: String
[Get] |
A human-readable description of the error suitable for logging and debugging purposes.
Signature
open override val description: String |
getLocalizedDescription
(
context
)
|
Returns a localized description of the error using Android string resources when available.
Signature
open override fun getLocalizedDescription(context: Context?): String Parameters context: Context?
Optional Android context for accessing string resources. If null or if no localized string is available, returns the default VideoPlayerError.description.
Returns String
The localized error description, or the default description if localization unavailable.
|