youtube_explode/lib/src/exceptions/video_requires_purchase_exc...

19 lines
691 B
Dart
Raw Normal View History

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.
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-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
}