0

I have face one issue Video mp4 url work in WebView but i took VideoView inside not working url message popup "Sorry, this url is not working". Whats the exactly issue i don't know? You know this kind of solution then please help me. And share your great experience. Thank You!

Najib.Nj
  • 3,706
  • 1
  • 25
  • 39

3 Answers3

1

It has something to do with your link and content. Try the following two links: String path="http://www.ted.com/talks/download/video/8584/talk/761"; String path1="http://commonsware.com/misc/test2.3gp";

Uri uri=Uri.parse(path1);

VideoView video=(VideoView)findViewById(R.id.VideoView01);
video.setVideoURI(uri);
video.start();

Start with "path1", it is a small light weight video stream and then try the "path", it is a higher resolution than "path1", a perfect high resolution for the mobile phone.

  • No, this is not working. I have different issue url video view. i already did this type of code. another solution.plz. – Najib.Nj Jul 10 '19 at 08:34
0

It looks like only secure URLs are working(developers.google.com/training/images/tacoma_narrows.mp4 uses HTTPS while "kuiber.com/images/stories/1557736976-9002.mp4 use HTTP)

According to docs

Starting with Android 9 (API level 28), cleartext support is disabled by default.

Therefore you must set the property android:usesCleartextTraffic to true

android:usesCleartextTraffic

Indicates whether the app intends to use cleartext network traffic, such as cleartext HTTP. The default value for apps that target API level 27 or lower is "true". Apps that target API level 28 or higher default to "false".

To solve the problem, use android:usesCleartextTraffic="true" inside the application tag in your manifest

<application
     ...
     android:usesCleartextTraffic="true"
     ...>
     ...
</application>
sanoJ
  • 2,935
  • 2
  • 8
  • 18
0

It has something to do with your link and content. Try the following two links:

String path="http://www.ted.com/talks/download/video/8584/talk/761"; 
String path1="http://commonsware.com/misc/test2.3gp";

Uri uri=Uri.parse(path1);

VideoView video=(VideoView)findViewById(R.id.VideoView01);
video.setVideoURI(uri);
video.start();

Start with path1, it is a small light weight video stream and then try the path, it is a higher resolution than path1, a perfect high resolution for the mobile phone.

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103