Removed useless Quality selector in exoplayer
This commit is contained in:
parent
e5f0b71cf0
commit
cb8ebfccb6
2 changed files with 0 additions and 34 deletions
|
@ -132,7 +132,6 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
|
||||||
private lateinit var exoSubtitle: ImageButton
|
private lateinit var exoSubtitle: ImageButton
|
||||||
private lateinit var exoSubtitleView: SubtitleView
|
private lateinit var exoSubtitleView: SubtitleView
|
||||||
private lateinit var exoRotate: ImageButton
|
private lateinit var exoRotate: ImageButton
|
||||||
private lateinit var exoQuality: ImageButton
|
|
||||||
private lateinit var exoSpeed: ImageButton
|
private lateinit var exoSpeed: ImageButton
|
||||||
private lateinit var exoScreen: ImageButton
|
private lateinit var exoScreen: ImageButton
|
||||||
private lateinit var exoNext: ImageButton
|
private lateinit var exoNext: ImageButton
|
||||||
|
@ -371,7 +370,6 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
|
||||||
}
|
}
|
||||||
|
|
||||||
playerView = findViewById(R.id.player_view)
|
playerView = findViewById(R.id.player_view)
|
||||||
exoQuality = playerView.findViewById(R.id.exo_quality)
|
|
||||||
exoPlay = playerView.findViewById(androidx.media3.ui.R.id.exo_play)
|
exoPlay = playerView.findViewById(androidx.media3.ui.R.id.exo_play)
|
||||||
exoSource = playerView.findViewById(R.id.exo_source)
|
exoSource = playerView.findViewById(R.id.exo_source)
|
||||||
exoSettings = playerView.findViewById(R.id.exo_settings)
|
exoSettings = playerView.findViewById(R.id.exo_settings)
|
||||||
|
@ -1736,13 +1734,6 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
println("Track: ${tracks.groups.size}")
|
println("Track: ${tracks.groups.size}")
|
||||||
if (tracks.groups.size <= 2) exoQuality.visibility = View.GONE
|
|
||||||
else {
|
|
||||||
exoQuality.visibility = View.VISIBLE
|
|
||||||
exoQuality.setOnClickListener {
|
|
||||||
initPopupQuality().show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPlayerError(error: PlaybackException) {
|
override fun onPlayerError(error: PlaybackException) {
|
||||||
|
@ -1830,20 +1821,6 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
|
||||||
finishAndRemoveTask()
|
finishAndRemoveTask()
|
||||||
}
|
}
|
||||||
|
|
||||||
// QUALITY SELECTOR
|
|
||||||
private fun initPopupQuality(): Dialog {
|
|
||||||
|
|
||||||
val trackSelectionDialogBuilder =
|
|
||||||
TrackSelectionDialogBuilder(this, "Available Qualities", exoPlayer, TRACK_TYPE_VIDEO)
|
|
||||||
trackSelectionDialogBuilder.setTheme(R.style.DialogTheme)
|
|
||||||
trackSelectionDialogBuilder.setTrackNameProvider {
|
|
||||||
if (it.frameRate > 0f) it.height.toString() + "p" else it.height.toString() + "p (fps : N/A)"
|
|
||||||
}
|
|
||||||
val trackDialog = trackSelectionDialogBuilder.build()
|
|
||||||
trackDialog.setOnDismissListener { hideSystemBars() }
|
|
||||||
return trackDialog
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cast
|
// Cast
|
||||||
private fun cast() {
|
private fun cast() {
|
||||||
val videoURL = video?.file?.url ?: return
|
val videoURL = video?.file?.url ?: return
|
||||||
|
|
|
@ -127,17 +127,6 @@
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
tools:ignore="ContentDescription,SpeakableTextPresentCheck" />
|
tools:ignore="ContentDescription,SpeakableTextPresentCheck" />
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/exo_quality"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:backgroundTint="#00FFFFFF"
|
|
||||||
android:src="@drawable/ic_round_high_quality_24"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
tools:ignore="ContentDescription,SpeakableTextPresentCheck" />
|
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/exo_sub"
|
android:id="@+id/exo_sub"
|
||||||
android:layout_width="48dp"
|
android:layout_width="48dp"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue