修订历史记录
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
2020 年 11 月 17 日
此更新包含以下更改:
2016 年 10 月 20 日
此更新包含以下更改:
-
Subscribe Button 已更新,因此用户不会仅通过点击按钮来订阅或取消订阅频道。现在,当用户点击按钮时,系统会在新窗口中打开与该按钮相关联的频道页面。
- 如果用户之前未订阅过相应频道,页面会显示一个确认对话框,以便用户确认订阅相应频道的意图。
- 如果用户已订阅相应频道,则可以在频道页面上取消订阅。
-
当用户点击“订阅”按钮来订阅或取消订阅频道时,“订阅”按钮不再触发事件。(该按钮之前支持 subscribe
和 unsubscribe
事件。)之前可用于指定事件监听器的 data-ytonevent
属性也已被弃用。
鉴于此项更改,gapi.ytsubscribe.render
方法不再支持 onytevent
选项,该选项之前可用于指定事件监听器。
2016 年 8 月 11 日
此更新包含以下更改:
-
新发布的 YouTube API 服务条款(以下简称“更新后的条款”)已在 YouTube 工程和开发者博客中详细讨论,对当前的服务条款进行了多项更新。除了将于 2017 年 2 月 10 日生效的更新后的条款之外,此更新还包含多份支持性文档,用于帮助说明开发者必须遵守的政策。
如需查看所有新文档,请参阅更新后的条款的版本历史记录。此外,未来对更新后的条款或相关支持文档所做的更改也会在该修订历史记录中说明。您可以通过相应文档中的链接订阅 RSS Feed,以获取该修订历史记录中的更改。
2015 年 12 月 18 日
根据欧盟 (EU) 法律规定,您必须向欧盟境内的最终用户披露相关信息并征求他们的意见。因此,对于欧盟境内的最终用户,您必须遵守《欧盟地区用户意见征求政策》。我们已在 YouTube API 服务条款中添加了有关此要求的通知。
2013年11月22日
此更新包含以下更改:
-
您应加载的 JavaScript 文件(用于添加自己的按钮)已更改为 https://apis.google.com/js/platform.js
。旧文件 https://apis.google.com/js/plusone.js
仍会受到支持,但新文件效率更高。
-
订阅按钮属性部分现在介绍了如何使用 data-count
属性来指定 Subscribe Button 是否应显示相关联频道的订阅人数。配置选项部分现在还会显示用于显示和隐藏订阅人数的示例按钮。最后,用于配置自定义按钮的工具也支持此设置。
-
现在,当用户点击按钮订阅或取消订阅频道时,Subscribe Button 会触发事件。新的处理事件部分介绍了如何识别监听这些事件的 JavaScript 函数。订阅按钮属性部分还介绍了用于标识事件监听器的新 data-onytevent
属性。
除此之外,您用来配置自己的按钮的工具新加入了一个选项,用来表示您要处理这些事件。一旦选择了该选项,按钮代码即会包含示例 JavaScript 函数供您进行修改。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-21。
[null,null,["最后更新时间 (UTC):2025-08-21。"],[[["\u003cp\u003ePaid channel information has been removed from the documentation, and users can find more details in the YouTube Help Center.\u003c/p\u003e\n"],["\u003cp\u003eClicking the Subscribe Button now redirects users to the channel page, where they can confirm or manage their subscription.\u003c/p\u003e\n"],["\u003cp\u003eThe Subscribe Button no longer supports \u003ccode\u003esubscribe\u003c/code\u003e and \u003ccode\u003eunsubscribe\u003c/code\u003e events, and the associated \u003ccode\u003edata-ytonevent\u003c/code\u003e attribute and \u003ccode\u003eonytevent\u003c/code\u003e option have been deprecated.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers must adhere to the updated YouTube API Services Terms of Service, which became effective on February 10, 2017, along with associated supporting documents.\u003c/p\u003e\n"],["\u003cp\u003eFor users in the European Union, developers must comply with the EU User Consent Policy, as noted in the YouTube API Terms of Service.\u003c/p\u003e\n"]]],["The content outlines updates to YouTube's API and Subscribe Button features. Key changes include: removal of paid channel information (2020), changing the Subscribe Button to open the channel page for subscription/unsubscription confirmation and deprecating button events (2016), publishing updated API Services Terms of Service (2016), enforcing EU user consent policy (2015), and changing the loaded JavaScript file, adding subscriber count visibility, and implementing event firing on clicks for subscription/unsubscription (2013).\n"],null,["# Revision History\n\n### November 17, 2020\n\nThis update contains the following changes:\n\n- Examples and information related to paid channels have been removed from the documentation.\n See the [YouTube Help Center](https://support.google.com/youtube/answer/7515570)\n for more details.\n\n### October 20, 2016\n\nThis update contains the following changes:\n\n- The Subscribe Button has been updated so that users do not subscribe to or unsubscribe from a channel just by clicking on a button. Now, when a user clicks on a button, the channel page associated with that button opens in a new window.\n\n - If the user was not previously subscribed to the channel, the page displays a confirmation dialog so that the user can verify the intent to subscribe to the channel.\n - If the user was already subscribed to the channel, the user can unsubscribe from the channel page.\n- The Subscribe Button no longer fires an event when a user clicks the button to subscribe to or unsubscribe from a channel. (The button had supported `subscribe` and `unsubscribe` events.) The `data-ytonevent` attribute, which could previously be used to specify an event listener, has also been deprecated.\n\n In light of this change, the [gapi.ytsubscribe.render](/youtube/subscribe/reference#Dynamic_Rendering_Example_render) method no longer supports the `onytevent` option, which could previously be used to specify an event listener.\n\n### August 11, 2016\n\nThis update contains the following changes:\n\n- The newly published YouTube API Services Terms of Service (\"the Updated Terms\"), discussed in detail on the [YouTube Engineering and Developers Blog](http://youtube-eng.blogspot.com/), provides a rich set of updates to the current Terms of Service. In addition to the [Updated Terms](/youtube/terms/api-services-terms-of-service), which will go into effect as of February 10, 2017, this update includes several supporting documents to help explain the policies that developers must follow.\n\n The full set of new documents is described in the [revision history for the Updated Terms](/youtube/terms/revision-history). In addition, future changes to the Updated Terms or to those supporting documents will also be explained in that revision history. You can subscribe to an RSS feed listing changes in that revision history from a link in that document.\n\n### December 18, 2015\n\nEuropean Union (EU) laws require that certain disclosures must be given to and consents obtained from end users in the EU. Therefore, for end users in the European Union, you must comply with the [EU User Consent Policy](http://www.google.com/about/company/user-consent-policy.html). We have added a notice of this requirement in our [YouTube API Terms of Service](/youtube/terms#notices-to-users).\n\n### November 22, 2013\n\nThis update contains the following changes:\n\n- The JavaScript file that you should load to add your own button has changed to `https://apis.google.com/js/platform.js`. The old file, `https://apis.google.com/js/plusone.js` will still be supported, but the new file is more efficient.\n\n- The [subscription button attributes](#Subscription_Button_Attributes) section now explains how to use the `data-count` attribute to specify whether a Subscribe Button should show the associated channel's subscriber count. The [configuration options](#Configuration_Options) section also now shows sample buttons that show and hide the subscriber count. Finally the tool for [configuring your own button](#Configure_a_Button) also supports this setting.\n\n- The Subscribe Button now fires events when a user clicks the button to subscribe to a channel or unsubscribe from a channel. The new [Handling events](#Handling_Events) section explains how to identify a JavaScript function that listens for these events. The [subscription button attributes](#Subscription_Button_Attributes) section also explains the new `data-onytevent` attribute that you use to identify the event listener.\n\n In addition, the tool that lets you [configure your own button](#Configure_a_Button) now includes an option to indicate that you want to handle these events. When that option is selected, the button code includes a sample JavaScript function for you to modify."]]