Remove download video button in video player in chrome

video

(Joe) #1

Hello,

I’m trying to figure out how to remove the download option (in Chrome) for a video i have in my hype document. I’ve found the necessary javascript on google’s developer page but I am unsure how to make it work in my hype doc. Does anyone know how to do this?

here is the code:
var video = document.querySelector(‘video’);
video.controls; // true
video.controlsList; // [“nofullscreen”, “nodownload”, “noremoteplayback”]
video.controlsList.remove(‘noremoteplayback’);
video.controlsList; // [“nofullscreen”, “nodownload”]
video.getAttribute(‘controlsList’); // “nofullscreen nodownload”

video.controlsList.supports(‘foo’); // false
video.controlsList.supports(‘noremoteplayback’); // true


(Jonathan Deutsch) #2

My recommended method would be:

  1. Assign a Unique Element ID to your video in the Identity Inspector (I’m setting mine to “myVideo”)
  2. Add an On Scene Load handler to Run JavaScript… with this code:
	var videoElement = hypeDocument.getElementById("myVideo");
	videoElement.setAttribute("controlsList", "nodownload");

(Joe) #3

That worked great. Thanks Jonathan!


(Pete) #4

that would be useful for me too thanks!