We're using Confluence 5.9.
I want to put oncontextmenu='return false' in the video tag to prevent the video right click. How can I put it in?
Hello JinDooHwan,
Thank you for reaching out! I'm happy to help.
I would recommend adding the text into your <video tag itself:
oncontextmenu="return false;"
You can also embed javascript on the page, like this:
$(document).ready(function() {
$("video").bind("contextmenu",function(){
return false;
});
} );
This would prevent right-click on any video elements on that page. If you are unsure on how to add code to a Confluence page, have a look at How to Use Javascript in Confluence.
One more thing that you need to be aware of, and this is very important. Your Confluence version of 5.9 reached End of Life in November of 2017. It is at very high risk of being compromised, due to the following security advisories, explained below:
You'll need to make sure that you upgrade as soon as possible to the latest version of Confluence. For details on how to do that, have a look at our Confluence Installation and Upgrade Guide.
Thank you for your understanding!
Regards,
Shannon
<script type="text/javascript">
$(document).ready(function() {
$("video").bind("contextmenu",function(){
return false;
});
} );
</script>
I put the code in Custom HTML.
But it doesn't work. Help me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there,
Thank you for following up!
I'm very sorry that I didn't include this in my example, but according to the document I sent you, How to Use Javascript in Confluence, you have to call AJS before any query.
I would recommend the Multimedia Macro for this, as it won't work the same if you're just using the attachments macro.
The script as follows:
<script type="text/javascript">
AJS.toInit(function(){
AJS.$("video").bind('contextmenu',function() { return false; });
});
</script>
Can you give that a try and let us know how it goes?
Regards,
Shannon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
JinDooHwan,
The script has been tested to work with the multimedia macro, but it appears that from your script, you're trying to use an iFrame. Can you test using the Multimedia Macro and let me know how it goes?
Secondly, I would really advise against you remaining on version 5.9. It is imperative that you upgrade from the Confluence 5.9 version as soon as you possibly can. Your instance is at extreme risk until you upgrade.
Thank you for your understanding.
Regards,
Shannon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
From your reply, when you say "script not applied" I believe you mean that you did apply it, but it did not work as expected. Is this correct?
As we tested this to work on 6.6, I would recommend that you first do the upgrade as required, and then you can test the script again, and see if it works there.
Let us know if you have any trouble!
Regards,
Shannon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.