Skip to content

Commit

Permalink
Removed useless Quality selector in exoplayer
Browse files Browse the repository at this point in the history
  • Loading branch information
aayush2622 committed Jan 23, 2024
1 parent e5f0b71 commit cb8ebfc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
23 changes: 0 additions & 23 deletions app/src/main/java/ani/dantotsu/media/anime/ExoplayerView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
private lateinit var exoSubtitle: ImageButton
private lateinit var exoSubtitleView: SubtitleView
private lateinit var exoRotate: ImageButton
private lateinit var exoQuality: ImageButton
private lateinit var exoSpeed: ImageButton
private lateinit var exoScreen: ImageButton
private lateinit var exoNext: ImageButton
Expand Down Expand Up @@ -371,7 +370,6 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
}

playerView = findViewById(R.id.player_view)
exoQuality = playerView.findViewById(R.id.exo_quality)
exoPlay = playerView.findViewById(androidx.media3.ui.R.id.exo_play)
exoSource = playerView.findViewById(R.id.exo_source)
exoSettings = playerView.findViewById(R.id.exo_settings)
Expand Down Expand Up @@ -1736,13 +1734,6 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
}
}
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) {
Expand Down Expand Up @@ -1830,20 +1821,6 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
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
private fun cast() {
val videoURL = video?.file?.url ?: return
Expand Down
11 changes: 0 additions & 11 deletions app/src/main/res/layout/exo_player_control_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,6 @@
app:layout_constraintEnd_toEndOf="parent"
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
android:id="@+id/exo_sub"
android:layout_width="48dp"
Expand Down

0 comments on commit cb8ebfc

Please sign in to comment.