reactjsvideo-streamingreact-player

Preventing video downloading apps from downloading a video from a react website


I am trying to build a site which streams videos but am looking to prevent any download of the video The videos are stored in AWS and permission on the bucket so cannot be accessed directly but only via the webserver and this all works okay I have also disabled the right click download as well , and works for all browsers and on mobile view. However if I use a an app like Video Downloader (from the playstore), this then has a browser within the app and if I go to the site via in the app browser I can download the content

I have used the below bit of code which disabled the download button

                  config={{
                            file: {
                              attributes: { controlsList: 'nodownload' },
                            },
                          }}
                          onContextMenu={(e) => e.preventDefault() 

But it does not prevent a video downloader app to download the underlying video within its own browser. Any suggestions on how I can prevent this?


Solution

  • I am trying to build a site which streams videos but am looking to prevent any download of the video

    You can't. It's a fundamental problem. How can you send something to someone and also prevent them from receiving it at the same time?

    The videos are stored in AWS and permission on the bucket so cannot be accessed directly but only via the webserver

    So, in that case your web server is the doorway to your bucket, giving you no additional security... only costing you money and wasting resources.

    I have also disabled the right click download as well

    This adds zero security to your application and isn't worth doing.

    But it does not prevent a video downloader app to download the underlying video within its own browser. Any suggestions on how I can prevent this?

    You can't prevent someone downloading video. At best you can use a DRM solution to make the video unplayable outside of specific contexts, but it's a myriad of compatibility problems and extra cost.

    See also: https://www.vdocipher.com/blog/2018/11/encrypted-media-extensions-eme/