-3

First activity of my app has a webview with some YouTube videos links. I want to know is this possible if user clicking on video link in webview, app can play that video in second activity with YouTube Android library.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115

1 Answers1

0

Providing some code snippets could help. Override your webClient's shouldOverrideUrlLoading(WebView view, WebResourceRequest request) method.

There you can get the url thats about to be loaded using request.getUrl() and check it's a valid Youtube Url. Showing the youtube video depends on the availability of the youtube app.

Check the Youtube docs and this SOF question.

Umar Ahmed
  • 163
  • 1
  • 5
  • 8