danikula / danikula/AndroidVideoCache
with Android TV
- 主要言語
- Java
- スター
- 5.5k
- フォーク
- 1.2k
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
まず issue 内の App と PlaybackOverlayActivity のスニペットから始め、次に Application インスタンスの作成に関係する Android アプリケーションの設定を調べます。Android TV の起動を再現し、proxy の設定前まで ClassCastException を追跡します。この cast エラーなしでアプリケーションが起動し、再生の設定を進められれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- android, java
- 領域
- mobile-dev
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100