How can I disable \"Save Video As...\" from a browser\'s right-click menu to prevent clients from downloading a video?
Are there more complete solutions that prevent
As a client-side developer I recommend to use blob URL, blob URL is a client-side URL which refers to a binary object
in HTML leave your video src blank,
and in JS fetch the video file using AJAX, make sure the response type is blob
window.onload = function() {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'mov_bbb.mp4', true);
xhr.responseType = 'blob'; //important
xhr.onload = function(e) {
if (this.status == 200) {
console.log("loaded");
var blob = this.response;
var video = document.getElementById('id');
video.oncanplaythrough = function() {
console.log("Can play through video without stopping");
URL.revokeObjectURL(this.src);
};
video.src = URL.createObjectURL(blob);
video.load();
}
};
xhr.send();
}
Note: This method is not recommended for large file
EDIT
Use cross-origin blocking for avoiding direct downloading
if the video is delivered by an API Use different method (PUT/POST) instead of 'GET'