如何解决我已经使用ExoPlayer开发了一个应用程序,但是它的缓存太多,互联网速度为15 Mb / s
我使用ExoPlayer
开发了一个应用程序,但无法解决太多的缓冲速度。
这是我的代码示例:
// this will call when swipe for another video and
// this function will set the player to the current video
HttpProxyCacheServer proxy = TicTic.getProxy(context);
String proxyUrl = proxy.getProxyUrl((data_list.get(currentPage+1).video_url));
LoadControl loadControl = new DefaultLoadControl.Builder()
.setAllocator(new DefaultAllocator(true,16))
.setBufferDurationsMs(1*1024,1*1024,500,1024)
.setTargetBufferBytes(-1)
.setPrioritizeTimeOverSizeThresholds(true)
.createDefaultLoadControl();
DefaultTrackSelector trackSelector = new DefaultTrackSelector();
cache_player = ExoPlayerFactory.newSimpleInstance(context,trackSelector,loadControl);
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(context,Util.getUserAgent(context,context.getResources().getString(R.string.app_name)));
MediaSource videoSource = new ExtractorMediaSource.Factory(dataSourceFactory)
.createMediaSource(Uri.parse(proxyUrl));
cache_player.prepare(videoSource);
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。