mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
53e9c499a4
commit
b94312b3e1
@ -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'
|
||||
|
@ -25,8 +25,8 @@ object AudioPlay {
|
||||
var bookSource: BookSource? = null
|
||||
val loadingChapters = arrayListOf<Int>()
|
||||
|
||||
fun headers(): Map<String, String>? {
|
||||
return bookSource?.getHeaderMap()
|
||||
fun headers(hasLoginHeader: Boolean): Map<String, String>? {
|
||||
return bookSource?.getHeaderMap(hasLoginHeader)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user