So, I have a web server that has an linked video on it, I have it accessed to my Web view, and I can play the video using HTML5 Player, but the problem is, the video must be played by a video player application that is installed on my phone... How do I achieve this?
I have tried searching, people seems like to use Youtube Video Player or HTML5 Player, not using their video player application, so I got nothing...
Update
So, after I tried to implement method suggested by @EricHo
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.contains("mp4")) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(url), "video/mp4");
startActivity(intent);
return true;
}
return false;
}
});
What I got is, the player that playing the video is the one that built in by Chrome, not by the Android Video Player itself Photo 1, besides what I expect is The video will be played by gallery instead of Chrome player
If necessary, here is my index.html source code
<!DOCTYPE HTML>
<!DOCTYPE html>
<html>
<head>
<title>video</title>
<script type="text/javascript" src="src.js"></script>
<link rel="stylesheet" type="text/css" href="src.css">
</head>
<body bgcolor="#333">
<center>
<video controls preload="metadata" style=" width:px; height:px;">
<source src="video-url" type="video/mp4">
</video><br />
</body>
</html>