danikula / danikula/AndroidVideoCache
with Android TV
- Ngôn ngữ chính
- Java
- Star
- 5.5k
- Fork
- 1.2k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
I used this library with Android tv Project but don't work.
the application close.
**## first create class App**
import android.app.Application;
import android.content.Context;
import com.danikula.videocache.HttpProxyCacheServer
public class App extends Application {
private HttpProxyCacheServer proxy;
public static HttpProxyCacheServer getProxy(Context context) {
App app = (App) context.getApplicationContext();
return app.proxy == null ? (app.proxy = app.newProxy()) : app.proxy;
}
private HttpProxyCacheServer newProxy() {
return new HttpProxyCacheServer(this);
}
}
**## and play class**
public class PlaybackOverlayActivity extends Activity implements CacheListener {
private VideoView mVideoView;
...
public void setVideoPath(String videoUrl) {
try {
HttpProxyCacheServer proxy = App.getProxy(this);
proxy.registerCacheListener(this, videoUrl);
String proxyUrl = proxy.getProxyUrl(videoUrl);
setPosition(0);
mVideoView.setVideoPath(proxyUrl);
mStartTimeMillis = 0;
mDuration = Utils.getDuration(proxyUrl);
} catch (Exception e) {
toast(e.toString());
}
}
# the Err is
java.lang.ClassCastException:Android.app.application cannot be cast to (package name).App
thinx
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Start with the App and PlaybackOverlayActivity snippets in the issue, then inspect the Android application configuration involved in creating the Application instance. Reproduce the Android TV launch and follow the ClassCastException before the proxy setup. Done means the application starts without this cast error and playback setup can proceed.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- android, java
- Lĩnh vực
- mobile-dev
- Loại issue
- Lỗi
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100