user962206
user962206

Reputation: 16147

How to obfuscate the src attribute of an audio tag

I am currently building a web application where I would be playing a user uploaded files, where the user uploaded files can be only streamed. The Problem is how would I hide or obfuscate the audio tag src attribute but at the same time the audio file can still be streamed/played and retrieved from the database?

The main purpose of this is that I want to source of the audio file.

Upvotes: 0

Views: 745

Answers (2)

youness belfkih
youness belfkih

Reputation: 9

  • maybe you should use the web Audio API GETTING STARTED WITH THE AUDIOCONTEXT

    OR
  • use a server-side script (php) to load only in some circumstance for example you can make your website save a cookie in the user's browser and when you want to load the files pass it value on the link*

*: i forgot that cookies are sent with the request to the server (in php: use $_COOKIE super global )

Upvotes: 0

Mark Bessey
Mark Bessey

Reputation: 19782

There's no sensible way to accomplish what you say you want to do. If the element can find the file, so can any user with debugging tools enabled in their browser. What's the purpose you're trying to serve by obscuring the URL to the source?

Upvotes: 3

Related Questions