small fixes

This commit is contained in:
Bnyro 2022-06-01 12:03:00 +02:00
parent 1aa02db53f
commit 37160bcd74
2 changed files with 14 additions and 8 deletions

View File

@ -66,8 +66,11 @@ class BackgroundMode {
* Initializes the [playerNotification] attached to the [player] and shows it.
*/
private fun initializePlayerNotification(c: Context) {
playerNotification = PlayerNotificationManager.Builder(c, 1, "background_mode").build()
playerNotification = PlayerNotificationManager
.Builder(c, 1, "background_mode").build()
playerNotification.setPlayer(player)
playerNotification.setUsePreviousAction(false)
playerNotification.setUseNextAction(false)
playerNotification.setMediaSessionToken(mediaSession.sessionToken)
}

View File

@ -409,13 +409,13 @@ class PlayerFragment : Fragment() {
private fun initializePlayerView(view: View, response: Streams) {
isLoading = false
var videosNameArray: Array<CharSequence> = arrayOf()
videosNameArray += "HLS"
for (vid in response.videoStreams!!) {
val name = vid.quality + " " + vid.format
videosNameArray += name
}
runOnUiThread {
var videosNameArray: Array<CharSequence> = arrayOf()
videosNameArray += "HLS"
for (vid in response.videoStreams!!) {
val name = vid.quality + " " + vid.format
videosNameArray += name
}
var subtitle = mutableListOf<SubtitleConfiguration>()
if (response.subtitles!!.isNotEmpty()) {
subtitle.add(
@ -871,9 +871,12 @@ class PlayerFragment : Fragment() {
}
private fun initializePlayerNotification(c: Context) {
playerNotification = PlayerNotificationManager.Builder(c, notificationId, "background_mode")
playerNotification = PlayerNotificationManager
.Builder(c, notificationId, "background_mode")
.build()
playerNotification.setPlayer(exoPlayer)
playerNotification.setUseNextAction(false)
playerNotification.setUsePreviousAction(false)
playerNotification.setMediaSessionToken(mediaSession.sessionToken)
}