Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7171715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:28:10+00:00 2026-05-28T15:28:10+00:00

I have an app that is displaying a webpage using a WebView control. I

  • 0

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
http://www.mobilityinitiative-test.com/images/stories/videos/Synergy.mp4

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:28:10+00:00Added an answer on May 28, 2026 at 3:28 pm

    override the shouldOverrideUrlLoading() function in your custom WebChromeClient().

    @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url)
            {
                //handle all audio and video links to mp3, mp4 and 3gp files
                if (url.contains(".mp3"))
                {
                    Intent intent = new Intent(Intent.ACTION_VIEW);
                    intent.setDataAndType(Uri.parse(url), "audio/*");
                    view.getContext().startActivity(intent);
                    return true;
                }
                else if (url.contains(".mp4") || url.contains(".3gp"))
                {
                    Intent intent = new Intent(Intent.ACTION_VIEW);
                    intent.setDataAndType(Uri.parse(url), "video/*");
                    view.getContext().startActivity(intent);
                    return true;
                }
                else
                {
                    return super.shouldOverrideUrlLoading(view, url);
                }
    
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web page that is being displaying in a winform app using
I have a WCF web-service and a Silverlight app displaying data from that service.
I have an iPhone app, where I'm displaying a tableview, that's loaded from an
I have a app that I'm deploying to a development server using Capistrano. I'd
I have an App that will send authenticated emails using System.Net.Mail and System.Net.NetworkCredential my
I have a facebook app that is displaying random quotes - it is written
I've noticed that emojis in my app have stopped displaying properly on a UIWebView
I have a .net WinForms app with buttons that are displaying as XP style
I'm looking at displaying a map within my Android app that presents maritime charts,
I have an iPhone app that grabs information from different sources in XML format.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.