mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-20 03:24:50 +00:00
Added current quality to auto item
Changelog: added
This commit is contained in:
parent
94454172dd
commit
978f76ffb6
4 changed files with 24 additions and 2 deletions
|
@ -171,7 +171,6 @@ import kotlinx.coroutines.withContext
|
|||
import userpackage.Protocol
|
||||
import java.time.OffsetDateTime
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.max
|
||||
import kotlin.math.roundToLong
|
||||
|
||||
@UnstableApi
|
||||
|
@ -1923,9 +1922,19 @@ class VideoDetailView : ConstraintLayout {
|
|||
}
|
||||
}
|
||||
|
||||
var videoMenuGroup: SlideUpMenuGroup? = null
|
||||
for (view in _overlay_quality_selector!!.groupItems) {
|
||||
if (view is SlideUpMenuGroup && view.groupTag == "video") {
|
||||
videoMenuGroup = view
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedQuality != null) {
|
||||
videoMenuGroup?.getItem("auto")?.setSubText("")
|
||||
_overlay_quality_selector?.selectOption("video", selectedQuality)
|
||||
} else {
|
||||
videoMenuGroup?.getItem("auto")
|
||||
?.setSubText("${_player.exoPlayer?.player?.videoFormat?.width}x${_player.exoPlayer?.player?.videoFormat?.height}")
|
||||
_overlay_quality_selector?.selectOption("video", "auto")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,6 +61,15 @@ class SlideUpMenuGroup : LinearLayout {
|
|||
return didSelect;
|
||||
}
|
||||
|
||||
fun getItem(tag: Any?): SlideUpMenuItem? {
|
||||
for(item in items) {
|
||||
if(item.itemTag == tag){
|
||||
return item
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
private fun addItems(items: List<SlideUpMenuItem>) {
|
||||
for (item in items) {
|
||||
item.setParentClickListener { parentClickListener?.invoke() }
|
||||
|
|
|
@ -82,6 +82,10 @@ class SlideUpMenuItem : ConstraintLayout {
|
|||
return isSelected;
|
||||
}
|
||||
|
||||
fun setSubText(subText: String) {
|
||||
_subtext.text = subText
|
||||
}
|
||||
|
||||
fun setParentClickListener(listener: (()->Unit)?) {
|
||||
_parentClickListener = listener;
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ abstract class FutoVideoPlayerBase : RelativeLayout {
|
|||
|
||||
var targetTrackVideoHeight = -1
|
||||
private set
|
||||
var _targetTrackAudioBitrate = -1
|
||||
private var _targetTrackAudioBitrate = -1
|
||||
|
||||
private var _toResume = false;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue