I have implemented a live stream of webm video using the MediaSourceExtensions API on the side of JavaScript. The video tag is created without controls, but by clicking with the right mouse button on the video area, you can show the controls, scroll the video, expand it to full screen ...

I do not need this - only those functions that I program and no more should be available to the user of the web application. How to disable this context menu tag video ?

If this is not possible, maybe in addition to video you can still somehow render MSE content? Maybe on canvas ? ...

    1 answer 1

    First option

    We use javascript

     document.getElementById("id1").oncontextmenu = function (e) { return false; }; 
     <div>без меню</div> <div><img id="id1" src="http://www.2fons.ru/pic/201503/1280x1024/2fons.ru-84831.jpg" width="300"></div><br> <div>c меню</div> <div><img id="id2" src="https://s1.1zoom.ru/big0/208/421162-svetik.jpg" width="300"></div> 

    This example is made with an image but for video it will also work, since it disables the context menu on any element.

    Second option

    Put a transparent picture on top of the video.

    Third option

    Pure html (almost)

     <img oncontextmenu='return false;' src="http://www.2fons.ru/pic/201503/1280x1024/2fons.ru-84831.jpg" /> 

    • Well, yes, all ingenious is simple. )) I use both variants at once, having hung my functional on the transparent layer. Thank! - Iceman