音频预缓存

This commit is contained in:
ag2s20150909
2022-04-24 17:10:13 +08:00
parent 00e8cce519
commit 5a441915fc

View File

@@ -140,6 +140,8 @@ class AudioPlayService : BaseService(),
)
val uri = Uri.parse(analyzeUrl.url)
ExoPlayerHelper.preDownload(uri, analyzeUrl.headerMap)
//休息1秒钟防止403
Thread.sleep(1000)
val mediaSource = ExoPlayerHelper
.createMediaSource(uri, analyzeUrl.headerMap)
exoPlayer.setMediaSource(mediaSource)