I have an issue to load an video on Webview which is show green screen
I used CustomView also like that
@Override
public void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback)
{
Log.e("@@@view",""+"Voirwe");
if (view == null) {
return;
}
Log.e("@@@view1",""+"customView");
if (customView != null && callback != null) {
callback.onCustomViewHidden();
return;
}
customView = view;
fullscreenHolder = new FrameLayout(context);
fullscreenHolder.addView(
customView,
new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.MATCH_PARENT
));
FrameLayout decorView = (FrameLayout) getWindow().getDecorView();
decorView.addView(
fullscreenHolder,
new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.MATCH_PARENT
));
customView.setKeepScreenOn(true);
((View) currentAlbumController).setVisibility(View.GONE);
setCustomFullscreen(true);
if (view instanceof FrameLayout) {
if (((FrameLayout) view).getFocusedChild() instanceof VideoView) {
videoView = (VideoView) ((FrameLayout) view).getFocusedChild();
videoView.setOnErrorListener(new VideoCompletionListener());
videoView.setOnCompletionListener(new VideoCompletionListener());
}
}
fullscreenHolder.bringToFront();
}
@Override
public void onHideCustomView() {
Log.e("@@@view","hide");
FrameLayout decorView = (FrameLayout) getWindow().getDecorView();
decorView.removeView(fullscreenHolder);
customView.setKeepScreenOn(false);
((View) currentAlbumController).setVisibility(View.VISIBLE);
setCustomFullscreen(false);
fullscreenHolder = null;
customView = null;
if (videoView != null) {
videoView.setOnErrorListener(null);
videoView.setOnCompletionListener(null);
videoView = null;
}
contentFrame.requestFocus();
}
from Green Screen Show while playing video on Webview on Some Android TV

No comments:
Post a Comment