Fixed deprecated ExoPlayer
This commit is contained in:
parent
8d750f0dd7
commit
f81a60fc46
1 changed files with 3 additions and 4 deletions
|
@ -32,10 +32,10 @@ import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.MediaController
|
import android.widget.MediaController
|
||||||
|
import com.google.android.exoplayer2.ExoPlayer
|
||||||
import com.google.android.exoplayer2.MediaItem
|
import com.google.android.exoplayer2.MediaItem
|
||||||
import com.google.android.exoplayer2.PlaybackException
|
import com.google.android.exoplayer2.PlaybackException
|
||||||
import com.google.android.exoplayer2.Player
|
import com.google.android.exoplayer2.Player
|
||||||
import com.google.android.exoplayer2.SimpleExoPlayer
|
|
||||||
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector
|
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector
|
||||||
import com.keylesspalace.tusky.R
|
import com.keylesspalace.tusky.R
|
||||||
import com.keylesspalace.tusky.ViewMediaActivity
|
import com.keylesspalace.tusky.ViewMediaActivity
|
||||||
|
@ -63,7 +63,7 @@ class ViewVideoFragment : ViewMediaFragment() {
|
||||||
private lateinit var mediaController: MediaController
|
private lateinit var mediaController: MediaController
|
||||||
private var isAudio = false
|
private var isAudio = false
|
||||||
|
|
||||||
private var exoPlayer: SimpleExoPlayer? = null
|
private var exoPlayer: ExoPlayer? = null
|
||||||
private val playbackStateListener: Player.Listener = playbackStateListener()
|
private val playbackStateListener: Player.Listener = playbackStateListener()
|
||||||
private var playWhenReady = true
|
private var playWhenReady = true
|
||||||
private var currentWindow = 0
|
private var currentWindow = 0
|
||||||
|
@ -124,7 +124,7 @@ class ViewVideoFragment : ViewMediaFragment() {
|
||||||
setParameters(buildUponParameters().setMaxVideoSizeSd())
|
setParameters(buildUponParameters().setMaxVideoSizeSd())
|
||||||
}
|
}
|
||||||
|
|
||||||
exoPlayer = SimpleExoPlayer.Builder(requireActivity())
|
exoPlayer = ExoPlayer.Builder(requireActivity())
|
||||||
.setTrackSelector(trackSelector)
|
.setTrackSelector(trackSelector)
|
||||||
.build()
|
.build()
|
||||||
.also { player ->
|
.also { player ->
|
||||||
|
@ -143,7 +143,6 @@ class ViewVideoFragment : ViewMediaFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
videoControls.player = videoView.player
|
videoControls.player = videoView.player
|
||||||
//videoView.requestFocus()
|
|
||||||
|
|
||||||
if(arguments!!.getBoolean(ARG_START_POSTPONED_TRANSITION)) {
|
if(arguments!!.getBoolean(ARG_START_POSTPONED_TRANSITION)) {
|
||||||
mediaActivity.onBringUp()
|
mediaActivity.onBringUp()
|
||||||
|
|
Loading…
Reference in a new issue