pull/42/head
kunfei 5 years ago
parent cc5c6b63f0
commit ba348b64c1
  1. 11
      app/src/main/java/io/legado/app/service/HttpReadAloudService.kt

@ -97,9 +97,14 @@ class HttpReadAloudService : BaseReadAloudService(),
private fun playAudio(fd: FileDescriptor) {
if (playingIndex != nowSpeak) {
playingIndex = nowSpeak
mediaPlayer.reset()
mediaPlayer.setDataSource(fd)
mediaPlayer.prepareAsync()
try {
mediaPlayer.reset()
mediaPlayer.setDataSource(fd)
mediaPlayer.prepareAsync()
} catch (e: Exception) {
e.printStackTrace()
toast(e.localizedMessage)
}
}
}

Loading…
Cancel
Save