ChannelBanners
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Zasób channelBanner
zawiera adres URL, którego użyjesz do ustawienia nowo przesłanego obrazu jako obrazu banera kanału.
Metody
Interfejs API obsługuje te metody dotyczące zasobów channelBanners
:
- insert
- Prześlij do YouTube obraz banera kanału. Ta metoda obejmuje 2 pierwsze kroki 3-etapowego procesu aktualizacji obrazu banera kanału:
- Aby przesłać binarne dane obrazu do YouTube, wywołaj metodę
channelBanners.insert
. Obraz musi mieć format 16:9 i rozmiar co najmniej 2048 x 1152 piksele. Zalecamy przesłanie obrazu o wymiarach 2560 × 1440 pikseli. - Wyodrębnij wartość właściwości
url
z odpowiedzi zwróconej przez interfejs API w kroku 1. - Aby zaktualizować ustawienia marki kanału, wywołaj metodę
channels.update
. Ustaw wartość właściwości brandingSettings.image.bannerExternalUrl
na adres URL uzyskany w kroku 2.
Reprezentacja zasobu
Struktura JSON poniżej pokazuje format zasobu channelBanners
:
{
"kind": "youtube#channelBannerResource",
"etag": etag,
"url": string
}
Właściwości
Właściwości występujące w tym zasobie są opisane w tabeli poniżej:
Właściwości |
kind |
string Określa typ zasobu interfejsu API. Wartość będzie wynosić youtube#channelBannerResource . |
etag |
etag Etag tego zasobu. |
url |
string Adres URL obrazu banera. Po wywołaniu metody channelBanners.insert wyodrębnij tę wartość z odpowiedzi interfejsu API. Następnie wywołaj metodę channels.update i ustaw adres URL jako wartość właściwości brandingSettings.image.bannerExternalUrl , aby ustawić obraz banera dla kanału. |
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-12-21 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 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"]]