php 仅为网站用户显示 YouTube 私人视频

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11519374/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 00:43:00  来源:igfitidea点击:

Show YouTube private videoes only for website users

phpyoutubeyoutube-apigdatagdata-api

提问by heron

I have experience with YouTube API. But I always used it for public videos. Now. what I want to achieve is, to make video on my YouTube channel TOTALLY invisible (in other word private) and shows this video only to website users.

我有使用 YouTube API 的经验。但我总是将它用于公共视频。现在。我想要实现的是,使我的 YouTube 频道上的视频完全不可见(换句话说,是私密的),并且仅向网站用户显示此视频。

Is that possible and how?

这是可能的吗?

回答by hjpotter92

This is from the Google's Productforums

这是来自Google 的产品论坛

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. They are limited to 50 people. 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.

为了澄清。是的,您可以嵌入私人视频。但是,这样做确实不可行,因为 YouTube 的私人视频要求观看者拥有 YouTube 帐户、登录该帐户并将该帐户添加到视频的访问列表中。他们仅限于 50 人。您可以嵌入不公开的视频,它们与私人视频没有相同的身份验证限制。但是,查看未列出的视频以了解 URL 所需的一切。如果您的网站被搜索引擎抓取,则未列出的视频也可能是公开的。

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).

您可能需要考虑自行托管您自己的视频,以更好地控制并确保您没有违反 YouTube 的服务条款(该条款禁止使用嵌入式播放器的某些用途)。

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.

Vimeo.com 还具有更强大的访问控制,并且只能允许将视频嵌入到特定域中。但是,他们不允许商业用途……所以如果这适用于您,这可能是一个问题。

回答by Dan Smith

Instead of setting the video to private, set it to unlisted. It won't appear in any listing on youtube, i.e. your channel, search results & related videos but you can link to it and embed it like a normal video.

不是将视频设置为private,而是将其设置为unlisted。它不会出现在 youtube 上的任何列表中,即您的频道、搜索结果和相关视频,但您可以链接到它并像普通视频一样嵌入它。

回答by Dan Smith

Youtube Provide 3 kinds video permission.

Youtube 提供 3 种视频权限。

  1. Public ---- Open for all
  2. Unlisted --- Can watch video by embed / shared link only,, but not in youtube search / undel channel.

  3. Private -- own and selected people.

  1. 公共----对所有人开放
  2. 不公开 --- 只能通过嵌入/共享链接观看视频,但不能在 youtube 搜索/取消频道中观看。

  3. 私人——拥有和选定的人。