mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 08:20:32 +05:30
prepare for offline usage
This commit is contained in:
parent
9066db8b11
commit
516d9df203
@ -399,7 +399,7 @@ class PlayerFragment : BaseFragment() {
|
||||
}
|
||||
}
|
||||
|
||||
private val playerViewInterface = object : OnlinePlayerOptionsInterface {
|
||||
private val onlinePlayerOptionsInterface = object : OnlinePlayerOptionsInterface {
|
||||
override fun onCaptionClicked() {
|
||||
if (!this@PlayerFragment::streams.isInitialized ||
|
||||
streams.subtitles == null ||
|
||||
@ -883,7 +883,7 @@ class PlayerFragment : BaseFragment() {
|
||||
// initialize the player view actions
|
||||
binding.player.initialize(
|
||||
childFragmentManager,
|
||||
playerViewInterface,
|
||||
onlinePlayerOptionsInterface,
|
||||
doubleTapOverlayBinding,
|
||||
trackSelector
|
||||
)
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.github.libretube.interfaces
|
||||
|
||||
interface PlayerOptionsInterface {
|
||||
|
||||
fun onAutoplayClicked()
|
||||
|
||||
fun onPlaybackSpeedClicked()
|
||||
|
@ -42,7 +42,7 @@ internal class CustomExoPlayerView(
|
||||
private var doubleTapListener: DoubleTapInterface? = null
|
||||
private var onlinePlayerOptionsInterface: OnlinePlayerOptionsInterface? = null
|
||||
private lateinit var childFragmentManager: FragmentManager
|
||||
private lateinit var trackSelector: TrackSelector
|
||||
private var trackSelector: TrackSelector? = null
|
||||
|
||||
private val runnableHandler = Handler(Looper.getMainLooper())
|
||||
|
||||
@ -154,8 +154,8 @@ internal class CustomExoPlayerView(
|
||||
}
|
||||
// set the current caption language
|
||||
currentCaptions =
|
||||
if (trackSelector.parameters.preferredTextLanguages.isNotEmpty()) {
|
||||
trackSelector.parameters.preferredTextLanguages[0]
|
||||
if (trackSelector != null && trackSelector!!.parameters.preferredTextLanguages.isNotEmpty()) {
|
||||
trackSelector!!.parameters.preferredTextLanguages[0]
|
||||
} else {
|
||||
context?.getString(R.string.none)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user