Ever wondered how to disable the ability to download a self-hosted video on your divi website? Here's the code you need to enter in Theme Options --> Custom CSS. Kudos to the Elegant Theme Support Staff.
/*start disable video download */
video::-internal-media-controls-download-button {
display:none;
}
video::-webkit-media-controls-enclosure {
overflow:hidden;
}
video::-webkit-media-controls-panel {
width: calc(100% + 30px);
}
/*end disbale video download */
New javascript way Theme Options --> Integrations --> head
<script>
window.onload = function() {
videos = document.querySelectorAll('video');
[].forEach.call(videos, function(video) {
video.setAttribute("controlsList", "nodownload");
});
};
</script>
How would you do this for the audio module?
just replace ::video with ::audio in the code
doesnt work in chrome
Hey Jo, that’s odd it seems fine on my end. If you feel up to it send me an exact link where you are having the issue so I can check it out.
You can always try this new javascript code I added to the post
Hello,
thank you for this code. It works fine in Chrome. I added both: The CSS-Code in the Theme Customizer and the Java script in the Theme Options/Integration. I hope this is the correct way.
Yes the first block goes into Divi–>Theme Options–>Custom CSS box at the bottom and the second block of code goes into Divi–>Integration–>first box you find. Glad it helped.
Works perfectly in chrome. Thank you George!
No worries. Whatever you need let me know
Hello, This is my site-https://pixelactinc.com/project/royal-canton/ . I have followed the steps but still people can download the video simply right clicking on the video . Can you provide any assistance ?/
You seem to have sorted it out by yoursself using other plugins. Sorry for the delayed reply