修訂版本記錄
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 資訊提供清單變更。
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 函式範例。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2023-02-22 (世界標準時間)。
[null,null,["上次更新時間:2023-02-22 (世界標準時間)。"],[[["Paid channel information has been removed from the documentation, and users can find more details in the YouTube Help Center."],["Clicking the Subscribe Button now redirects users to the channel page, where they can confirm or manage their subscription."],["The Subscribe Button no longer supports `subscribe` and `unsubscribe` events, and the associated `data-ytonevent` attribute and `onytevent` option have been deprecated."],["Developers must adhere to the updated YouTube API Services Terms of Service, which became effective on February 10, 2017, along with associated supporting documents."],["For users in the European Union, developers must comply with the EU User Consent Policy, as noted in the YouTube API Terms of Service."]]],["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"]]