danikula / danikula/AndroidVideoCache

with Android TV

Ouverte
#189 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Java
Étoiles
5.5k
Forks
1.2k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.