Fix ClosedCaption test
This commit is contained in:
parent
b055734967
commit
105748fc7c
|
@ -13,11 +13,11 @@ void main() {
|
|||
});
|
||||
|
||||
test('GetClosedCaptionTracksOfAnyVideo', () async {
|
||||
var manifest = await yt.videos.closedCaptions.getManifest('_QdPW8JrYzQ');
|
||||
var manifest = await yt.videos.closedCaptions.getManifest('WOxr2dmLHLo');
|
||||
expect(manifest.tracks, isNotEmpty);
|
||||
});
|
||||
test('GetClosedCaptionTrackOfAnyVideoSpecific', () async {
|
||||
var manifest = await yt.videos.closedCaptions.getManifest('_QdPW8JrYzQ');
|
||||
var manifest = await yt.videos.closedCaptions.getManifest('WOxr2dmLHLo');
|
||||
var trackInfo = manifest.tracks.first;
|
||||
var track = await yt.videos.closedCaptions.get(trackInfo);
|
||||
|
||||
|
@ -25,18 +25,18 @@ void main() {
|
|||
});
|
||||
test('GetClosedCaptionTrackAtSpecificTime', () async {
|
||||
var manifest = await yt.videos.closedCaptions
|
||||
.getManifest('https://www.youtube.com/watch?v=YltHGKX80Y8');
|
||||
.getManifest('https://www.youtube.com/watch?v=ppJy5uGZLi4');
|
||||
var trackInfo = manifest.getByLanguage('en');
|
||||
var track = await yt.videos.closedCaptions.get(trackInfo);
|
||||
var caption =
|
||||
track.getByTime(const Duration(hours: 0, minutes: 10, seconds: 41));
|
||||
track.getByTime(const Duration(hours: 0, minutes: 13, seconds: 22));
|
||||
var captionPart =
|
||||
caption.getPartByTime(const Duration(milliseconds: 650));
|
||||
caption.getPartByTime(const Duration(milliseconds: 200));
|
||||
|
||||
expect(caption, isNotNull);
|
||||
expect(captionPart, isNotNull);
|
||||
expect(caption.text, 'know I worked really hard on not doing');
|
||||
expect(captionPart.text, ' hard');
|
||||
expect(caption.text, 'how about this black there are some');
|
||||
expect(captionPart.text, ' about');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue