3

how to hide the download option in html5 video tag. I put controlsList='nodownload' in the video tag and its fine but the download button only shows in when the client open the video link in Gionee Mobile phone .

Please help, thank you

TarangP
  • 2,711
  • 5
  • 20
  • 41
dom
  • 41
  • 1
  • 3
  • 1
    some browsers won't support proper HTML5 standards. I think "Gionee phone" browser is one of those. – Prajwal Jan 16 '18 at 05:30
  • Possible duplicate of [In Chrome 55, prevent showing Download button for HTML 5 video](https://stackoverflow.com/questions/41115801/in-chrome-55-prevent-showing-download-button-for-html-5-video) – flen Jan 16 '18 at 05:48

1 Answers1

0

You can hide it via CSS. Code taken from here: https://www.quora.com/How-do-I-disable-the-download-button-from-the-controls-in-HTML5-video-for-Google-Chrome

CSS

video::-internal-media-controls-download-button {
    display:none !important;
}

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

video::-webkit-media-controls-panel {
    width: calc(100% + 30px) !important; /* Adjust as needed */
}

EDIT: if you absolutely must hide the download button, then maybe you could do a customized video player. Mozilla has a nice article on how to do it and style it. This should work for any browser (but you might want to check first if your particular browser supports all methods involved).

EDIT2: There are cutomized players out there already. I found OzPlayer as an example.

flen
  • 1,905
  • 1
  • 21
  • 44
  • its not working sir, actually the site is open in a wrapper app – dom Jan 16 '18 at 06:09
  • @dom Hmmm strange, maybe it's what Prajwal said, this varies according to browser. Maybe you could erase both the "controls" attribute and the "controlsList" attribute? And what do you mean by a "wrapper app"? You mean that the HTML is not opened by Gionee phone browser, but by an app? Then it will depend on the app's code. Honestly, I don't think that hiding the download button will prevent user from downloading video (remember user can modify the DOM via console, for example), there are thousands of plugins enabling regular users to download video from ` – flen Jan 17 '18 at 05:04
  • at least the problem is solved using the OZPlayer
    Thanks for all your help, many many thanks
    – dom Feb 01 '18 at 09:29