How do I disable download option from CustomWebView for audio files?

Hello guys, I am using CustomWebView to navigate trough a private website to give access to some multimedia files but I want the user may access them in streaming mode without the possibility to download them, so is there a way to disable the Download option as reported in the next image? This is what shown for an audio file, I do not know if there is an hidden option of CustomWebView or may depend by the default player on my Android device. Actually the files are hosted in a normal web site, I did not install a streaming server, so may be I can not stop the user to download the file.

Hi Massimo

It's not the website that is offering the download?

Mmmm... no. I published some multimedia files on one of my websites just for testing the app. I did not setup a streaming server. If I remember well I can not install a streaming server. Yes, installing a sreaming server will solve the problem on server side.

add this :
inside your audio tag.

Do you mean on server side?

You can't disable download but you can let user not download the file.
Whenever OnDownloadNeeded event is invoked then check download url's mime type and if it is a kind of audio file then load html with an audio attribute in its body where source is set to download url.
You can do same for video and image files.

1 Like

If the audio files are either embedded or linked to by your site:

1 Like

Mmmm... actually I manage only the CustomWebView OnReceivedHttpAuthRequest event, others have just a print-debug feature I used to understand and test the component at beginning. Seems that without adding anything else the app does not download the files. I tried to play some of them. Also if I click on Download while it is playing nothing visible happens (some end of download notification) and at the end I do not find the file inside the smartphone, I searched it... but I did not find it.

Right. Extension doesn't automatically download file.

Perfect, so I did not have the problem since the beginning... :upside_down_face:

If I understoood well this works only for Chrome based browsers not for Mozilla Firefox and others, anyway it is useful to add this option and test how it works.

It works at least with FireFox too, they have their own advice on using it, but it's not mentioned by ww3 (at least, I could not find any mention) so it is non-standard and that could mean that other browsers will just skip past it.

OK, better to know also Firefox implements this management. As you may imagine I am testing the app so I scheduled some more tests to verify this behaviour with several browsers, at least the most common, and eventually find/add other ways to prevent downloading just in case some of them permit the download.

Interesting here:

You might also look for a script that can encrypt the files.

That option has to do with Chromium. You can use a custom player interface like which does not include a download button.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.