Reputation: 3400
I build a little Android library in Eclipse, that open new Activity, put inside it WebView and load into WebView html page with video. I'm using WebView like:
webView.setWebChromeClient(new WebChromeClient() {
@Override
public void onProgressChanged(WebView view, int newProgress) {
if (newProgress == 100) {
showContentOrLoadingIndicator(true);
}
}
});
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});
and
webView.loadUrl("http://www.example.com/mobile/player/" + VeediUtils.GAME_ID + "/" + ((JSONObject)VeediUtils.LEVELS.get(gameLevel - 1)).getInt("unique_id") + ".html" + ((debugState == 0) ? ("") : ("?debug=veedi")));
Next step, I had built new project, added my first project like a Android dependency, and all works ok, how it should. But when I gave my library to other developer (I don't have access to his code) and he added it like Android dependency to his project, he found an issue: there is he hear sound but instead of video he see black screen. So here the question: what it can be in his application, that break my video in WebView? Thanks.
Upvotes: 0
Views: 1171
Reputation: 12358
The webview does not properly support HTML5 video.
See here for a library for proper video support.
If the video is in flash format, it will not work on android 4.4 and up. Otherwise, the user needs to have flashplayer installed, and you need to enable plugins in your webview.
Upvotes: 1