Disable Download Button - Audio


(Carey) #1

Hello! How do I disable the download button that is automatic with the audio player in chrome and firefox?

Thanks!


(Mark Hunte) #2

This may help.

Worked in my Chrome. ( changed video to audio )


#3

Hi Carey!

I tried an Internet search ( hint! ) and came up with this among many hits:

There is a way to control these elements - such as media player controls - with what is called the “Shadow DOM” - which does not work in this case. The solutions I saw (as per the link above) “fixed” this issue by making the video~audio container’s overflow invisible and then made the controls panel wider until the download button was outside the container bounds.

Also see this link about the download button in Chrome “situation”.

This is a classic “kludge” & may not be a good solution in the long term.

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

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

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

**Edit: Looks like Mark beat me to it!**

(Carey) #4

Thanks all! I just tried this code in a scene - run javascript, it didn’t remove the download button in chrome. Does it need to be added to the Head HTML or to javascript in each scene?


(Mark Hunte) #5

I guess that is a little bit of our fault.

We look at the code and recognise it as using syntax/code that is for CSS - Style . ( not Javascript )

This means we would put it between <style> </style> tags in the head.