2020-02-23 21:00:35 +01:00
|
|
|
/// Thrown when a video is not playable and its streams cannot be resolved.
|
|
|
|
/// This can happen because the video requires purchase,
|
|
|
|
/// is blocked in your country, is controversial, or due to other reasons.
|
|
|
|
class VideoUnplayableException {
|
|
|
|
/// ID of the video.
|
|
|
|
final String videoId;
|
|
|
|
|
2020-02-24 14:50:12 +01:00
|
|
|
/// Reason why the video can't be played.
|
|
|
|
final String reason;
|
|
|
|
|
2020-02-23 21:00:35 +01:00
|
|
|
/// Initializes an instance of [VideoUnplayableException]
|
2020-02-24 14:50:12 +01:00
|
|
|
const VideoUnplayableException(this.videoId, [this.reason]);
|
2020-02-23 21:00:35 +01:00
|
|
|
|
|
|
|
String toString() =>
|
2020-02-24 14:50:12 +01:00
|
|
|
'VideoUnplayableException: Video $videoId couldn\'t be played.'
|
|
|
|
'${reason == null ? '' : 'Reason: $reason'}';
|
2020-02-23 21:00:35 +01:00
|
|
|
}
|