using unlisted youtube videos

give the following html code I need to make it so users can not download the by using the right mouse click or see the script code.
<script language="javascript">
var tag = document.createElement('script');

tag.src = "";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

// 3. This function creates an <iframe> (and YouTube player)
//    after the API code downloads.
var player;

function onYouTubeIframeAPIReady() {
    player = new YT.Player('player', {
        height: '390',
        width: '640',
        videoId: 'VRl66uuwA1E',
       playerVars: { 'autoplay': 1, 'controls': 0 ,'modebranding' :0 ,'showinfo' : 0},
        events: {
            'onReady': onPlayerReady,
                'onStateChange': onPlayerStateChange

// 4. The API will call this function when the video player is ready.
function onPlayerReady(event) {;

// 5. The API calls this function when the player's state changes.
//    The function indicates that when playing a video (state=1),
//    the player should play for six seconds and then stop.
var done = false;

function onPlayerStateChange(event) {
    if ( == YT.PlayerState.PLAYING && !done) {
        setTimeout(stopVideo, 6000);
        done = true;

function stopVideo() {
  <meta charset="utf-8">

<body oncontextmenu="return false">
  <div id="player" ></div>

Open in new window

I am not fixated on javascript so if it needs to be in something else that is ok.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
If you use the youtube api, then you will always get the ability to right click on the video and get the context menu including finding the url of the video.  Even if you could do that, the information is in your javascript code which is there for everybody to see.
videoId: 'VRl66uuwA1E',

Open in new window

The next option is to use a 3rd party player like flowplayer to stream youtube videos

If you really want control of your videos, then you will want to place your video on a CDN and you can tighten your controls however you want including only allowing the video to be played via your server.  This option will of course be the most expensive vs free youtube.  For free, you will have to allow some things to slide.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.