diff --git a/CHANGELOG.md b/CHANGELOG.md index 299791b..1046895 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 1.10.10+1 +- Deprecated `withHighestBitrate()` in favour of `bestQuality`. + ## 1.10.10 - Fix issue #136: Add `bannerUrl` getter for `Channel`. - Fix `ChannelClient.getByUsername` for `youtube.com/c/XXXX` channels. diff --git a/lib/src/videos/streams/stream_info.dart b/lib/src/videos/streams/stream_info.dart index 522adb1..4335279 100644 --- a/lib/src/videos/streams/stream_info.dart +++ b/lib/src/videos/streams/stream_info.dart @@ -56,7 +56,8 @@ extension StreamInfoIterableExt on Iterable { e.bitrate, e.codec.parameters['codecs'], if (e is VideoStreamInfo) e.framerate, - if (e is VideoStreamInfo) 'video only', + if (e is VideoOnlyStreamInfo) 'video only', + if (e is MuxedStreamInfo) 'muxed', e.size ]); } diff --git a/lib/src/videos/streams/video_stream_info.dart b/lib/src/videos/streams/video_stream_info.dart index 828b96a..2172c1d 100644 --- a/lib/src/videos/streams/video_stream_info.dart +++ b/lib/src/videos/streams/video_stream_info.dart @@ -32,8 +32,11 @@ extension VideoStreamInfoExtension on Iterable { Set getAllVideoQualitiesLabel() => map((e) => e.qualityLabel).toSet(); /// Gets the stream with best video quality. + @Deprecated('This is actually a typo, and actually returns the videos sorted by the best *video quality*. Now use the `bestQuality` getter ') T withHighestBitrate() => sortByVideoQuality().last; + T get bestQuality => sortByVideoQuality().last; + /// Gets the video streams sorted by highest video quality /// (then by framerate) in ascending order. /// This returns new list without editing the original list. diff --git a/test/video_test.dart b/test/video_test.dart index 6791c1a..e1332ef 100644 --- a/test/video_test.dart +++ b/test/video_test.dart @@ -21,7 +21,6 @@ void main() { expect(video.author, 'Tyrrrz'); var rangeMs = DateTime(2017, 09, 30, 17, 15, 26).millisecondsSinceEpoch; // 1day margin since the uploadDate could differ from timezones - // YouTube now doesn't send the upload date/ publish date anymore. expect(video.uploadDate!.millisecondsSinceEpoch, inInclusiveRange(rangeMs - 86400000, rangeMs + 86400000)); expect(video.publishDate!.millisecondsSinceEpoch,