danikula / danikula/AndroidVideoCache

Change HttpProxyCacheServerClients to OkHttp

未关闭
#161 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
5.5k
派生
1.2k
PR 合并指标
30 天内没有已合并 PR

描述

Hi Guy!
I'm using AndroidVideoCache with ExoPlayer version 2.4.2
When i set up url to play with your library i get the error "Error opening connection for", but when i change datasource to OkHttpClient. It work well. Can you change your HttpClient of proxy to OkHttp or make more option to change the default client.
This is my Stacktrace . I've been changed my Video Url to "....." character to protect my content.
Hope you reply soon. Thanks
HttpProxyCacheServer: HttpProxyCacheServer error
com.danikula.videocache.ProxyCacheException: Error processing request. Version: 2.7.0
at com.danikula.videocache.HttpProxyCacheServer.processSocket(HttpProxyCacheServer.java:241)
at com.danikula.videocache.HttpProxyCacheServer.access$200(HttpProxyCacheServer.java:52)
at com.danikula.videocache.HttpProxyCacheServer$SocketProcessorRunnable.run(HttpProxyCacheServer.java:338)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by: com.danikula.videocache.ProxyCacheException: Error opening connection for http://.... with offset 221845464. Version: 2.7.0
at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:75)
at com.danikula.videocache.HttpProxyCache.responseWithoutCache(HttpProxyCache.java:89)
at com.danikula.videocache.HttpProxyCache.processRequest(HttpProxyCache.java:47)
at com.danikula.videocache.HttpProxyCacheServerClients.processRequest(HttpProxyCacheServerClients.java:42)
at com.danikula.videocache.HttpProxyCacheServer.processSocket(HttpProxyCacheServer.java:234)
at com.danikula.videocache.HttpProxyCacheServer.access$200(HttpProxyCacheServer.java:52) 
at com.danikula.videocache.HttpProxyCacheServer$SocketProcessorRunnable.run(HttpProxyCacheServer.java:338) 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422) 
at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
at java.lang.Thread.run(Thread.java:841) 
Caused by: java.io.FileNotFoundException: http://.....
at com.android.okhttp.internal.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:186)
at com.danikula.videocache.HttpUrlSource.open(HttpUrlSource.java:70)
at com.danikula.videocache.HttpProxyCache.responseWithoutCache(HttpProxyCache.java:89) 
at com.danikula.videocache.HttpProxyCache.processRequest(HttpProxyCache.java:47) 
at com.danikula.videocache.HttpProxyCacheServerClients.processRequest(HttpProxyCacheServerClients.java:42) 
at com.danikula.videocache.HttpProxyCacheServer.processSocket(HttpProxyCacheServer.java:234) 
at com.danikula.videocache.HttpProxyCacheServer.access$200(HttpProxyCacheServer.java:52) 
at com.danikula.videocache.HttpProxyCacheServer$SocketProcessorRunnable.run(HttpProxyCacheServer.java:338) 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422) 
at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
at java.lang.Thread.run(Thread.java:841) 
E/ExoPlayerImplInternal: Source error.
java.io.EOFException
at com.google.android.exoplayer2.extractor.DefaultExtractorInput.readFromDataSource(DefaultExtractorInput.java:262)
at com.google.android.exoplayer2.extractor.DefaultExtractorInput.skipFully(DefaultExtractorInput.java:98)
at com.google.android.exoplayer2.extractor.DefaultExtractorInput.skipFully(DefaultExtractorInput.java:107)
at com.google.android.exoplayer2.extractor.mkv.DefaultEbmlReader.read(DefaultEbmlReader.java:127)
at com.google.android.exoplayer2.extractor.mkv.MatroskaExtractor.read(MatroskaExtractor.java:387)
at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:652)
at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:295)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先,使用提供的堆栈跟踪以及与正常工作的 OkHttpClient 数据源的对比,跟踪失败的请求经过 HttpProxyCacheServerClients、HttpProxyCacheServer、HttpProxyCache 和 HttpUrlSource.open 的路径。确定如何替换代理的 HTTP 客户端,或使其可配置;当代理能够打开相同的 URL,并支持 range request 且不再出现报告的 ExoPlayer 源错误时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
android, java
领域
mobile-dev, networking
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。