pull/1296/head
gedoor 3 years ago
parent bd0de92869
commit ef2b0f9cd1
  1. 1
      app/src/main/java/io/legado/app/model/AudioPlay.kt
  2. 9
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt
  3. 4
      app/src/main/java/io/legado/app/service/AudioPlayService.kt

@ -37,7 +37,6 @@ object AudioPlay {
durChapter?.let {
context.startService<AudioPlayService> {
action = IntentAction.play
}
}
}

@ -314,6 +314,9 @@ class AnalyzeUrl(
}
}
/**
* 访问网站,返回StrResponse
*/
suspend fun getStrResponse(
jsStr: String? = null,
sourceRegex: String? = null,
@ -349,6 +352,9 @@ class AnalyzeUrl(
}
}
/**
* 访问网站,返回ByteArray
*/
suspend fun getByteArray(): ByteArray {
judgmentConcurrent()
setCookie(source?.getStoreUrl())
@ -369,6 +375,9 @@ class AnalyzeUrl(
}.bytes()
}
/**
* 上传文件
*/
suspend fun upload(fileName: String, file: ByteArray, contentType: String): StrResponse {
return getProxyClient(proxy).newCallStrResponse(retry) {
url(url)

@ -115,6 +115,9 @@ class AudioPlayService : BaseService(),
postEvent(EventBus.AUDIO_STATE, Status.STOP)
}
/**
* 播放音频
*/
private fun play() {
upNotification()
if (requestFocus()) {
@ -122,7 +125,6 @@ class AudioPlayService : BaseService(),
AudioPlay.status = Status.STOP
postEvent(EventBus.AUDIO_STATE, Status.STOP)
upPlayProgressJob?.cancel()
exoPlayer.clearMediaItems()
val analyzeUrl =
AnalyzeUrl(
url,

Loading…
Cancel
Save