improved tweet video display quality

This commit is contained in:
Mariotaku Lee 2017-02-12 15:52:03 +08:00
parent f33ecab166
commit 2f6ec787d1
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
1 changed files with 2 additions and 2 deletions

View File

@ -343,9 +343,9 @@ class VideoPageFragment : CacheDownloadMediaViewerFragment(), IBaseFragment<Vide
if (media.video_info == null) {
return Pair.create<String, String>(media.media_url, null)
}
val firstMatch = media.video_info.variants.first { variant ->
val firstMatch = media.video_info.variants.filter { variant ->
supportedTypes.any { it.equals(variant.content_type, ignoreCase = true) }
} ?: return null
}.sortedByDescending(ParcelableMedia.VideoInfo.Variant::bitrate).firstOrNull() ?: return null
return Pair.create(firstMatch.url, firstMatch.content_type)
}
ParcelableMedia.Type.CARD_ANIMATED_GIF -> {