Asked
Active
Viewed 1.1k times
2

Govind Maheshwari
- 23
- 1
- 1
- 5
-
1Hey @Govind can you provide us more information like source code, website you are referring to. The image you have provided doesn't give any information to help you. – Lokesh Sanapalli Sep 18 '18 at 15:16
-
– Govind Maheshwari Sep 18 '18 at 16:25
1 Answers
20
You can add controlsList="nodownload"
to the video
element and the download button will disappear in Chrome.
Keep in mind that people can still download the video if they really want to. An additional precaution would be to disable right-clicking on the video element:
<ReactPlayer
// Disable download button
config={{ file: { attributes: { controlsList: 'nodownload' } } }}
// Disable right click
onContextMenu={e => e.preventDefault()}
// Your props
url="https://media.w3.org/2010/05/sintel/trailer_hd.mp4"
className="react-player"
controls
width="100%"
height="100%"
/>

Fabian Schultz
- 18,138
- 5
- 49
- 56
-
Hey @Fabian Can you please tell me how can I disable right click on videos in ReactJS – Govind Maheshwari Sep 18 '18 at 16:22
-
1
-
-
-
This line isn't working for me, download is still in the menu config={{ file: { attributes: { controlsList: 'nodownload' } } }} – Dan Oct 01 '21 at 10:14