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!
-
Can you share the url..? – yash786 Jul 10 '19 at 08:16
-
try to play video using this library https://github.com/tcking/GiraffePlayer2 – Rahul Khurana Jul 10 '19 at 08:18
-
Yes. sure "http://www.kuiber.com/images/stories/1557736976-9002.mp4"(not work) and this is working url "https://developers.google.com/training/images/tacoma_narrows.mp4" – Najib.Nj Jul 10 '19 at 08:18
3 Answers
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.

- 176
- 5
-
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
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>

- 2,935
- 2
- 8
- 18
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.

- 29,388
- 11
- 94
- 103

- 1
- 1