[M2] 视频下载网络中断问题处理

This commit is contained in:
wangmingjun
2023-03-09 21:58:49 +08:00
parent 4513f98220
commit be622a01ac

View File

@@ -207,10 +207,15 @@ class AdvanceVideoView @JvmOverloads constructor(
}
override fun onFinished(url: String?, threadBean: ThreadBean?) {
Logger.d(ImageAndVideoRotation.TAG, "download-onFinished")
//下载完成
ThreadUtils.runOnUiThread {
startPlay()
Logger.d(ImageAndVideoRotation.TAG, "download-onFinished = $url")
if (url.equals(fileNetPath)){ //发现下载工具在断网又连网后,任务又都排队下载,跳转播放出现问题
//下载完成
ThreadUtils.runOnUiThread {
startPlay()
}
}else{//再次去下载当前的
startDownLoadVideo()
Logger.d(ImageAndVideoRotation.TAG, "download-onFinished = not current video")
}
}