var myVideo = document.getElementById("video"); function playPause() { if (myVideo.paused) myVideo.play(); else myVideo.pause(); }
<body> <video id="video" oncontextmenu="return false;" > <source src="https://www.html5rocks.com/en/tutorials/track/basics/treeOfLife/video/developerStories-en.webm" /> </video> <br> <button onclick="playPause()">Play/Pause</button> </body>
The videos are hidden here and in order not to include it by the user, I added oncontextmenu="return false;" . The context menu for the video is not displayed now. So the user cannot enable it.
(You can add custom context menus, as well as create custom controls for play / pause, search, time display and volume change using javascript.)
Hope this helps ... :)
source share