Reputation: 549
I have simple HTML code which play a video
<video src="">
<video controls src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"
poster="http://sandbox.thewikies.com/vfe-generator/images/big-buck-bunny_poster.jpg"
width="540" height="360">
</video>
I want to hide src
attribute of video tag when someone open inspector/inspect element of browser.
Upvotes: 6
Views: 8053
Reputation: 91
If you actually want to protect your files from being downloaded you should consider using a streaming service and not http delivery. With HLS or MPEG-DASH you can DRM your content with encryption keys. Otherwise there is no way, think how Youtube and Vimeo can't stop people from downloading their files...
Upvotes: 4
Reputation: 3593
That is simply not possible.
If you want the browser to play the video, you have to tell him the url.
If you've send the url to the client, the user can grab it.
even if you obfuscate the url, and decode it in JS, as soon as my browser requests the video, I can grab the url in the network-logs of my dev-tools.
Upvotes: 4