7

I have a website that has a draft mode. Someone can login and see what the site looks like to approve it before the public can see it. I have YouTube videos on an account that I put on private because I don't want the world to see them.

However, I do want the people who login to the draft mode to be able to watch the private embeds.

Is there a way I can use the YouTube API and do it so the people can only see the videos and not really be logged in as that person (so they cannot modify the video settings) and not be able to stay signed in after leaving my webpage?

Al-Mothafar
  • 7,949
  • 7
  • 68
  • 102
Keith
  • 133
  • 1
  • 8

3 Answers3

12

Mark your videos as unlisted, not private.

Sometimes, security is about compromise. At one end of the spectrum, you can lock things down completely so that no one can access the data. At the other end, the most usable and accessible data will not be secure.

With that said, you are asking for functionality for N users when the security model you seek is too restrictive and only allows 25 users.

Security and accessibility consists of a balance between an acceptable standard for accessibility while also meeting an acceptable standard for security.

In your situation, marking your YouTube videos as unlisted may provide you with the balance you seek since a 25 user limitation is a show stopper.

http://www.google.com/support/youtube/bin/answer.py?answer=181547

Your videos can be accessed by anyone who has the link, which would only be the users who have access to your system. The link is not public, so it's very unlikely that someone will guess or find your YouTube videos, as the URL's themselves consist of random characters.

The only way other people could access the videos is if your logged-in users go into the browser source, after logging in, and email the URLs to their friends.

  • Your users don't need YouTube accounts.
  • Videos are only accessible to users who login OR users who login, view source, and give the URL to other users.
  • Security could be mitigated by periodically changing the urls for the videos.

Steps to mark your video as unlisted:

  • Click on your video to load it in YouTube.
  • At the top left, click "Edit Video Detail"
  • Scroll down to where it says "This video is" and in the drop down list, select "Unlisted".

Select Unlisted as your preference

jamesmortensen
  • 33,636
  • 11
  • 99
  • 120
  • I didn't find the unlisted option, +1 for that :) However, do you know if an unlisted video is retrieveable via API ? – Samuel Herzog Jan 17 '11 at 04:40
  • @Samuel - Updated with instructions to locate unlisted. Also, according to this resource, unlisted videos are treated like private videos as far as the API is concerned: http://www.google.com/support/forum/p/youtube/thread?tid=32db832b26e8a75d&hl=en – jamesmortensen Jan 17 '11 at 08:22
  • Although the users I'm aiming for are *not trusted* to not pass the URLs along when they shouldn't, this is my best bet yet. +200! – Dan Byström Jan 20 '11 at 09:47
4

First of all, you can't retrieve the video itself via the api.
All you'll get is an link to embed or redirect your user.

So ultimately, your user will watch the video himself, without you as the man in the middle. Therefore you will be looking for something like password protection of your video.
A quick google search brought up this.

You can change the broadcast privacy option to private. Then your "specific users" will need YouTube accounts and will need to "friend" you (or vice versa). You then edit the broadcast privacy option of the video to add the friends (up to 25) to the video. They will automatically be sent a "shared with you message". They sign into their YouTube account and they are able to watch the video.

When authenticating with the user who uploaded the video in the API you should be able to retrieve those private videos too (see Developers Guide: Retrieving Uploades).

Disclaimer: I don't do youtube api def, I couldn't test it.

Samuel Herzog
  • 3,561
  • 1
  • 22
  • 21
  • I need to support several thousands of users with no youtube account. I was hoping for some mechanism that could let my site login to the private account on youtube and then redirect the private videos to the users... – Dan Byström Jan 16 '11 at 20:01
  • for this the unlisted feature of youtube should be the best one, see the answer of @jmort253 for that. – Samuel Herzog Jan 17 '11 at 00:43
  • would have been helpful for answering if you had added this as a comment to qualify for your bounty. – Samuel Herzog Jan 17 '11 at 04:39
0

If YouTube isn't working for you for security of your videos, you could consider using FlowPlayer Free to host the videos on your own network and then use the free flash player on your website. This would allow you to make all URLS accessible only by authenticated users.

http://flowplayer.org/download/index.html

Here is an example of their demo running on my local webserver, with the video hosted on a local Apache server.

alt text

jamesmortensen
  • 33,636
  • 11
  • 99
  • 120