Tweak code
This commit is contained in:
@@ -225,7 +225,10 @@ class PlayerService : InvincibleService(), Player.Listener, PlaybackStatsListene
|
|||||||
|
|
||||||
override fun onMediaItemTransition(mediaItem: MediaItem?, reason: Int) {
|
override fun onMediaItemTransition(mediaItem: MediaItem?, reason: Int) {
|
||||||
maybeNormalizeVolume()
|
maybeNormalizeVolume()
|
||||||
|
maybeProcessRadio()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun maybeProcessRadio() {
|
||||||
radio?.let { radio ->
|
radio?.let { radio ->
|
||||||
if (player.mediaItemCount - player.currentMediaItemIndex <= 3) {
|
if (player.mediaItemCount - player.currentMediaItemIndex <= 3) {
|
||||||
coroutineScope.launch(Dispatchers.Main) {
|
coroutineScope.launch(Dispatchers.Main) {
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
package it.vfsfitvnm.vimusic.utils
|
|
||||||
|
|
||||||
import android.os.Bundle
|
|
||||||
|
|
||||||
|
|
||||||
fun Bundle.getFloatOrNull(key: String): Float? =
|
|
||||||
if (containsKey(key)) getFloat(key) else null
|
|
||||||
|
|
||||||
|
|
||||||
fun Bundle.getLongOrNull(key: String): Long? =
|
|
||||||
if (containsKey(key)) getLong(key) else null
|
|
||||||
Reference in New Issue
Block a user