mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 08:20:32 +05:30
keep screen on
This commit is contained in:
parent
844c73c645
commit
f11e1b276c
@ -205,6 +205,7 @@ class PlayerFragment : Fragment() {
|
|||||||
getConstraintSet(R.id.start).constrainHeight(R.id.player, -1)
|
getConstraintSet(R.id.start).constrainHeight(R.id.player, -1)
|
||||||
//getTransition(R.id.yt_transition).isEnabled = false
|
//getTransition(R.id.yt_transition).isEnabled = false
|
||||||
}
|
}
|
||||||
|
view.findViewById<LinearLayout>(R.id.linLayout).visibility=View.GONE
|
||||||
isFullScreen=true
|
isFullScreen=true
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
@ -216,6 +217,7 @@ class PlayerFragment : Fragment() {
|
|||||||
getConstraintSet(R.id.start).constrainHeight(R.id.player, 0)
|
getConstraintSet(R.id.start).constrainHeight(R.id.player, 0)
|
||||||
//getTransition(R.id.yt_transition).isEnabled = true
|
//getTransition(R.id.yt_transition).isEnabled = true
|
||||||
}
|
}
|
||||||
|
view.findViewById<LinearLayout>(R.id.linLayout).visibility=View.VISIBLE
|
||||||
isFullScreen=false
|
isFullScreen=false
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -334,6 +336,10 @@ class PlayerFragment : Fragment() {
|
|||||||
//Listener for play and pause icon change
|
//Listener for play and pause icon change
|
||||||
exoPlayer!!.addListener(object : com.google.android.exoplayer2.Player.Listener {
|
exoPlayer!!.addListener(object : com.google.android.exoplayer2.Player.Listener {
|
||||||
override fun onPlayerStateChanged(playWhenReady: Boolean,playbackState: Int) {
|
override fun onPlayerStateChanged(playWhenReady: Boolean,playbackState: Int) {
|
||||||
|
|
||||||
|
exoPlayerView.keepScreenOn = !(playbackState == Player.STATE_IDLE || playbackState == Player.STATE_ENDED ||
|
||||||
|
!playWhenReady)
|
||||||
|
|
||||||
if (playWhenReady && playbackState == Player.STATE_READY) {
|
if (playWhenReady && playbackState == Player.STATE_READY) {
|
||||||
// media actually playing
|
// media actually playing
|
||||||
view.findViewById<ImageView>(R.id.play_imageView).setImageResource(R.drawable.ic_pause)
|
view.findViewById<ImageView>(R.id.play_imageView).setImageResource(R.drawable.ic_pause)
|
||||||
@ -380,7 +386,7 @@ class PlayerFragment : Fragment() {
|
|||||||
activity?.runOnUiThread(action)
|
activity?.runOnUiThread(action)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getMostBitRate(audios: List<PipedStream>):Int{
|
private fun getMostBitRate(audios: List<PipedStream>):Int{
|
||||||
var bitrate =0
|
var bitrate =0
|
||||||
var index = 0
|
var index = 0
|
||||||
for ((i, audio) in audios.withIndex()){
|
for ((i, audio) in audios.withIndex()){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user