我正在使用Exoplayer2播放mp3文件。我尝试播放本地文件和远程文件,但是播放远程文件时看不到搜寻栏的可拖动拇指。这是我的代码:
val renderersFactory = DefaultRenderersFactory(this,
DefaultRenderersFactory.EXTENSION_RENDERER_MODE_OFF)
val mediaUri = Uri.parse("http://path/to/sample.mp3")
val mediaUri2 = Uri.parse("asset:///sample.mp3")
val dataSourceFactory = DefaultDataSourceFactory(this, Util.getUserAgent(this, USER_AGENT), BANDWIDTH_METER)
val sample1 = ExtractorMediaSource.Factory(dataSourceFactory).createMediaSource(mediaUri)
val sample2 = ExtractorMediaSource.Factory(dataSourceFactory).createMediaSource(mediaUri2)
val playlist = ConcatenatingMediaSource(sample1, sample2)
player = ExoPlayerFactory.newSimpleInstance(renderersFactory, TRACK_SELECTOR)
player.prepare(playlist)
我想知道我做错了什么,感谢您的帮助!