6

My App has a WebView which loads a simple html. However, this html links to a rtsp live video stream and the WebView isn't able to load it, instead it returns a "Web Page Not Available" message. When I open the rtsp link in the native Android browser, it loads and works fine so I know it's not the video stream being incompatible. Is there something within WebView which can be enabled to allow the rtsp video stream to be played?

Thanks!

CPess
  • 61
  • 1
  • 3

1 Answers1

3

I used this code:

public boolean shouldOverrideUrlLoading(WebView view, String url) {
         view.loadUrl(url);

         if (url.contains("rtsp")) {
                Uri uri = Uri.parse(url);
                    Intent intent = new Intent(Intent.ACTION_VIEW, uri);

                    startActivity(intent);
         }

       return true;
    }
TheLD
  • 2,211
  • 4
  • 21
  • 26