[cos]
[添加下载功能]
This commit is contained in:
yangyakun
2026-04-01 20:14:05 +08:00
parent dc0cc9c738
commit c4b9484e94
2 changed files with 23 additions and 12 deletions

View File

@@ -25,6 +25,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
import com.mogo.eagle.core.utilcode.util.ToastUtils import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.zhidao.loglib.download.DownloadManager import com.zhidao.loglib.download.DownloadManager
import com.zhidao.loglib.download.OnDownloadListener
import com.zhjt.mogo_core_function_devatools.R import com.zhjt.mogo_core_function_devatools.R
import com.zhjt.mogo_core_function_devatools.badcase.biz.adapter.BagManagerListAdapter import com.zhjt.mogo_core_function_devatools.badcase.biz.adapter.BagManagerListAdapter
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
@@ -219,19 +220,29 @@ class BadCaseManagerView @JvmOverloads constructor(
} }
override fun bagAudio(key: Long, audioUrl: String) { override fun bagAudio(key: Long, audioUrl: String) {
DownloadManager.getInstance().init(context) DownloadManager.getInstance().init(context,true)
val downUrl = audioUrl.replace("http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/","") val downUrl = audioUrl.replace("http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/","")
DownloadManager.getInstance().download(downUrl, DownloadManager.getInstance().download(downUrl,
audioSavePath,"${key}.wav") audioSavePath,"${key}.wav",object :OnDownloadListener{
//延迟播放 override fun onProgress(progress: Float) {
Handler().postDelayed({
//音频文件播放 }
try {
Audition.getInstance().playOrStop("${audioSavePath}${key}.wav") override fun onSuccess(localPath: String?) {
}catch (e: Exception){ UiThreadHandler.post({
CallerLogger.i(M_DEVA + TAG,"playOrStop=${e}") try {
} Audition.getInstance().playOrStop("${audioSavePath}${key}.wav")
}, 1500) }catch (e: Exception){
CallerLogger.i(M_DEVA + TAG,"playOrStop=${e}")
}
},UiThreadHandler.MODE.QUEUE)
}
override fun onFailed(reason: String?) {
}
})
} }
override fun lookMapScreen(key: Long) { override fun lookMapScreen(key: Long) {

View File

@@ -61,7 +61,7 @@ bytex.ASM_API=ASM7
################ 外部依赖引用 ################w ################ 外部依赖引用 ################w
# loglib # loglib
LOGLIB_VERSION=1.10.20 LOGLIB_VERSION=1.10.22
######## MogoAiCloudSDK Version ######## ######## MogoAiCloudSDK Version ########
# 网络请求LOGLIB_VERSION # 网络请求LOGLIB_VERSION
MOGO_NETWORK_VERSION=1.4.7.65 MOGO_NETWORK_VERSION=1.4.7.65