Skip to content

Commit

Permalink
Merge branch 'paella-prevent-video-download' of miesgre/opencast into…
Browse files Browse the repository at this point in the history
… r/14.x

Pull request opencast#5761

  Paella:  Prevent video download. Disable context menu.
  • Loading branch information
gregorydlogan committed May 1, 2024
2 parents 105c72e + 784483d commit 88321e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion etc/ui-config/mh_default_org/paella7/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
"presenter/player+preview",
"presentation/player+preview"
],
"theme": "custom_theme"
"theme": "custom_theme",
"preventVideoDownload": false
},

"cookieConsent": [
Expand Down
9 changes: 9 additions & 0 deletions modules/engage-paella-player-7/src/js/PaellaOpencast.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,15 @@ export class PaellaOpencast extends Paella {
}

bindEvent(paella, Events.PLAYER_LOADED, async () => {
// Prevent video download: Disable context menu
if (paella?.config?.opencast?.preventVideoDownload == true) {
paella.videoContainer.streamProvider.players.forEach(player => {
player.video?.addEventListener('contextmenu', (e) => {
e.preventDefault();
});
});
}

// Enable trimming
// Retrieve video duration in case a default trim end time is needed
const videoDuration = paella.videoManifest?.metadata?.duration;
Expand Down

0 comments on commit 88321e0

Please sign in to comment.