I have a system that has HTML + GWT in the front-end, and a Java on the back-end. The back-end can already send WAV files currently, in its entirety, and the front-end needs to be able to play it, and not to allow any form of downloading due to security/privacy concerns. This can be achieved partly with the standard HTML5 audio tag.
The problems I'm facing are:
I can deactivate downloading on the audio tag by adding
controlsList="nodownload", but that is easily circumvented by removing this tag on Developer Tools of Chrome, which will pop-up the Download button right backThe file is cached in its entirety as soon as its played, regardless of any
preloadvalues I try. Then, it's just a matter of finding the right file inC:/Users/AppData/Local/Google/Chrome/User Data/ Default/Cache/Cache_data, adding the WAV extension, and playing it
Thoughts:
I'm thinking that maybe a streaming solution could work, where either there's no cache at all, or segmented and sequential caches (such as Netflix), which can make it hard for the user to link them all together
I've seen an option to encrypt audio in the back-end, and decrypt on the front-end with Encrypted Media Extensions (https://web.dev/articles/eme-basics), though I'm afraid that even after all this development the cache will exist locally whenever the file is played
I've seen that if I manage the audio playing with Javascript and using the Web Audio API (https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API), it can handle streaming, though I'm not sure how the cache would work here.
I've seen paid plugins that can do this, though I'm leaning towards a solution using open source code. But in the end if it's too much of a hassle, I would reconsider.
Any ideas? Thanks.