How to remove video download option

1

I would like to remove the options for downloading the video (I know this will not prevent it from being downloaded through other means.) But the idea is only to make this difficult for more laymen.

I have the following example: link

Where through CSS I can hide the download button of the video.

But if the user clicks the right mouse button, he still has the option to download the video:

I would like to remove this option also via javascript or some kind of HTML configuration.

    
asked by anonymous 29.03.2017 / 16:15

2 answers

1

I found a solution: link

// Remove botão de download de vídeos
video::-internal-media-controls-download-button {
    display:none;
}

video::-webkit-media-controls-enclosure {
    overflow:hidden;
}

video::-webkit-media-controls-panel {
    width: calc(100% + 30px); /* Adjust as needed */
}
<video src="http://html5demos.com/assets/dizzy.mp4"oncontextmenu="return false;" controls></video>

I used one of the responses from this stackoverflow page >

    
29.03.2017 / 16:36
2

Since it is difficult to solve beyond the questioner's own solution, you can put this script that inhibits the mouse right and much more.

function bloqueia_mouse_teclado() {

        // CTRL V v
        $(document).ready(function() {
            $(document).keydown(function(event) {
                if (event.ctrlKey == true && (event.which == '118' || event.which == '86')) {
                    event.preventDefault();
                }
            });
        });

        // CTRL C c
        $(document).ready(function() {
            $(document).keydown(function(event) {
                if (event.ctrlKey == true && (event.which == '97' || event.which == '67')) {
                    event.preventDefault();
                }
            });
        });

        // CTRL U u
        $(document).ready(function() {
            $(document).keydown(function(event) {
                if (event.ctrlKey == true && (event.which == '85' || event.which == '117')) {
                    event.preventDefault();
                }
            });
        });

        // CTRL A a
        $(document).ready(function() {
            $(document).keydown(function(event) {
                if (event.ctrlKey == true && (event.which == '65' || event.which == '97')) {
                    event.preventDefault();
                }
            });
        });

        // CTRL S s
        $(document).ready(function() {
            $(document).keydown(function(event) {
                if (event.ctrlKey == true && (event.which == '83' || event.which == '115')) {
                    event.preventDefault();
                }
            });
        });

        // CTRL X x
        $(document).ready(function() {
            $(document).keydown(function(event) {
                if (event.ctrlKey == true && (event.which == '88' || event.which == '120')) {
                    event.preventDefault();
                }
            });
        });

        // CTRL J j
        $(document).ready(function() {
            $(document).keydown(function(event) {
                if (event.ctrlKey == true && (event.which == '74' || event.which == '106')) {
                    event.preventDefault();
                }
            });
        });



        // Bloquear botão direito do mouse
        $(document).bind("contextmenu", function(e) {
            return false;
        });
    }


    bloqueia_mouse_teclado();
// Remove botão de download de vídeos
video::-internal-media-controls-download-button {
    display:none;
}

video::-webkit-media-controls-enclosure {
    overflow:hidden;
}

video::-webkit-media-controls-panel {
    width: calc(100% + 30px); 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script><videosrc="http://html5demos.com/assets/dizzy.mp4" oncontextmenu="return false;" controls></video>
    
29.03.2017 / 17:07