I am trying to implement a web browser within my app and using
WebView
for that.
For playing youtube video I used the following resource to start
playing the video:
http://stackoverflow.com/questions/3815090/webview-and-html5-video
This implements basically a webChromeClient and the function
onShowCustomView to
play the video.

In addition, to stay in the webView when a link is pressed and not go
to the web
browser, I had to add a webviewclient with
   @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url)
{
        view.loadUrl(url);
        return true;
    }

This seems to work well if I am touching the screen to start the
video.
However if I call webView.dispatchKeyEvent to navigate to the video
image on the screen and then send a dispatchKeyEvent
KEYCODE_DPAD_CENTER Down followed by up, the image shows loading and
stays in the same state. So it did react to this key event but did
not
start playing the video.


I noticed that if I touch on the video image, onShowCustomView is
called in WebChromeClient. However, if the a KEYCODE_DPAD_CENTER is
sent to the selected video image, shouldOverrideUrlLoading is called.
Can anyone help how to get this video playing with a
dispatchKeyEvent ?

Thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to