Vartika
Vartika

Reputation: 1095

prevent html5 video from being downloaded through inspect element

We have a module in our project where there is an option of uploading mp4 videos , we are using html5 video tag player for playing the videos.

Problem we are facing is the privacy of the videos.At the time its very easy for the user to download our file either through right click save as video or by taking the url from the src of the video tag by inspect element. To do so I have studied a lot, and got the idea about the blob url through youtube videos which are not accesible through anyway. I tried to study about the blob-url, created one for my video url but still they are accessible and can be easily downloaded. Like youtube blob-url its not working. I also studied this ques question first answer, through which i got the idea about youtube mechanism of buffering video and how the blob url shown in inspect element for youtube is a spoof.

Most importantly I want to know how can we spoof our website url so that no one can download it through inspect element. Is it possible for us to do so and how? Any link related to this please share with me.I have tried to study a lot but still missing something.

What mechanism actually youtube follow for creating blob url and to save its videos?

Upvotes: 3

Views: 6220

Answers (1)

Mick
Mick

Reputation: 25491

As your video has to arrive at the users device there is effectively no way you can stop a user intercepting and storing the file if they want to.

The typical solution to this problem is to encrypt the file and only share the key to the encrypted video with the people you want to view it. A 'bad' user can still download the video file but will not be able to play it back without the correct key.

How you get the key to the users can be very simple (you tell them it directly via some separate communication channel, like email) or more sophisticated using some sort of DRM approach.

DRM is controversial (see Firefox discussion at link below) but it is being baked into the standards with HTML5 EME (Encrypted Meida Extensions) so is becoming more mainstream. EME essentially allow a browser request a trusted (by the video producer) element in the browser/device to decode and play an encrypted video. See a good overview of EME at the second link below.

Upvotes: 5

Related Questions