|
|
@ -24,6 +24,7 @@ import io.legado.app.help.IntentHelp |
|
|
|
import io.legado.app.help.MediaHelp |
|
|
|
import io.legado.app.help.MediaHelp |
|
|
|
import io.legado.app.receiver.MediaButtonReceiver |
|
|
|
import io.legado.app.receiver.MediaButtonReceiver |
|
|
|
import io.legado.app.ui.book.read.ReadBookActivity |
|
|
|
import io.legado.app.ui.book.read.ReadBookActivity |
|
|
|
|
|
|
|
import io.legado.app.utils.LogUtils |
|
|
|
import io.legado.app.utils.postEvent |
|
|
|
import io.legado.app.utils.postEvent |
|
|
|
import kotlinx.coroutines.launch |
|
|
|
import kotlinx.coroutines.launch |
|
|
|
import org.jetbrains.anko.toast |
|
|
|
import org.jetbrains.anko.toast |
|
|
@ -107,6 +108,7 @@ class AudioPlayService : BaseService(), |
|
|
|
mediaPlayer.setDataSource(url) |
|
|
|
mediaPlayer.setDataSource(url) |
|
|
|
mediaPlayer.prepareAsync() |
|
|
|
mediaPlayer.prepareAsync() |
|
|
|
} catch (e: Exception) { |
|
|
|
} catch (e: Exception) { |
|
|
|
|
|
|
|
LogUtils.d("AudioPlayService", e.localizedMessage + " " + url) |
|
|
|
launch { |
|
|
|
launch { |
|
|
|
toast(e.localizedMessage + " " + url) |
|
|
|
toast(e.localizedMessage + " " + url) |
|
|
|
stopSelf() |
|
|
|
stopSelf() |
|
|
|