mirror of
https://github.com/apognu/otter
synced 2025-02-10 16:20:36 +01:00
Re-enabled media session on service start. Do not condition radio resumption to having a cookie, since those are only valid when authenticated anonymously.
This commit is contained in:
parent
080c07eeab
commit
fe224b097a
@ -97,6 +97,8 @@ class PlayerService : Service() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Otter.get().mediaSession.active = true
|
||||||
|
|
||||||
mediaControlsManager = MediaControlsManager(this, scope, Otter.get().mediaSession.session)
|
mediaControlsManager = MediaControlsManager(this, scope, Otter.get().mediaSession.session)
|
||||||
|
|
||||||
player = SimpleExoPlayer.Builder(this).build().apply {
|
player = SimpleExoPlayer.Builder(this).build().apply {
|
||||||
|
@ -35,14 +35,19 @@ class RadioPlayer(val context: Context, val scope: CoroutineScope) {
|
|||||||
private val favoritedRepository = FavoritedRepository(context)
|
private val favoritedRepository = FavoritedRepository(context)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
Cache.get(context, "radio_type")?.readLine()?.log()
|
||||||
|
Cache.get(context, "radio_id")?.readLine()?.log()
|
||||||
|
Cache.get(context, "radio_session")?.readLine()?.log()
|
||||||
|
Cache.get(context, "radio_cookie")?.readLine()?.log()
|
||||||
|
|
||||||
Cache.get(context, "radio_type")?.readLine()?.let { radio_type ->
|
Cache.get(context, "radio_type")?.readLine()?.let { radio_type ->
|
||||||
Cache.get(context, "radio_id")?.readLine()?.toInt()?.let { radio_id ->
|
Cache.get(context, "radio_id")?.readLine()?.toInt()?.let { radio_id ->
|
||||||
Cache.get(context, "radio_session")?.readLine()?.toInt()?.let { radio_session ->
|
Cache.get(context, "radio_session")?.readLine()?.toInt()?.let { radio_session ->
|
||||||
Cache.get(context, "radio_cookie")?.readLine()?.let { radio_cookie ->
|
val cachedCookie = Cache.get(context, "radio_cookie")?.readLine()
|
||||||
currentRadio = Radio(radio_id, radio_type, "", "")
|
|
||||||
session = radio_session
|
currentRadio = Radio(radio_id, radio_type, "", "")
|
||||||
cookie = radio_cookie
|
session = radio_session
|
||||||
}
|
cookie = cachedCookie
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user