0
votes

Hope you are doing well.

As it is an arrow to the knee with playing Flash(R) files inside webview I want to accomplish the following:

Whenever there is an embedded video file on a webpage I want to open a dialog after the user clicked the file, so he or she can open this in the external media player app of his/her choice.

I never found something useful in using Flash in webview, I also read that it is simply not supported. So it is like gambling with webview and videos. I want to end this here.

Also, if you think there are better and/or more elegant ways in solving this problem, please let me know!

Thank you very much in advance!

Regards

[Update I & II, 10/28/13]

Okay, I included WebChromeClient before WebViewClient.

I also read that flv is simply not supported anymore which is a good thing in general.

Q: What are you doing in your app using webview when there are embedded video files on a webpage? What is the "default todo" in these cases??

I am able to fire the media player intent now, but of course it quits saying "can not play video file".

Ideas??

1

1 Answers

2
votes

Found out you can use this code:

//enable downloads of files within webView
webView.setDownloadListener(new DownloadListener() {
public void onDownloadStart(String url, String userAgent,
              String contentDisposition, String mimetype,
              long contentLength) {
              Intent i = new Intent(Intent.ACTION_VIEW);
              i.setData(Uri.parse(url));
              startActivity(i);
 }
});

Where "webView" is just the name you gave your browser. And after all those getSettings()

Hope this helps.