diff --git a/app/build.gradle b/app/build.gradle index 1ec179663..35a454b51 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -153,10 +153,6 @@ dependencies { def exoplayer_version = '2.15.0' implementation "com.google.android.exoplayer:exoplayer-core:$exoplayer_version" implementation "com.google.android.exoplayer:extension-okhttp:$exoplayer_version" -// implementation "com.google.android.exoplayer:exoplayer-hls:$exoplayer_version" -// implementation "com.google.android.exoplayer:exoplayer-smoothstreaming:$exoplayer_version" -// implementation "com.google.android.exoplayer:exoplayer-dash:$exoplayer_version" -// implementation "com.google.android.exoplayer:exoplayer-rtsp:$exoplayer_version" //Splitties def splitties_version = '2.1.1' diff --git a/app/src/main/java/io/legado/app/model/AudioPlay.kt b/app/src/main/java/io/legado/app/model/AudioPlay.kt index f668067c2..a850301fc 100644 --- a/app/src/main/java/io/legado/app/model/AudioPlay.kt +++ b/app/src/main/java/io/legado/app/model/AudioPlay.kt @@ -25,8 +25,8 @@ object AudioPlay { var bookSource: BookSource? = null val loadingChapters = arrayListOf() - fun headers(): Map? { - return bookSource?.getHeaderMap() + fun headers(hasLoginHeader: Boolean): Map? { + return bookSource?.getHeaderMap(hasLoginHeader) } /** diff --git a/app/src/main/java/io/legado/app/service/AudioPlayService.kt b/app/src/main/java/io/legado/app/service/AudioPlayService.kt index 332a5b1e2..332343feb 100644 --- a/app/src/main/java/io/legado/app/service/AudioPlayService.kt +++ b/app/src/main/java/io/legado/app/service/AudioPlayService.kt @@ -125,12 +125,11 @@ class AudioPlayService : BaseService(), AudioPlay.status = Status.STOP postEvent(EventBus.AUDIO_STATE, Status.STOP) upPlayProgressJob?.cancel() - val analyzeUrl = - AnalyzeUrl( - url, - headerMapF = AudioPlay.headers(), - source = AudioPlay.bookSource - ) + val analyzeUrl = AnalyzeUrl( + url, + headerMapF = AudioPlay.headers(true), + source = AudioPlay.bookSource + ) val uri = Uri.parse(analyzeUrl.getDirectUrl()) val mediaSource = ExoPlayerHelper .createMediaSource(uri, analyzeUrl.headerMap)