android webview视频没有播放全屏模式

时间:2013-04-16 13:15:08

标签: android android-webview android-video-player android-websettings

我必须开发一个Android应用程序。其中webvicw视频播放良好..但如果我必须单击全屏模式意味着视频崩溃...我怎么能解决这些错误......

如何在全屏模式下播放视频?或者如何使用youtube播放器播放视频???请给我任何建议???

我使用下面的代码:

content.setWebChromeClient(new WebChromeClient());
final Activity activity = this;
    content.setWebChromeClient(new WebChromeClient(){
    public void onProgressChanged ( WebView view , int progress ){
        activity.setProgress(progress * 1000);
    }       
});

content.setWebViewClient(new WebViewClient(){
    public void onReceivedError ( WebView view , int errorCode , String description , String failingUrl ){
        Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show();
    }

});

content.setWebChromeClient(new WebChromeClient());

content.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
content.getSettings().setJavaScriptEnabled(true);
content.getSettings().setDomStorageEnabled(true);
content.getSettings().setPluginState(PluginState.ON);
content.loadDataWithBaseURL(null, full_content, "text/html", "utf-8", null);

1 个答案:

答案 0 :(得分:0)

我使用 youtube播放器API ...这对于Android developer.it来说很容易在全屏模式下播放。

相关问题