How to disable downloading video?
Hey guys, I just wanted to disable users downloading videos.
<ReactPlayer controls url='http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4' config={{ file: { attributes: { controlsList: 'nodownload' } }}} />
I have found this solution, but it is not a good solution I guess.
I have added controlsList: 'nodownload' to player component but users are still able to download videos.
Here is a screenshot.

Any idea to disable downloading video?
Use config.file.attributes with onContextMenu to disable right clicking the video:
class Player extends React.Component {
render () {
return (
<div className='player-wrapper'>
<ReactPlayer
url='http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4'
playing
config={{
file: {
attributes: {
onContextMenu: e => e.preventDefault()
}
}
}}
/>
</div>
)
}
}
Example: https://jsfiddle.net/32rpued1/
But keep in mind that you can't fully prevent people from downloading videos that you are serving to them.
This isn't working for me: attributes: { controlsList: 'nodownload' }
@danmorley What URL are you trying to play and what browser are you using to play it?
@danmorley What URL are you trying to play and what browser are you using to play it?
Playing a local video file in Chrome
@danmorley Does this work for you? https://jsfiddle.net/8dsjy4r3/
The download option in the dots menu should be gone.
My apologies, it's working now, thank you!
https://video-react.js.org/components/play-toggle/ This can a better option
I want the user not to download the video using IDM or any other extensions is that possible to restrict the user not download.
I want the user not to download the video using IDM or any other extensions is that possible to restrict the user not download.
That is not possible. If you serve them the file, they can download it one way or another.
What would be the correct implementation for this in react-player 3.x? Or does it work the same way there?
This will require a new prop added controlsList in v3 I believe.
PR's welcome, similar to this one https://github.com/cookpete/react-player/pull/2004