ChannelBanners
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ทรัพยากร channelBanner
มี URL ที่คุณจะใช้เพื่อตั้งค่ารูปภาพที่อัปโหลดใหม่เป็นรูปภาพแบนเนอร์ของช่อง
เมธอด
API รองรับวิธีการต่อไปนี้สำหรับทรัพยากร channelBanners
- แทรก
- อัปโหลดรูปภาพแบนเนอร์ของช่องไปยัง YouTube วิธีการนี้แสดง 2 ขั้นตอนแรกในกระบวนการ 3 ขั้นตอนในการอัปเดตรูปภาพแบนเนอร์ของช่อง
- เรียกใช้เมธอด
channelBanners.insert
เพื่ออัปโหลดข้อมูลรูปภาพแบบไบนารีไปยัง YouTube รูปภาพต้องมีสัดส่วนภาพเป็น 16:9 และมีขนาดอย่างน้อย 2048x1152 พิกเซล เราขอแนะนำให้อัปโหลดรูปภาพขนาด 2560 x 1440 พิกเซล - ดึงค่าของพร็อพเพอร์ตี้
url
จากการตอบกลับที่ API แสดงผลสำหรับขั้นตอนที่ 1 - เรียกใช้เมธอด
channels.update
เพื่ออัปเดตการตั้งค่าการสร้างแบรนด์ของช่อง ตั้งค่าพร็อพเพอร์ตี้ brandingSettings.image.bannerExternalUrl
เป็น URL ที่ได้ในขั้นตอนที่ 2
การนําเสนอทรัพยากร
โครงสร้าง JSON ต่อไปนี้แสดงรูปแบบของทรัพยากร channelBanners
{
"kind": "youtube#channelBannerResource",
"etag": etag,
"url": string
}
พร็อพเพอร์ตี้
ตารางต่อไปนี้จะกำหนดพร็อพเพอร์ตี้ที่ปรากฏในทรัพยากรนี้
พร็อพเพอร์ตี้ |
kind |
string
ระบุประเภทของทรัพยากร API ค่าจะเป็น youtube#channelBannerResource |
etag |
etag
Etag ของทรัพยากรนี้ |
url |
string
URL ของรูปภาพแบนเนอร์ หลังจากเรียกใช้เมธอด channelBanners.insert ให้ดึงค่านี้จากการตอบกลับของ API จากนั้นเรียกใช้เมธอด channels.update และตั้งค่า URL เป็นค่าของพร็อพเพอร์ตี้ brandingSettings.image.bannerExternalUrl เพื่อตั้งค่ารูปภาพแบนเนอร์ของช่อง |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-12-21 UTC
[[["เข้าใจง่าย","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-12-21 UTC"],[[["The `channelBanner` resource provides the URL needed to set a newly uploaded image as a channel's banner image."],["Updating a channel banner image involves a three-step process, starting with uploading the image using the `channelBanners.insert` method."],["The uploaded banner image must have a 16:9 aspect ratio and be at least 2048x1152 pixels, with 2560x1440 recommended."],["After uploading, the `url` property from the API response is extracted, and then used in the `channels.update` method, specifically in the `brandingSettings.image.bannerExternalUrl` property, to set the banner image."],["The `channelBanners` resource contains `kind`, `etag`, and `url` properties, with the `url` property holding the banner image's URL."]]],["The `channelBanner` resource provides a URL for setting a channel's banner image. Updating a banner involves three steps: first, use `channelBanners.insert` to upload an image (16:9 aspect ratio, at least 2048x1152 pixels). Second, extract the `url` from the response. Third, use `channels.update`, setting `brandingSettings.image.bannerExternalUrl` to the extracted URL. The resource includes `kind` (`youtube#channelBannerResource`), `etag`, and the banner image's `url`.\n"]]