fixing some mediasession initialization at third party intents

This commit is contained in:
tibbi 2022-04-03 18:15:32 +02:00
parent ad68fe892b
commit 6d6e249575
2 changed files with 5 additions and 1 deletions

View file

@ -68,7 +68,7 @@ android {
}
dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:8301d8356c'
implementation 'com.github.SimpleMobileTools:Simple-Commons:7ad1d7c4db'
implementation 'org.greenrobot:eventbus:3.2.0'
implementation 'androidx.media:media:1.4.3'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'

View file

@ -721,6 +721,10 @@ class MusicService : Service(), MediaPlayer.OnPreparedListener, MediaPlayer.OnEr
if (mPlayOnPrepare) {
mp.start()
requestAudioFocus()
if (mIsThirdPartyIntent) {
trackChanged()
}
} else if (mSetProgressOnPrepare > 0) {
mPlayer?.seekTo(mSetProgressOnPrepare)
broadcastTrackProgress(mSetProgressOnPrepare / 1000)