ChannelSections
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
channelSection
資源包含一組
頻道獲選為精選的影片。例如,版面可以宣傳頻道的
最新上傳影片、最熱門的影片,或是一或多個播放清單中的影片。
一個頻道最多可以建立 10 個影片櫃。
方法
API 支援下列 channelSections
資源方法:
- list
- 傳回符合 API 要求條件的
channelSection
資源清單。
立即試用。
- 插入
- 將頻道版面加入已驗證使用者的頻道。一個頻道最多可以建立 10 個影片櫃。
立即試用。
- 更新
- 更新頻道版面。
立即試用。
- 刪除
- 刪除頻道版面。
立即試用。
屬性
下表定義了這個資源中顯示的屬性:
屬性 |
kind |
string
識別 API 資源的類型。值為 youtube#channelSection 。 |
etag |
etag
這項資源的 Etag。 |
id |
string
YouTube 用來識別頻道版面的 ID。 |
snippet |
object
snippet 物件包含頻道版面的基本詳細資料,例如類型和標題。 |
snippet.type |
string
頻道版面的類型。
這個屬性的有效值如下:
allPlaylists
completedEvents
liveEvents
multipleChannels
multiplePlaylists
popularUploads
recentUploads
singlePlaylist
subscriptions
upcomingEvents
|
snippet.channelId |
string
YouTube 用來識別發布頻道版面的頻道專屬 ID。 |
snippet.title |
string
版面標題。你只能將頻道版面的標題設為 snippet.type 或 multiplePlaylists 。事實上,當你插入或更新這幾類版面時,就必須指定標題。multipleChannels 如果為其他類型的頻道版面指定標題,系統會忽略該值。
這個屬性的長度上限為 100 個字元,而且可包含所有有效的 UTF-8 字元 (< 和 < 除外)。 |
snippet.position |
unsigned integer
版面在頻道頁面中的位置。此屬性使用從 0 開始的索引。0 值表示該頻道上出現的第一個區段,值為 1 代表第二個區段,依此類推。
如果在插入管道版面時沒有指定屬性值,則預設行為就是將新的區段顯示至最後。 |
contentDetails |
object
contentDetails 物件包含頻道版面內容的詳細資料,例如版面精選的播放清單或頻道清單。 |
contentDetails.playlists[] |
list
頻道版面中出現的一或多個播放清單 ID 清單。如果 channelSection 資源的 snippet.type 屬性為 singlePlaylist 或 multiplePlaylists ,您就必須指定播放清單 ID 清單,而且不應為其他版面類型指定這個屬性。如果類型為 singlePlaylist ,則這份清單只能指定一個播放清單 ID。 |
contentDetails.channels[] |
list
頻道版面中出現的一或多個頻道 ID 清單。如果 channelSection 資源的 snippet.type 屬性為 multipleChannels ,您就必須指定頻道 ID 清單,而且不得為其他區段指定這個屬性。您不能將自己的頻道加入清單中。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-11 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2024-09-11 (世界標準時間)。"],[[["A `channelSection` resource contains information about a set of videos that a channel features, such as latest uploads, popular uploads, or playlists."],["Channels can manage their featured videos using the API, which allows creating, listing, updating, and deleting `channelSection` resources."],["A channel can have a maximum of 10 sections, each with a specified type like `singlePlaylist`, `multipleChannels`, or `popularUploads`."],["Each `channelSection` has properties such as `kind`, `etag`, `id`, `snippet`, and `contentDetails`, which specify details about the section and its contents."],["The `contentDetails` property can contain a list of either playlists or channels featured in the section, depending on the `snippet.type` property."]]],["Channel sections feature a curated set of videos, like latest or popular uploads, or playlists. API methods allow listing, inserting, updating, and deleting these sections. A channel can have up to 10 sections. Each section contains `snippet` and `contentDetails` objects which describes the type, title, position, and the featured channels/playlists. The type can be single or multiple playlists, or channels, amongst others. Specific titles are required for some types and cannot include \"\u003c\" or \"\u003e\".\n"]]