Skip to content

Instantly share code, notes, and snippets.

@rhumlover
Created March 7, 2013 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rhumlover/5109983 to your computer and use it in GitHub Desktop.
Save rhumlover/5109983 to your computer and use it in GitHub Desktop.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView wview = (WebView) findViewById(R.id.webviewD);
wview.setWebChromeClient(new WebChromeClient(){
@Override
public void onShowCustomView(View view, CustomViewCallback callback) {
super.onShowCustomView(view, callback);
if (view instanceof FrameLayout){
FrameLayout frame = (FrameLayout) view;
if (frame.getFocusedChild() instanceof VideoView){
VideoView video = (VideoView) frame.getFocusedChild();
frame.removeView(video);
MainActivity.this.setContentView(video);
video.start();
}
}
}
});
WebSettings webSettings = wview.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setPluginsEnabled(true);
webSettings.setRenderPriority(RenderPriority.HIGH);
wview.loadUrl("http://orange.jobs/jobs/mobi.do?do=getOffer&lang=FR&id=28866");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment