ما در حال بهروزرسانی Data API هستیم تا با نحوه شمارش بازدیدهای YouTube برای Shorts مطابقت داشته باشد.
بیشتر بدانید
Thumbnails
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
یک منبع thumbnail
اندازه های مختلف تصویر کوچک مرتبط با یک منبع را شناسایی می کند. لطفاً به ویژگی های زیر در تصاویر کوچک توجه کنید:
- ویژگی
snippet.thumbnails
یک منبع، شیئی است که تصاویر کوچک موجود برای آن منبع را شناسایی می کند. - یک منبع
thumbnail
شامل یک سری اشیاء است. نام هر شی ( default
، medium
، high
و غیره) به اندازه تصویر کوچک اشاره دارد. - انواع مختلف منابع ممکن است از اندازه های مختلف تصویر کوچک پشتیبانی کنند.
- انواع مختلف منابع ممکن است اندازه های متفاوتی را برای تصاویر کوچک با نام یکسان تعریف کنند. برای مثال، تصویر کوچک
default
برای یک منبع video
معمولاً 120 پیکسل در 90 پیکسل است و تصویر کوچک default
برای یک منبع channel
معمولاً 88 پیکسل در 88 پیکسل است. - بسته به وضوح تصویر اصلی یا محتوای آپلود شده در YouTube، منابعی از همان نوع ممکن است همچنان اندازههای تصویر کوچک متفاوتی برای تصاویر خاص داشته باشند. برای مثال، یک ویدیوی HD ممکن است از تصاویر کوچک با وضوح بالاتر نسبت به ویدیوهای غیر HD پشتیبانی کند.
- هر شی که حاوی اطلاعات مربوط به اندازه تصویر بند انگشتی است دارای یک ویژگی
width
و یک ویژگی height
است. با این حال، ویژگی های عرض و ارتفاع ممکن است برای آن تصویر برگردانده نشود. - اگر یک تصویر کوچک آپلود شده با ابعاد مورد نیاز مطابقت نداشته باشد، اندازه تصویر بدون تغییر نسبت ابعاد آن برای مطابقت با اندازه صحیح تغییر میکند. تصویر برش داده نشده است، اما ممکن است دارای نوارهای سیاه باشد تا اندازه درست باشد.
روش ها
API از روش های زیر برای منابع thumbnails
پشتیبانی می کند:
- set
- یک تصویر کوچک ویدیوی سفارشی را در YouTube آپلود می کند و آن را برای یک ویدیو تنظیم می کند.
نمایندگی منابع
ساختار JSON زیر فرمت یک منبع thumbnails
را نشان می دهد:
{
"default": {
"url": string,
"width": unsigned integer,
"height": unsigned integer
},
"medium": {
"url": string,
"width": unsigned integer,
"height": unsigned integer
},
"high": {
"url": string,
"width": unsigned integer,
"height": unsigned integer
},
"standard": {
"url": string,
"width": unsigned integer,
"height": unsigned integer
},
"maxres": {
"url": string,
"width": unsigned integer,
"height": unsigned integer
}
}
خواص
جدول زیر ویژگی های ظاهر شده در این منبع را تعریف می کند:
خواص |
---|
default | object تصویر بندانگشتی پیش فرض. تصویر کوچک پیشفرض یک ویدیو - یا منبعی که به یک ویدیو اشاره میکند، مانند آیتم فهرست پخش یا نتیجه جستجو - 120 پیکسل عرض و 90 پیکسل ارتفاع دارد. تصویر کوچک پیشفرض برای یک کانال 88 پیکسل عرض و 88 پیکسل ارتفاع است. |
default. url | string URL تصویر |
default. width | unsigned integer عرض تصویر |
default. height | unsigned integer ارتفاع تصویر |
medium | object یک نسخه با وضوح بالاتر از تصویر کوچک. برای یک ویدیو (یا منبعی که به یک ویدیو اشاره دارد)، این تصویر 320 پیکسل عرض و 180 پیکسل ارتفاع دارد. برای یک کانال، این تصویر 240 پیکسل عرض و 240 پیکسل ارتفاع دارد. |
medium. url | string URL تصویر |
medium. width | unsigned integer عرض تصویر |
medium. height | unsigned integer ارتفاع تصویر |
high | object یک نسخه با وضوح بالا از تصویر کوچک. برای یک ویدیو (یا منبعی که به یک ویدیو اشاره دارد)، این تصویر 480 پیکسل عرض و 360 پیکسل ارتفاع دارد. برای یک کانال، این تصویر 800 پیکسل عرض و 800 پیکسل ارتفاع دارد. |
high. url | string URL تصویر |
high. width | unsigned integer عرض تصویر |
high. height | unsigned integer ارتفاع تصویر |
standard | object حتی نسخه ای با وضوح بالاتر از تصویر کوچک نسبت به تصویر با وضوح high . این تصویر برای برخی از ویدیوها و سایر منابعی که به ویدیوها اشاره دارند، مانند موارد فهرست پخش یا نتایج جستجو، در دسترس است. این تصویر 640 پیکسل عرض و 480 پیکسل ارتفاع دارد. |
standard. url | string URL تصویر |
standard. width | unsigned integer عرض تصویر |
standard. height | unsigned integer ارتفاع تصویر |
maxres | object بالاترین وضوح تصویر تصویر کوچک. این اندازه تصویر برای برخی از ویدیوها و سایر منابعی که به ویدیوها اشاره دارند، مانند موارد فهرست پخش یا نتایج جستجو، در دسترس است. این تصویر 1280 پیکسل عرض و 720 پیکسل ارتفاع دارد. |
maxres. url | string URL تصویر |
maxres. width | unsigned integer عرض تصویر |
maxres. height | unsigned integer ارتفاع تصویر |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-21 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-21 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eA resource's \u003ccode\u003esnippet.thumbnails\u003c/code\u003e property contains an object, and each of these objects has properties such as \u003ccode\u003edefault\u003c/code\u003e, \u003ccode\u003emedium\u003c/code\u003e, and \u003ccode\u003ehigh\u003c/code\u003e, which identify the different available thumbnail image sizes for that specific resource.\u003c/p\u003e\n"],["\u003cp\u003eThumbnail image sizes can vary significantly between different resource types (e.g., videos vs. channels), and even among resources of the same type, based on the resolution of the original uploaded content.\u003c/p\u003e\n"],["\u003cp\u003eEach thumbnail image size object contains a \u003ccode\u003eurl\u003c/code\u003e, \u003ccode\u003ewidth\u003c/code\u003e, and \u003ccode\u003eheight\u003c/code\u003e property, but the width and height may not always be returned.\u003c/p\u003e\n"],["\u003cp\u003eWhen a custom thumbnail image is uploaded, it's resized to match the required dimensions without changing its aspect ratio, which may result in black bars being added.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ethumbnails\u003c/code\u003e resource offers various image size options, such as \u003ccode\u003edefault\u003c/code\u003e, \u003ccode\u003emedium\u003c/code\u003e, \u003ccode\u003ehigh\u003c/code\u003e, \u003ccode\u003estandard\u003c/code\u003e, and \u003ccode\u003emaxres\u003c/code\u003e, each with distinct resolutions to accommodate different display needs.\u003c/p\u003e\n"]]],["Thumbnail resources define various image sizes (`default`, `medium`, `high`, etc.) for different resource types. Image dimensions vary by resource type and resolution. The `thumbnails` resource is an object within `snippet.thumbnails` that holds size-specific objects, each with `url`, `width`, and `height` properties. The `set` method allows uploading a custom video thumbnail. When the dimensions don't match, the image is resized, maintaining its aspect ratio, with possible added black bars.\n"],null,["# Thumbnails\n\nA **thumbnail** resource identifies different thumbnail image sizes associated with a resource. Please note the following characteristics of thumbnail images:\n\n- A resource's `snippet.thumbnails` property is an object that identifies the thumbnail images available for that resource.\n- A `thumbnail` resource contains a series of objects. The name of each object (`default`, `medium`, `high`, etc.) refers to the thumbnail image size.\n- Different types of resources may support different thumbnail image sizes.\n- Different types of resources may define different sizes for thumbnail images with the same name. For example, the `default` thumbnail image for a `video` resource is typically 120px by 90px, and the `default` thumbnail image for a `channel` resource is typically 88px by 88px.\n- Resources of the same type may still have different thumbnail image sizes for certain images depending on the resolution of the original image or content uploaded to YouTube. For example, an HD video may support higher resolution thumbnails than non-HD videos.\n- Each object that contains information about a thumbnail image size has a `width` property and a `height` property. However, the width and height properties may not be returned for that image.\n- If an uploaded thumbnail image does not match the required dimensions, the image is resized to match the correct size without changing its aspect ratio. The image is not cropped, but may include black bars so that the size is correct.\n\n\u003cbr /\u003e\n\nMethods\n-------\n\nThe API supports the following methods for `thumbnails` resources:\n\n[set](/youtube/v3/docs/thumbnails/set)\n: Uploads a custom video thumbnail to YouTube and sets it for a video.\n\nResource representation\n-----------------------\n\nThe following JSON structure shows the format of a `thumbnails` resource: \n\n```text\n{\n \"default\": {\n \"url\": string,\n \"width\": unsigned integer,\n \"height\": unsigned integer\n },\n \"medium\": {\n \"url\": string,\n \"width\": unsigned integer,\n \"height\": unsigned integer\n },\n \"high\": {\n \"url\": string,\n \"width\": unsigned integer,\n \"height\": unsigned integer\n },\n \"standard\": {\n \"url\": string,\n \"width\": unsigned integer,\n \"height\": unsigned integer\n },\n \"maxres\": {\n \"url\": string,\n \"width\": unsigned integer,\n \"height\": unsigned integer\n }\n}\n```\n\n### Properties\n\nThe following table defines the properties that appear in this resource:\n\n| Properties ||\n|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `default` | `object` The default thumbnail image. The default thumbnail for a video -- or a resource that refers to a video, such as a playlist item or search result -- is 120px wide and 90px tall. The default thumbnail for a channel is 88px wide and 88px tall. |\n| default.`url` | `string` The image's URL. |\n| default.`width` | `unsigned integer` The image's width. |\n| default.`height` | `unsigned integer` The image's height. |\n| `medium` | `object` A higher resolution version of the thumbnail image. For a video (or a resource that refers to a video), this image is 320px wide and 180px tall. For a channel, this image is 240px wide and 240px tall. |\n| medium.`url` | `string` The image's URL. |\n| medium.`width` | `unsigned integer` The image's width. |\n| medium.`height` | `unsigned integer` The image's height. |\n| `high` | `object` A high resolution version of the thumbnail image. For a video (or a resource that refers to a video), this image is 480px wide and 360px tall. For a channel, this image is 800px wide and 800px tall. |\n| high.`url` | `string` The image's URL. |\n| high.`width` | `unsigned integer` The image's width. |\n| high.`height` | `unsigned integer` The image's height. |\n| `standard` | `object` An even higher resolution version of the thumbnail image than the `high` resolution image. This image is available for some videos and other resources that refer to videos, like playlist items or search results. This image is 640px wide and 480px tall. |\n| standard.`url` | `string` The image's URL. |\n| standard.`width` | `unsigned integer` The image's width. |\n| standard.`height` | `unsigned integer` The image's height. |\n| `maxres` | `object` The highest resolution version of the thumbnail image. This image size is available for some videos and other resources that refer to videos, like playlist items or search results. This image is 1280px wide and 720px tall. |\n| maxres.`url` | `string` The image's URL. |\n| maxres.`width` | `unsigned integer` The image's width. |\n| maxres.`height` | `unsigned integer` The image's height. |"]]