نحن بصدد تعديل Data API لتتطابق مع طريقة YouTube في احتساب مشاهدات Shorts.
مزيد من المعلومات
Thumbnails
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يحدّد مورد thumbnail
أحجامًا مختلفة للصور المصغّرة المرتبطة بمورد. يُرجى مراعاة الخصائص التالية للصور المصغّرة:
- السمة
snippet.thumbnails
الخاصة بأحد المراجع هي عنصر يعرّف الصور المصغّرة المتاحة لهذا المرجع. - يحتوي مرجع
thumbnail
على سلسلة من العناصر. يشير اسم كل عنصر (default
وmedium
وhigh
وما إلى ذلك) إلى حجم صورة مصغّرة. - قد تتوافق أنواع مختلفة من المراجع مع أحجام مختلفة للصور المصغّرة.
- قد تحدّد أنواع مختلفة من المراجع أحجامًا مختلفة للصور المصغّرة التي تحمل الاسم نفسه. على سبيل المثال، يبلغ حجم الصورة المصغّرة
default
الخاصة بمورد video
عادةً 120 بكسل × 90 بكسل، ويبلغ حجم الصورة المصغّرة default
الخاصة بمورد channel
عادةً 88 بكسل × 88 بكسل. - قد تظل أحجام الصور المصغّرة مختلفة للموارد من النوع نفسه بالنسبة إلى صور معيّنة، وذلك استنادًا إلى دقة الصورة الأصلية أو المحتوى الذي تم تحميله إلى YouTube. على سبيل المثال، قد يتيح فيديو عالي الدقة صورًا مصغّرة بدرجة دقة أعلى من الفيديوهات غير العالية الدقة.
- يحتوي كل عنصر يتضمّن معلومات عن حجم الصورة المصغّرة على السمتَين
width
وheight
. ومع ذلك، قد لا يتم عرض خصائص العرض والارتفاع لهذه الصورة. - إذا كانت الصورة المصغّرة التي تم تحميلها لا تتطابق مع الأبعاد المطلوبة، سيتم تغيير حجم الصورة لتتطابق مع الحجم الصحيح بدون تغيير نسبة العرض إلى الارتفاع. لا يتم قص الصورة، ولكن قد تتضمّن أشرطة سوداء ليكون الحجم صحيحًا.
الطُرق
تتيح واجهة برمجة التطبيقات الطرق التالية لموارد 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 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-08-21 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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"]],["تاريخ التعديل الأخير: 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. |"]]