2020-06-03 13:18:37 +02:00
|
|
|
import '../videos/video_id.dart';
|
2020-05-31 23:36:23 +02:00
|
|
|
import 'video_unplayable_exception.dart';
|
|
|
|
|
|
|
|
/// Exception thrown when the requested video requires purchase.
|
2021-07-15 23:43:47 +02:00
|
|
|
class VideoRequiresPurchaseException extends VideoUnplayableException {
|
2020-05-31 23:36:23 +02:00
|
|
|
/// VideoId instance
|
|
|
|
final VideoId previewVideoId;
|
2020-02-23 21:00:35 +01:00
|
|
|
|
2020-06-03 13:18:37 +02:00
|
|
|
/// Initializes an instance of [VideoRequiresPurchaseException].
|
|
|
|
VideoRequiresPurchaseException.preview(VideoId videoId, this.previewVideoId)
|
2021-07-15 23:43:47 +02:00
|
|
|
: super('Video `$videoId` is unplayable because it requires purchase.\n'
|
|
|
|
'Streams are not available for this video.\n'
|
|
|
|
'There is a preview video available: `$previewVideoId`.');
|
2020-02-23 21:00:35 +01:00
|
|
|
}
|