Page 1 of 2

How do you disable right-click on FLV Videos?

Posted: Thu Mar 17, 2011 6:03 am
by simonmlewis
Not sure if this is specific to PHP, but we have a database that has the Youtube embed video code.

We want to disable people from being able to right-click on the video, and showing to Download to Real Player.

This is not user specific, this is general via the web site, so ANYONE who right clicks, cannot download the vid.
We would like to hide the embed code from the HTML, but I don't see any way that is possible, except for an encryption method which I have no idea how to do anyway.

Re: How do you disable right-click on FLV Videos?

Posted: Thu Mar 17, 2011 4:38 pm
by aIexi
Couldn't you put the video inside of a DIV, and then use jquery or javascript to do some kinda of "on mouse over disable right click" type thing?

Re: How do you disable right-click on FLV Videos?

Posted: Thu Mar 17, 2011 4:41 pm
by simonmlewis
I'm sure you could, but I've no idea how you would do that, sorry.
Plus, I don't know if disabling a right click in a DIV would also disable it in the FLV, which always force themselves into the foreground.

Re: How do you disable right-click on FLV Videos?

Posted: Thu Mar 17, 2011 5:46 pm
by aIexi
You could give the DIV an ID, and then sit it's Z as -1 XD

Re: How do you disable right-click on FLV Videos?

Posted: Thu Mar 17, 2011 5:48 pm
by aIexi
Or better yet, layer it...

make 2 divs. set 1 div inside the other div. Set the outer div with a transparent back ground and set it's Z as 10.

Then put the other thing in the inner div, and set it's div as -1 XD

Re: How do you disable right-click on FLV Videos?

Posted: Thu Mar 17, 2011 5:52 pm
by simonmlewis
I'm with you, so the outer div is set to the foreground. But how do you prevent what's in the DIV to be right-clicked?
Or is simply layering one over the other, going to stop the person from doing that anyway?

Re: How do you disable right-click on FLV Videos?

Posted: Fri Mar 18, 2011 4:56 am
by simonmlewis
[text] <div class='videoouterbox'>
<div class='videoinnerbox'>
<font color='#ffffff'>HELLO</font>
</div>
</div>[/text]

[text]
.videoouterbox
{
background-image: url(../images/videobkrnd.gif);
z-index:10;
}

.videoinnerbox
{
z-index:-1;
}[/text]

"HELLO" can be seen. What have I entered wrong?

Re: How do you disable right-click on FLV Videos?

Posted: Fri Mar 18, 2011 5:39 am
by simonmlewis
I've tried this with the youtube embed code in the innerdiv bit, and it doesn't force the box to expand with it. you get a big box above, and the box that's meant to contain the video, it just like 25px high, and the video is slap bang over the top of it.

Re: How do you disable right-click on FLV Videos?

Posted: Fri Mar 18, 2011 6:04 am
by simonmlewis
[text].videoouterbox
{
background-color:#eeeeee;
width:700px;
height: 390px;
position: relative;
top: 35;
z-index: 10;
}

.videoinnerbox
{
background-color:#eeeeee;
width:700px;
height: 390px;
position: relative;
top: -355;
z-index: 1;
}[/text]

This puts the grey box right over the video - perfect. But if I use a transparent image, or set the color of the background to transparent, the Video comes into the foreground, and right click to find the Video Menu again.

This is so close.... but it's like Boolean: ON or OFF !!

Re: How do you disable right-click on FLV Videos?

Posted: Fri Mar 18, 2011 8:05 am
by Bind
simonmlewis wrote: We want to disable people from being able to right-click on the video
in the embedded object tag, put the following:

Code: Select all

oncontextmenu="return false" ondragstart="return false" onselectstart="return false"

Re: How do you disable right-click on FLV Videos?

Posted: Fri Mar 18, 2011 8:10 am
by simonmlewis
Which object? In the DIV (how?), in the video (tried it in the video embed code from youtube - makes no different).

[text]<iframe title="YouTube video player" width="700" height="390" src="http://www.youtube.com/embed/ZXRnbmP_dZM" frameborder="0"
oncontextmenu="return false" ondragstart="return false" onselectstart="return false"
allowfullscreen></iframe>[/text]

Re: How do you disable right-click on FLV Videos?

Posted: Fri Mar 18, 2011 8:47 am
by Bind
you need control of the html that displays the video - your type of iframe embedding just displays youtubes source code (embed page) that displays the player video.

This is the type of embedding i am talking about:

Code: Select all

<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/YUYCBfmIcHM?fs=1&hl=en_US" oncontextmenu="return false" ondragstart="return false" onselectstart="return false">
</param>
<param name="allowFullScreen" value="true">
</param>
<param name="allowscriptaccess" value="always">
</param>
<embed src="http://www.youtube.com/v/YUYCBfmIcHM?fs=1&hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385" oncontextmenu="return false" ondragstart="return false" onselectstart="return false"></embed></object>

Re: How do you disable right-click on FLV Videos?

Posted: Fri Mar 18, 2011 8:50 am
by simonmlewis
I still get the RealPlayer "download video" link in the right click menu.

Re: How do you disable right-click on FLV Videos?

Posted: Mon Mar 21, 2011 11:28 am
by simonmlewis
Is the answer, that is just is NOT possible??

If I use the DIV Layer option, I have to use a background color in order to force it to display over the embedded youtube video. But the only way it will do it is with no transparency.
If I put an image in that FRONT DIV, it won't display, unless I have the background color set - with no transparency.

It's maddening.

Re: How do you disable right-click on FLV Videos?

Posted: Mon Mar 21, 2011 2:51 pm
by danwguy
You can't stop Real Player from downloading video, it's in the options of Real Player itself. Real Player sees a video on a page and grabs the link. There is no way to stop it. All above options will work great for disabling access to the video, but if you have a program like Real Player it sees the source code of the video and grabs it no matter what you do.