mirror of
https://github.com/jellyfin/jellyfin-android.git
synced 2026-09-03 05:10:27 +03:00
Show bitrate in playback info
This commit is contained in:
committed by
Niels van Velzen
parent
32b3101089
commit
0aaf9c8380
@@ -83,7 +83,15 @@ class PlaybackMenus(
|
||||
"${fragment.getString(R.string.playback_info_video_streams)}:\n",
|
||||
limit = 3,
|
||||
truncated = fragment.getString(R.string.playback_info_and_x_more, size - 3)
|
||||
) { "- ${it.title}" }
|
||||
) {
|
||||
val bitrate = it.bitrate
|
||||
val bitrateString = when {
|
||||
bitrate > 1_000_000 -> String.format("%.2f Mbps", bitrate.toDouble() / 1_000_000)
|
||||
bitrate > 1_000 -> String.format("%.2f kbps", bitrate.toDouble() / 1_000)
|
||||
else -> String.format("%d kbps", bitrate / 1000)
|
||||
}
|
||||
"- ${it.title} ($bitrateString)"
|
||||
}
|
||||
}
|
||||
val audioTracksInfo = item.audioTracksGroup.tracks.run {
|
||||
joinToString(
|
||||
|
||||
@@ -12,6 +12,7 @@ sealed class ExoPlayerTrack(track: JSONObject) {
|
||||
class Video(track: JSONObject) : ExoPlayerTrack(track) {
|
||||
val width: Int = track.optInt("Width", -1)
|
||||
val height: Int = track.optInt("Height", -1)
|
||||
val bitrate: Long = track.optLong("BitRate", -1)
|
||||
val aspectRatio: Rational = Rational(width, height)
|
||||
|
||||
override fun toString() = "ExoPlayerTrack.Video#$index(title=$title)"
|
||||
|
||||
Reference in New Issue
Block a user