Add copyright protection to tagged topics

Hello,

Here is a quick and hacky solution to disable download on videos.

Paste this to Common / Header

Use this, if you want to disable only the download button from video controls.

<script type="text/discourse-plugin" version="0.8">
  api.decorateCooked(
    $elem => $elem.find('video').attr('controlsList', 'nodownload'),
    { id: 'disable-video-download-button' }
  );
</script>

Use this, if you want to disable download button from video controls and disable right click (context menu) on video. So it prevents the video download with right click or long tap (mobile) from context menu.

<script type="text/discourse-plugin" version="0.8">
  api.decorateCooked(
    $elem => $elem.find('video')
    // disable download button from controls
    .attr('controlsList', 'nodownload')
    // disable right click context menu
    .on('contextmenu', function(e) {
      e.preventDefault()
    }),
    { id: 'disable-video-download' }
  );
</script>
1 Like