exoplayer

Exoplayer2实现边播放边缓存

陌路散爱 提交于 2020-08-13 12:15:41
前言 ExoPlayer是Google开源的一款Android应用程序级的媒体播放器。它提供了Android MediaPlayer API的替代方法,可以在本地和Internet上播放音频和视频。ExoPlayer支持Android MediaPlayer API当前不支持的功能,包括DASH和SmoothStreaming自适应播放。与MediaPlayer API不同,ExoPlayer易于自定义和扩展。这里主要使用 ExoPlayer + AndroidVideoCache 实现边播放边缓存。下面点击可查看对应库和文档。 ExoPlayer ExoPlayer Javadoc ExoPlayer Release AndroidVideoCache 效果 ExoPlayer使用 添加ExoPlayer与AndroidVideoCache依赖,我这边使用的是ExoPlayer v2.10.5和AndroidVideoCache v2.7.1版本,可根据自身需求升级或降级。 // ExoPlayer implementation 'com.google.android.exoplayer:exoplayer-core:2.10.5' implementation 'com.google.android.exoplayer:exoplayer-ui:2.10.5' //

ExoPlayer PlayerView OnClickListener not working

谁说我不能喝 提交于 2020-06-25 03:50:10
问题 In my app, I want to handle user click on PlayerView however OnClickListener not being called and no exception is thrown. I added app:use_controller="false" to XML PlayerView . I tried to set OnTouchListener but I need MotionEvent.ACTION_UP to be called which is also not happening(because I don't want to handle the case when the user is scrolling, I need to handle the case when the user taps on PlayerView). class FeedHolder extends RecyclerView.ViewHolder { private TextView displayName,