I have an app that is displaying a webpage using a WebView control. I can’t get MP4 videos to play from within the WebView control and so I have to go a different route.
I am overriding the shouldOverrideUrlLoading method WebViewClient so that I can determine if the URL is an mp4 video link. If it is, I want to send the link to the android internal video player, otherwise, let it go on.
I could parse the string but I want to use the Uri class. I’m new to URL’s and don’t understand the format (components) of a URL. How can I determine if the following URL:
http://www.mobilityinitiative-test.com/images/stories/videos/Introduction.mp4
and
are in fact links to mp4 videos?
Once determined, what’s the best way to launch the internal video player? I’ve seen several ways.
override the
shouldOverrideUrlLoading()function in your customWebChromeClient().