From 5fd27f52462311079cb12f1a4d6cb31dfb586119 Mon Sep 17 00:00:00 2001 From: Roman Sebastian Karwacik <roman.karwacik@rwth-aachen.de> Date: Tue, 28 Apr 2020 15:58:11 +0200 Subject: [PATCH] Forbid context menu if video is not downloadable --- templates/lecture.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/lecture.html b/templates/lecture.html index b364956..acc8d1e 100644 --- a/templates/lecture.html +++ b/templates/lecture.html @@ -90,7 +90,6 @@ </div> {% endif %} - <script> function hintchapterclick (src) { $.ajax({ @@ -148,6 +147,12 @@ $(document).ready(function() { videojs('videoplayer').currentTime($(this).data("seek-time")); return false; }); + var downloadable = {{ ((videos|length > 0 and videos[0].downloadable) or ismod())|tojson }}; + if (!downloadable) { + $("#videoplayer_html5_api").on('contextmenu', function(e) { + e.preventDefault(); + }); + } }); </script> {% endblock %} -- GitLab