alaouy / YouTube

🔥 Laravel PHP Facade/Wrapper for the Youtube Data API
MIT License
781 stars 204 forks source link

#question About protecting videos #39

Closed JCarlosR closed 8 years ago

JCarlosR commented 8 years ago

Hi. Many thanks for your time creating the package.

I just have one question: It is possible to protect videos using the Youtube API? For example, if I need to create an "online school" with free videos and premium videos, is Youtube able to do it?

I have read that it is possible to do with Vimeo PRO, but if it also possible with Youtube, probably I would prefer it.

Thank you.

alaouy commented 8 years ago

Hello @JCarlosR, Uploading videos to Youtube is not supported in this package, you can use this one instead JoeDawson/youtube, it provides the upload feature and you can setup the video privacy (public, private, unlisted) before uploading 😉

JCarlosR commented 8 years ago

I can upload the videos via Youtube, but I want to show the videos in my page correctly. I read that is possible to create paid content in Youtube, but I don't know how to take these videos and show with protection in my site. I guess it is different with the private videos, because if I share the link (after inspect element), other users can't see the videos. Maybe you know about this topic, and can give me some ideas. Thank you.

alaouy commented 8 years ago

For clarification. Yes, you can embed private videos. However, it really isn't feasible to do so since YouTube's private videos require that the viewer have a YouTube account, be signed into that account and have that account added to the video's access list. You can embed unlisted videos, they don't have the same authentication restrictions as private videos. However, all that is necessary to view an unlisted video to know the URL. If your website is crawled by search engines, the unlisted video may as well be public and your users can get the link to that video (via the source code like what you said).

You may want to look into self-hosting your own videos to have better control and to be sure that you aren't violating YouTube's Terms of Service (which prohibits some uses of the embedded player). Vimeo.com also has more robust access controls and can only allow the video to be embedded on a specific domain. However, they don't allow commercial use...so that may be a catch if that applies to you.