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.
|
2020-02-24 14:50:12 +01:00
|
|
|
class VideoRequiresPurchaseException implements VideoUnplayableException {
|
2020-05-31 23:36:23 +02:00
|
|
|
/// Description message
|
2020-06-03 13:18:37 +02:00
|
|
|
@override
|
2020-05-31 23:36:23 +02:00
|
|
|
final String message;
|
2020-02-24 14:50:12 +01:00
|
|
|
|
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)
|
|
|
|
: message = 'Video `$videoId` is unplayable because it requires purchase.'
|
|
|
|
'Streams are not available for this video.'
|
|
|
|
'There is a preview video available: `$previewVideoId`.';
|
2020-02-23 21:00:35 +01:00
|
|
|
}
|