Merge pull request #4560 from FineFindus/feat/show-endscreen-on-end

feat: show controls on STATE_ENDED
This commit is contained in:
Bnyro 2023-08-20 13:06:58 +02:00 committed by GitHub
commit ab9e543291
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 12 deletions

View File

@ -16,5 +16,5 @@ data class Instances(
@SerialName("cache") val chache: Boolean = false, @SerialName("cache") val chache: Boolean = false,
@SerialName("s3_enabled") val s3Enabled: Boolean = false, @SerialName("s3_enabled") val s3Enabled: Boolean = false,
@SerialName("image_proxy_url") val imageProxyUrl: String = "", @SerialName("image_proxy_url") val imageProxyUrl: String = "",
@SerialName("registration_disabled") val registrationDisabled: Boolean = false, @SerialName("registration_disabled") val registrationDisabled: Boolean = false
) )

View File

@ -31,8 +31,10 @@ class InstancesAdapter(
holder.binding.apply { holder.binding.apply {
var instanceText = "${instance.name} ${instance.locations}" var instanceText = "${instance.name} ${instance.locations}"
if (instance.cdn) instanceText += " (\uD83C\uDF10 CDN)" if (instance.cdn) instanceText += " (\uD83C\uDF10 CDN)"
if (instance.registrationDisabled) instanceText += if (instance.registrationDisabled) {
" (${root.context.getString(R.string.registration_disabled)})" instanceText +=
" (${root.context.getString(R.string.registration_disabled)})"
}
radioButton.text = instanceText radioButton.text = instanceText
radioButton.setOnCheckedChangeListener(null) radioButton.setOnCheckedChangeListener(null)
radioButton.isChecked = selectedInstanceIndex == position radioButton.isChecked = selectedInstanceIndex == position

View File

@ -934,16 +934,16 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
} }
// check if video has ended, next video is available and autoplay is enabled. // check if video has ended, next video is available and autoplay is enabled.
if ( if (playbackState == Player.STATE_ENDED) {
playbackState == Player.STATE_ENDED && if (!isTransitioning && PlayerHelper.autoPlayEnabled) {
!isTransitioning && isTransitioning = true
PlayerHelper.autoPlayEnabled if (PlayerHelper.autoPlayCountdown) {
) { showAutoPlayCountdown()
isTransitioning = true } else {
if (PlayerHelper.autoPlayCountdown) { playNextVideo()
showAutoPlayCountdown() }
} else { } else {
playNextVideo() binding.player.showController()
} }
} }