|
|
@ -26,6 +26,7 @@ import io.legado.app.data.entities.BookChapter |
|
|
|
import io.legado.app.help.BookHelp |
|
|
|
import io.legado.app.help.BookHelp |
|
|
|
import io.legado.app.help.IntentHelp |
|
|
|
import io.legado.app.help.IntentHelp |
|
|
|
import io.legado.app.help.MediaHelp |
|
|
|
import io.legado.app.help.MediaHelp |
|
|
|
|
|
|
|
import io.legado.app.model.analyzeRule.AnalyzeUrl |
|
|
|
import io.legado.app.receiver.MediaButtonReceiver |
|
|
|
import io.legado.app.receiver.MediaButtonReceiver |
|
|
|
import io.legado.app.service.help.AudioPlay |
|
|
|
import io.legado.app.service.help.AudioPlay |
|
|
|
import io.legado.app.ui.audio.AudioPlayActivity |
|
|
|
import io.legado.app.ui.audio.AudioPlayActivity |
|
|
@ -121,8 +122,10 @@ class AudioPlayService : BaseService(), |
|
|
|
AudioPlay.status = Status.PLAY |
|
|
|
AudioPlay.status = Status.PLAY |
|
|
|
postEvent(Bus.AUDIO_STATE, Status.PLAY) |
|
|
|
postEvent(Bus.AUDIO_STATE, Status.PLAY) |
|
|
|
mediaPlayer.reset() |
|
|
|
mediaPlayer.reset() |
|
|
|
val uri = Uri.parse(url) |
|
|
|
val analyzeUrl = |
|
|
|
mediaPlayer.setDataSource(this, uri, AudioPlay.headers()) |
|
|
|
AnalyzeUrl(url, headerMapF = AudioPlay.headers(), useWebView = true) |
|
|
|
|
|
|
|
val uri = Uri.parse(analyzeUrl.url) |
|
|
|
|
|
|
|
mediaPlayer.setDataSource(this, uri, analyzeUrl.headerMap) |
|
|
|
mediaPlayer.prepareAsync() |
|
|
|
mediaPlayer.prepareAsync() |
|
|
|
} catch (e: Exception) { |
|
|
|
} catch (e: Exception) { |
|
|
|
launch { |
|
|
|
launch { |
|
|
|