YouTube Embedded Players and Player Parameters

نمای کلی

این سند نحوه جاسازی پخش‌کننده YouTube در برنامه شما را توضیح می‌دهد و همچنین پارامترهای موجود در پخش‌کننده جاسازی‌شده YouTube را تعریف می‌کند.

با افزودن پارامترها به نشانی وب IFrame، می‌توانید تجربه بازپخش را در برنامه‌تان سفارشی‌سازی کنید. برای مثال، می‌توانید بااستفاده از پارامتر autoplay ویدیوها را به‌طور خودکار پخش کنید یا بااستفاده از پارامتر loop ویدیو را به‌طور مکرر پخش کنید. همچنین می‌توانید از پارامتر enablejsapi استفاده کنید تا پخش‌کننده بتواند ازطریق IFrame Player API کنترل شود.

این صفحه درحال‌حاضر همه پارامترهای پشتیبانی‌شده در هر پخش‌کننده جاسازی‌شده YouTube را تعریف می‌کند. هر تعریف پارامتر، پخش‌کننده‌هایی را که از پارامتر مربوطه پشتیبانی می‌کنند شناسایی می‌کند.

توجه: پخش‌کننده‌های جاسازی‌شده باید نمای دیدی داشته باشند که حداقل ۲۰۰ پیکسل در ۲۰۰ پیکسل باشد. اگر پخش‌کننده کنترل‌ها را نمایش می‌دهد، باید به‌اندازه کافی بزرگ باشد تا کنترل‌ها را به‌طور کامل نمایش دهد بدون اینکه نمای هدف را به کمتر از حداقل اندازه کاهش دهد. توصیه می‌کنیم که پخش‌کننده‌های ۱۶:۹ حداقل ۴۸۰ پیکسل عرض و ۲۷۰ پیکسل ارتفاع داشته باشند.

جاسازی پخش‌کننده YouTube

می‌توانید از هریک از روش‌های زیر برای جاسازی پخش‌کننده YouTube در برنامه خود و مشخص کردن پارامترهای پخش‌کننده استفاده کنید. توجه داشته باشید که دستورالعمل‌های زیر نشان می‌دهند که چگونه می‌توان پخش‌کننده‌ای را جاسازی کرد که یک ویدیو را بارگیری می‌کند. بخش زیر نحوه پیکربندی پخش‌کننده برای بار کردن فهرست پخش یا ویدیوهای بارگذاری‌شده کاربر را توضیح می‌دهد.

جاسازی پخش‌کننده بااستفاده از برچسب <iframe>

یک برچسب <iframe> در برنامه خود تعریف کنید که در آن نشانی وب src محتوایی را که پخش‌کننده بارگیری می‌کند و همچنین هر پارامتر پخش‌کننده دیگری را که می‌خواهید تنظیم کنید، مشخص کند. پارامترهای height و width برچسب <iframe> ابعاد پخش‌کننده را مشخص می‌کنند.

اگر عنصر <iframe> را خودتان ایجاد کنید (به‌جای استفاده از IFrame Player API برای ایجاد آن)، می‌توانید پارامترهای پخش‌کننده را مستقیماً به انتهای نشانی وب اضافه کنید. نشانی وب قالب زیر را دارد:

https://www.youtube.com/embed/VIDEO_ID

برچسب <iframe> زیر پخش‌کننده‌ای با ابعاد ۶۴۰ در ۳۶۰ پیکسل را بار می‌کند که ویدیو YouTube M7lc1UVf-VE را پخش خواهد کرد. ازآنجایی‌که نشانی وب پارامتر autoplay را روی 1 تنظیم می‌کند، ویدیو به‌محض بار شدن پخش‌کننده به‌طور خودکار پخش می‌شود.

<iframe id="ytplayer" type="text/html" width="640" height="360"
  src="https://www.youtube.com/embed/M7lc1UVf-VE?autoplay=1&origin=http://example.com"
  frameborder="0"></iframe>

جاسازی پخش‌کننده بااستفاده از IFrame Player API

دستورالعمل‌های IFrame Player API را دنبال کنید تا پس‌از بار شدن کد جاوا اسکریپت Player API، پخش‌کننده ویدیو را در صفحه وب یا برنامه‌تان درج کنید. پارامتر دوم در سازنده پخش‌کننده ویدیو، شیئی است که گزینه‌های پخش‌کننده را مشخص می‌کند. در آن شیء، ویژگی playerVars پارامترهای بازیکن را شناسایی می‌کند.

کد HTML و جاوا اسکریپت زیر نمونه ساده‌ای را نشان می‌دهد که پخش‌کننده YouTube را در عنصر صفحه‌ای که مقدار id آن ytplayer است درج می‌کند. تابع onYouTubePlayerAPIReady() مشخص‌شده در اینجا به‌طور خودکار پس‌از بار شدن کد IFrame Player API فراخوانده می‌شود. این کد هیچ پارامتر پخش‌کننده‌ای را تعریف نمی‌کند و همچنین سایر کنترل‌کننده‌های رویداد را تعریف نمی‌کند.

<div id="ytplayer"></div>

<script>
  // Load the IFrame Player API code asynchronously.
  var tag = document.createElement('script');
  tag.src = "https://www.youtube.com/player_api";
  var firstScriptTag = document.getElementsByTagName('script')[0];
  firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

  // Replace the 'ytplayer' element with an <iframe> and
  // YouTube player after the API code downloads.
  var player;
  function onYouTubePlayerAPIReady() {
    player = new YT.Player('ytplayer', {
      height: '360',
      width: '640',
      videoId: 'M7lc1UVf-VE'
    });
  }
</script>

انتخاب محتوا برای پخش

می‌توانید پخش‌کننده جاسازی‌شده خود را برای بارگذاری یک ویدیو، یک فهرست پخش، یا ویدیوهای بارگذاری‌شده توسط یک کاربر پیکربندی کنید.

فهرست زیر این گزینه‌ها را توضیح می‌دهد:

  • بار کردن ویدیو

    برای جاسازی IFrame، شناسه ویدیو YouTube برای ویدیویی که می‌خواهید بارگیری کنید در نشانی وب src IFrame مشخص شده است.

    https://www.youtube.com/embed/VIDEO_ID

    اگر از YouTube Data API (v3) استفاده می‌کنید، می‌توانید این نشانی‌های وب را با بازیابی شناسه‌های ویدیو از نتایج جستجو، منابع آیتم فهرست پخش، منابع ویدیو، یا منابع دیگر به‌صورت برنامه‌نویسی‌شده بسازید. پس‌از دریافت شناسه ویدیو، نوشتار VIDEO_ID را در نشانی‌های وب بالا با آن مقدار جایگزین کنید تا نشانی وب پخش‌کننده ایجاد شود.

  • بار کردن فهرست پخش

    پارامتر پخش‌کننده listType را روی playlist تنظیم کنید. علاوه‌براین، پارامتر پخش‌کننده list را روی شناسه فهرست پخش YouTube که می‌خواهید بار شود تنظیم کنید.

    https://www.youtube.com/embed?listType=playlist&list=PLAYLIST_ID

    توجه داشته باشید که باید شناسه فهرست پخش را با حروف PL پیشوند کنید، همان‌طور که در مثال زیر نشان داده شده است:

    https://www.youtube.com/embed?listType=playlist&list=PLC77007E23FF423C6

    اگر از YouTube Data API (نسخه ۳) استفاده می‌کنید، می‌توانید این نشانی‌های وب را با بازیابی شناسه‌های فهرست پخش از نتایج جستجو، منابع کانال، یا منابع فعالیت به‌صورت برنامه‌نویسی‌شده بسازید. پس‌از دریافت شناسه فهرست پخش، نوشتار PLAYLIST_ID را در نشانی وب بالا با آن مقدار جایگزین کنید.

  • بار کردن ویدیوهای بارگذاری‌شده کاربر

    پارامتر پخش‌کننده listType را روی user_uploads تنظیم کنید. علاوه‌براین، پارامتر پخش‌کننده list را روی نام کاربری YouTube که می‌خواهید ویدیوهای بارگذاری‌شده‌اش را بار کنید تنظیم کنید.

    https://www.youtube.com/embed?listType=user_uploads&list=USERNAME

پارامترهای پشتیبانی‌شده

همه پارامترهای زیر اختیاری هستند.

پارامترها

autoplay

این پارامتر مشخص می‌کند که آیا ویدیو اولیه به‌طور خودکار هنگام بارگیری پخش‌کننده شروع به پخش می‌کند یا نه. مقادیر پشتیبانی‌شده 0 یا 1 است. مقدار پیش‌فرض 0 است.

اگر «پخش خودکار» را فعال کنید، بازپخش بدون هیچ‌گونه تعامل کاربر با پخش‌کننده انجام خواهد شد؛ بنابراین، جمع‌آوری و هم‌رسانی داده‌های بازپخش هنگام بار شدن صفحه انجام خواهد شد.

cc_lang_pref

این پارامتر زبان پیش‌فرضی را که پخش‌کننده برای نمایش زیرنویس ناشنوایان استفاده می‌کند مشخص می‌کند. مقدار پارامتر را روی کد زبان دوحرفی ISO 639-1 یا برچسب زبان BCP 47 (مانند fr-CA) تنظیم کنید.

اگر از این پارامتر استفاده کنید و پارامتر cc_load_policy را نیز روی 1 تنظیم کنید، پخش‌کننده هنگام بارگیری، زیرنویس ناشنوایان را به زبان مشخص‌شده نشان می‌دهد. اگر پارامتر cc_load_policy را نیز تنظیم نکنید، زیرنویس ناشنوایان به‌طور پیش‌فرض نمایش داده نمی‌شود، اما اگر کاربر تصمیم بگیرد زیرنویس ناشنوایان را روشن کند، به زبان مشخص‌شده نمایش داده می‌شود.

cc_load_policy

تنظیم مقدار پارامتر روی 1 باعث می‌شود که زیرنویس ناشنوایان به‌طور پیش‌فرض نشان داده شود، حتی اگر کاربر زیرنویس را خاموش کرده باشد. رفتار پیش‌فرض براساس اولویت کاربر است.

color

این پارامتر رنگی را مشخص می‌کند که در نوار پیشرفت ویدیو پخش‌کننده برای برجسته کردن مقدار ویدیویی که بیننده قبلاً دیده است استفاده می‌شود. مقادیر معتبر پارامتر red و white هستند و به‌طور پیش‌فرض، پخش‌کننده از رنگ قرمز در نوار پیشرفت ویدیو استفاده می‌کند.

controls

این پارامتر نشان می‌دهد که آیا کنترل‌های پخش‌کننده ویدیو نمایش داده می‌شوند یا نه:

  • controls=0 – کنترل‌های پخش‌کننده در پخش‌کننده نمایش داده نمی‌شوند.
  • controls=1 (پیش‌فرض) – کنترل‌های پخش‌کننده در پخش‌کننده نمایش داده می‌شوند.

disablekb

تنظیم مقدار پارامتر روی 1 باعث می‌شود پخش‌کننده به کنترل‌های صفحه‌کلید پاسخ ندهد. مقدار پیش‌فرض 0 است، یعنی کنترل‌های صفحه‌کلید فعال است. کنترل‌های صفحه‌کلید که درحال‌حاضر پشتیبانی می‌شوند عبارت‌اند از:

  • کلید فاصله یا [k]: پخش / مکث
  • کلید چپ: ۵ ثانیه در ویدیو فعلی به عقب می‌رود
  • کلید راست‌بَر: ۵ ثانیه جلو رفتن در ویدیو کنونی
  • کلید بالابر: افزایش صدا
  • کلید پایین‌بر: کاهش صدا
  • [f]: روشن/خاموش کردن نمایش تمام‌صفحه
  • [j]: ۱۰ ثانیه در ویدیو فعلی به عقب بروید
  • [l]: ۱۰ ثانیه جلو رفتن در ویدیو فعلی
  • [m]: بی‌صدا یا صدادار کردن ویدیو
  • [0-9]: پرش به نقطه‌ای در ویدیو. 0 به ابتدای ویدیو می‌رود، 1 به نقطه ۱۰٪ ویدیو می‌رود، 2 به نقطه ۲۰٪ ویدیو می‌رود، و به همین ترتیب.

enablejsapi

تنظیم مقدار پارامتر روی 1 به پخش‌کننده امکان می‌دهد ازطریق تماس‌های میانای برنامه‌سازی کاربردی پخش‌کننده IFrame کنترل شود. مقدار پیش‌فرض 0 است، به این معنی که پخش‌کننده را نمی‌توان بااستفاده از آن API کنترل کرد.

برای اطلاعات بیشتر درباره IFrame API و نحوه استفاده از آن، به اسناد IFrame API مراجعه کنید.

end

این پارامتر زمانی را مشخص می‌کند که پخش‌کننده باید پخش ویدیو را متوقف کند. این زمان برحسب ثانیه از شروع ویدیو اندازه‌گیری می‌شود. مقدار پارامتر یک عدد صحیح مثبت است.

توجه داشته باشید که زمان از ابتدای ویدیو اندازه‌گیری می‌شود و نه از مقدار پارامتر پخش‌کننده start یا پارامتر startSeconds که در توابع YouTube Player API برای بارگیری یا صف‌بندی ویدیو استفاده می‌شود.

fs

تنظیم این پارامتر روی 0 از نمایش دکمه تمام‌صفحه در پخش‌کننده جلوگیری می‌کند. مقدار پیش‌فرض 1 است که باعث می‌شود دکمه تمام‌صفحه نمایش داده شود.

hl

زبان واسط پخش‌کننده را تنظیم می‌کند. مقدار پارامتر یک کد زبان دو حرفی ISO 639-1 یا یک منطقه زبانی کاملاً مشخص است. برای مثال، fr و fr-ca هر دو مقادیر معتبری هستند. کدهای ورودی زبان دیگر، مانند برچسب‌های زبان IETF (BCP 47) نیز ممکن است به‌درستی مدیریت شوند.

زبان واسط برای نکته‌ابزارها در پخش‌کننده استفاده می‌شود و همچنین بر قطعه زیرنویس ناشنوایان پیش‌فرض تأثیر می‌گذارد. توجه داشته باشید که YouTube ممکن است براساس اولویت‌های زبان فردی کاربر و دردسترس بودن قطعه‌های زیرنویس ناشنوایان، زبان قطعه زیرنویس ناشنوایان متفاوتی را برای یک کاربر خاص انتخاب کند.

iv_load_policy

تنظیم مقدار پارامتر روی 1 باعث می‌شود حاشیه‌نویسی‌های ویدیو به‌طور پیش‌فرض نشان داده شود، درحالی‌که تنظیم روی 3 باعث می‌شود حاشیه‌نویسی‌های ویدیو به‌طور پیش‌فرض نشان داده نشود. مقدار پیش‌فرض 1 است.

list

پارامتر list، در ارتباط با پارامتر listType، محتوایی را که در پخش‌کننده بار می‌شود شناسایی می‌کند.
  • اگر مقدار پارامتر listType برابر با user_uploads باشد، مقدار پارامتر list کانال YouTube را که ویدیوهای بارگذاری‌شده آن بار خواهد شد شناسایی می‌کند.
  • اگر مقدار پارامتر listType برابر با playlist باشد، مقدار پارامتر list شناسه فهرست پخش YouTube را مشخص می‌کند. در مقدار پارامتر، باید شناسه فهرست پخش را با حروف PL پیشوند کنید، همان‌طور که در مثال زیر نشان داده شده است.
    https://www.youtube.com/embed?
        listType=playlist
        &list=PLC77007E23FF423C6
  • اگر مقدار پارامتر listType برابر با search باشد، مقدار پارامتر list پُرسمان جستجو را مشخص می‌کند. توجه: این عملکرد منسوخ شده است و از ۱۵ نوامبر ۲۰۲۰ دیگر پشتیبانی نخواهد شد.
توجه: اگر مقادیری را برای پارامترهای list و listType مشخص کنید، نشانی وب جاسازی IFrame نیازی به مشخص کردن شناسه ویدیو ندارد.

listType

پارامتر listType، در ارتباط با پارامتر list، محتوایی را که در پخش‌کننده بار می‌شود شناسایی می‌کند. مقادیر معتبر پارامتر playlist و user_uploads هستند.

اگر مقادیری را برای پارامترهای list و listType مشخص کنید، نشانی وب جاسازی IFrame نیازی به مشخص کردن شناسه ویدیو ندارد.

توجه: مقدار پارامتر سوم، search، منسوخ شده است و از ۱۵ نوامبر ۲۰۲۰ دیگر پشتیبانی نخواهد شد.

loop

در مورد یک پخش‌کننده ویدیو، تنظیم 1 باعث می‌شود پخش‌کننده ویدیو اولیه را بارها و بارها پخش کند. در مورد پخش‌کننده فهرست پخش (یا پخش‌کننده سفارشی)، پخش‌کننده کل فهرست پخش را پخش می‌کند و سپس دوباره از اولین ویدیو شروع می‌کند.

مقادیر پشتیبانی‌شده 0 و 1 هستند و مقدار پیش‌فرض 0 است.

توجه: این پارامتر در جاسازی‌های IFrame پشتیبانی محدودی دارد. برای تکرار یک ویدیو، مقدار پارامتر loop را روی 1 تنظیم کنید و مقدار پارامتر playlist را روی همان شناسه ویدیویی که قبلاً در نشانی وب Player API مشخص شده است تنظیم کنید:
https://www.youtube.com/embed/VIDEO_ID?playlist=VIDEO_ID&loop=1

modestbranding

توجه: این پارامتر منسوخ شده است و تأثیری ندارد. برای اطلاعات بیشتر، اعلان منسوخ شدن را ببینید.

origin

این پارامتر یک اقدام امنیتی اضافی برای IFrame API ارائه می‌دهد و فقط برای جاسازی‌های IFrame پشتیبانی می‌شود. اگر از IFrame API استفاده می‌کنید، یعنی مقدار پارامتر enablejsapi را روی 1 تنظیم می‌کنید، همیشه باید دامنه‌تان را به‌عنوان مقدار پارامتر origin مشخص کنید.

playlist

این پارامتر فهرستی از شناسه‌های ویدیو را که با کاما از هم جدا شده‌اند برای پخش مشخص می‌کند. اگر مقداری را مشخص کنید، اولین ویدیویی که پخش می‌شود VIDEO_ID مشخص‌شده در مسیر نشانی وب خواهد بود و ویدیوهای مشخص‌شده در پارامتر playlist پس‌از آن پخش خواهند شد.

playsinline

این پارامتر کنترل می‌کند که ویدیوها در iOS به‌صورت درون‌خطی پخش شوند یا تمام‌صفحه. مقادیر معتبر عبارت‌اند از:
  • ‫0: نتایج در بازپخش تمام‌صفحه. درحال‌حاضر این مقدار پیش‌فرض است، اما ممکن است مقدار پیش‌فرض تغییر کند.
  • 1: نتایج در بازپخش ردیفی برای مرورگرهای تلفن همراه و برای WebViews ایجادشده با ویژگی allowsInlineMediaPlayback تنظیم‌شده روی YES.

rel

توجه: این پارامتر در ۲۵ سپتامبر ۲۰۱۸ یا پس‌از آن تغییر می‌کند.

پیش‌از این تغییر، این پارامتر نشان می‌دهد که آیا پخش‌کننده باید ویدیوهای مرتبط را پس‌از پایان پخش ویدیو اولیه نشان دهد یا نه.
  • اگر مقدار پارامتر روی 1 تنظیم شده باشد، که مقدار پیش‌فرض است، پخش‌کننده ویدیوهای مرتبط را نشان می‌دهد.
  • اگر مقدار پارامتر روی 0 تنظیم شده باشد، پخش‌کننده ویدیوهای مرتبط را نشان نمی‌دهد.
پس‌از این تغییر، نمی‌توانید ویدیوهای مرتبط را غیرفعال کنید. درعوض، اگر پارامتر rel روی 0 تنظیم شده باشد، ویدیوهای مرتبط از همان کانالی خواهند بود که ویدیو به‌تازگی پخش شده است.

start

این پارامتر باعث می‌شود پخش‌کننده ویدیو را از ثانیه مشخص‌شده از شروع ویدیو پخش کند. مقدار پارامتر عدد صحیح مثبت است. توجه داشته باشید که مشابه عملکرد seekTo، پخش‌کننده نزدیک‌ترین فریم کلیدی به زمانی را که مشخص می‌کنید جستجو می‌کند. این یعنی گاهی اوقات ممکن است نشانگر پخش به کمی قبل‌از زمان درخواست‌شده برود، که معمولاً بیشتر از حدود دو ثانیه نیست.

widget_referrer

این پارامتر نشانی وبی را که پخش‌کننده در آن جاسازی شده است شناسایی می‌کند. این مقدار در گزارش YouTube Analytics زمانی استفاده می‌شود که پخش‌کننده YouTube در یک ابزاره جاسازی شده باشد و سپس آن ابزاره در یک صفحه وب یا برنامه جاسازی شود. در این سناریو، پارامتر origin دامنه ارائه‌دهنده ابزاره را شناسایی می‌کند، اما YouTube Analytics نباید ارائه‌دهنده ابزاره را به‌عنوان منبع ترافیک واقعی شناسایی کند. درعوض، YouTube Analytics از مقدار پارامتر widget_referrer برای شناسایی دامنه مرتبط با منبع ترافیک استفاده می‌کند.

سابقه ویرایش

August 15, 2023

Note: This is a deprecation announcement for the modestbranding parameter.

The modestbranding parameter is deprecated and will have no effect. To align with YouTube's branding requirements, the player now determines the appropriate branding treatment based on a combination of factors, including player size, other API parameters (e.g. controls), and additional signals.

April 27, 2021

The playsinline parameter definition has been updated slightly to explain that the parameter pertains to both mobile browsers on iOS and iOS WebViews.

October 15, 2020

The autoplay parameter definition has been updated to explain that if you enable Autoplay, playback will occur without any user interaction with the player; playback data collection and sharing will therefore occur upon page load.

October 13, 2020

Note: This is a deprecation announcement for the embedded player functionality that lets you configure the player to load search results. This announcement affects the player's list and listType parameters.

This change will become effective on or after 15 November 2020. After that time, setting the listType parameter value to search will generate a 4xx response code, such as 404 (Not Found) or 410 (Gone).

As an alternative, you can use the YouTube Data API's search.list method to retrieve search results and then load selected videos in the player.

In addition to the change described above, the showinfo parameter, which was deprecated in 2018, has been removed from this document.

August 23, 2018

Note: This is a deprecation announcement for the showinfo parameter. In addition, the behavior for the rel parameter is changing. Titles, channel information, and related videos are an important part of YouTube's core user experience, and these changes help to make the YouTube viewing experience consistent across different platforms.

  • The behavior for the rel parameter is changing on or after September 25, 2018. The effect of the change is that you will not be able to disable related videos. However, you will have the option of specifying that the related videos shown in the player should be from the same channel as the video that was just played.

    To be more specific:
    • Prior to the change, if the parameter's value is set to 0, then the player does not show related videos.
    • After the change, if the rel parameter is set to 0, the player will show related videos that are from the same channel as the video that was just played.
  • The showinfo parameter, which indicates whether the player should display information like the video title and uploader before the video starts playing, is also being deprecated. Following the change, the channel avatar and video title will always display before playback begins, when playback is paused, and when playback ends. The avatar being displayed is new behavior that will be consistent across all embedded players.

These changes will become effective on or after September 25, 2018. After that time, the showinfo parameter will be ignored. The behavior following the changes is consistent with the current default behavior for embedded players with the exception of the channel avatar changes mentioned above.

August 16, 2018

The cc_lang_pref parameter can be used to specify the default language that the player will use to display captions. This parameter can be used in conjunction with the cc_load_policy parameter to automatically show captions in the specified language during playback.

September 15, 2017

The controls parameter's definition has been updated to remove references to the deprecated Flash (AS3) player. The value 2 has been deprecated as it was originally designed to provide a performance improvement for embeds that loaded a Flash player.

June 12, 2017

The new widget_referrer parameter helps to enable more accurate YouTube Analytics reporting when the YouTube player is embedded in a widget, and that widget is then embedded in a web page or application.

November 1, 2016

This document has been updated to remove references to the deprecated Flash (AS3) player as well as to parameters only supported by that player. The YouTube Flash player was deprecated in January 2015.

October 20, 2016

This update contains the following changes:

  • The disablekb parameter definition has been corrected to note that the default value is 0, which means that keyboard controls are enabled. A value of 1 indicates that keyboard controls should be disabled.

    The list of keyboard controls that the player supports has also been updated to include the following:

    • [f]: Toggle full-screen display
    • [j]: Jump back 10 seconds in the current video
    • [k]: Play / Pause
    • [l]: Jump ahead 10 seconds in the current video
    • [m]: Mute or unmute the video
    • [0-9]: Jump to a point in the video. 0 jumps to the beginning of the video, 1 jumps to the time 10% into the video, 2 jumps to the point 20% into the video, and so forth.

    In addition, the effect of pressing the [arrow left] or [arrow right] keys has changed. These keys now jump 5 seconds back (arrow left) or ahead (arrow right) in the current video.

August 11, 2016

This update contains the following changes:

  • The YouTube API Services Terms of Service ("the Updated Terms") provides a rich set of updates to the current Terms of Service. In addition to the Updated Terms, which will go into effect as of February 10, 2017, this update includes several supporting documents to help explain the policies that developers must follow.

    The full set of new documents is described in the revision history for the Updated Terms. In addition, future changes to the Updated Terms or to those supporting documents will also be explained in that revision history.

December 18, 2015

European Union (EU) laws require that certain disclosures must be given to and consents obtained from end users in the EU. Therefore, for end users in the European Union, you must comply with the EU User Consent Policy. We have added a notice of this requirement in our YouTube API Terms of Service.

August 19, 2015

  • The autohide parameter has been deprecated for the HTML5 player. In HTML5 players, the video progress bar and player controls display or hide automatically. That behavior corresponds to an autohide setting of 1.

  • The theme parameter has been deprecated for the HTML5 player. HTML5 players now always use the dark theme.

March 9, 2015

  • The document has been updated to reflect the fact that YouTube <object> embeds, the YouTube Flash Player API and the YouTube JavaScript Player API have all been deprecated as of January 27, 2015. A deprecation warning appears in several sections of this document to help point readers to the IFrame Player API as an alternative.

  • The definition of the autohide parameter has been updated to clarify the meaning of the parameter's values. The default behavior (autohide=2) is that if the player has a 16:9 or 4:3 aspect ratio, the player's video progress bar and player controls display or hide automatically. Otherwise, those controls are visible throughout the video.

  • The definition of the hl parameter has been updated to note that the parameter value could be an ISO 639-1 two-letter language code or a fully specified locale. For example, fr and fr-ca are both valid parameter values.

  • The definition of the enablejsapi parameter has been reworded to clarify that the parameter enables a player to be controlled via API calls. The API could be either the IFrame Player API or the JavaScript Player API.

October 14, 2014

July 18, 2014

  • The new hl parameter can be used to set the player's interface language. The interface language is used for tooltips in the player and also affects the default caption track. The selected caption track may also depend on the availability of caption tracks and user's individual language preferences.

    The parameter's value is an ISO 639-1 two-letter language code, though other language input codes, such as IETF language tags (BCP 47) may also be handled properly.

  • The definition of the playsinline parameter, which only affects HTML5 players on iOS, has been modified slightly. The definition now notes that setting the parameter value to 1 causes inline playback only for UIWebViews created with the allowsInlineMediaPlayback property set to TRUE.

January 28, 2014

  • The playsinline parameter controls whether videos play inline or fullscreen in an HTML5 player on iOS. Setting the value to 1 causes inline playback.

  • The Selecting content to play section has been updated to explain how to find YouTube video IDs and playlist IDs using the YouTube Data API (v3) rather than the older API version.

  • The controls parameter's definition has been updated to reflect the fact that the parameter value only affects the time that the Flash player actually loads in IFrame embeds. In addition, for IFrame embeds, the parameter value also determines when the controls display in the player. If you set the parameter's value to 2, then the controls display and the Flash player loads after the user initiates the video playback.

May 10, 2013

This update contains the following changes:

July 20, 2012

This update contains the following changes:

  • The definition of the controls parameter has been updated to reflect support for a parameter value of 2 and to explain that, for AS3 players, the parameter value determines the time when the Flash player actually loads. If the controls parameter is set to 0 or 1, the Flash player loads immediately. If the parameter value is 2, the Flash player does not load until the video playback is initiated.

June 5, 2012

This update contains the following changes:

  • The HTML5 player now supports the color, modestbranding, and rel parameters, and the definitions for these parameters have been updated accordingly.

  • The definition of the showinfo parameter has been updated to explain how that if the player is loading a playlist, and you explicitly set the parameter value to 1, then, upon loading, the player will also display thumbnail images for the videos in the playlist. Note that this functionality is only supported for the AS3 player since that is the only player that can load a playlist.

May 4, 2012

This update contains the following changes:

  • The showinfo parameter's definition has been updated to reflect the fact that the HTML5 player supports this parameter.

May 3, 2012

This update contains the following changes:

  • The new end parameter specifies the time, measured in seconds from the start of the video, when the player should stop playing a video. Note that the time when playback is stopped is measured from the beginning of the video and not from the value of either the start player parameter or the startSeconds parameter, which is used in YouTube Player API functions for loading or queueing a video.

March 29, 2012

This update contains the following changes:

  • The new Embedding a YouTube player section explains different ways to embed a YouTube player in your application. This section covers manual IFrame embeds, IFrame embeds that use the IFrame Player API, and AS3 and AS2 object embeds. This section incorporates information from the old Example usage section, which has been removed.

  • The new Selecting content to play section explains how to configure the player to load a video, a playlist, search results for a specified query, or uploaded videos for a specified user.

  • The new list and listType parameters let you specify the content that the player should load. You can specify a playlist, a search query, or a particular user's uploaded videos.

  • The definitions of the fs and rel parameters have been updated to more clearly explain the default parameter values for the AS3 player.

  • The border, color1, egm, hd, and showsearch parameters, which are all only supported for the deprecated AS2 Player API, have been moved to a new section named deprecated parameters only used in the AS2 Player API.

  • The document no longer provides a way to filter the parameter list to only display parameters supported in either the AS3, AS2, or HTML5 player. Instead, each parameter definition has been updated to identify the players that support that parameter.

August 11, 2011

This update contains the following changes:

  • The new theme and color parameters let you customize the appearance of the embedded player's player controls.

June 8, 2011

This update contains the following changes:

  • The new modestbranding parameter lets you use a YouTube player that does not show a YouTube logo. As of this release, the parameter was only supported for the AS3 embedded player and for IFrame embeds that loaded the AS3 player. As of June 5, 2012, the HTML5 player also supported this parameter.

February 14, 2011

This update contains the following changes:

  • The documentation has been updated to note that the AS2 Player API has been deprecated. The deprecation of the AS2 Player API was actually announced on October 14, 2009.

February 3, 2011

This update contains the following changes:

  • The documentation has been updated to identify parameters supported in the HTML5 (IFrame) embedded player.

  • The document now displays all of the parameters supported in any of YouTube's embedded players (HTML5, AS3, AS2).

  • The following parameters are supported in the AS2 player but have been deprecated for the newer AS3 and HTML5 players: border, color1, color2, egm, hd, and showsearch.

    In addition, the loop parameter has limited support in the AS3 player and in IFrame embeds, which could load either an AS3 or HTML player. Currently, the loop parameter only works in the AS3 player when used in conjunction with the playlist parameter. To loop a single video, set the loop parameter to 1 and set the playlist parameter value to the same video ID already specified in the Player API URL:

    https://www.youtube.com/v/VIDEO_ID?version=3&loop=1&playlist=VIDEO_ID

    Similarly, the controls and playlist parameters are supported in the AS3 and HTML5 players but are not and will not be supported in the AS2 player.

    As noted above, IFrame embeds can load either an AS3 or HTML5 player. Though some parameters are not supported in both players, an IFrame embed that loads the AS3 player will support all parameters that work with that player and ignore all other parameters. Similarly, an IFrame embed that loads the HTML5 player will support all parameters that work with that player while ignoring all other parameters.

  • The parameter list has been updated to include the autohide parameter, which indicates whether the player's video controls will automatically hide after a video begins playing.

  • The parameter list has been updated to include the controls parameter, which indicates whether the player's video controls will display at all. (Player controls do display by default.)

  • The parameter list has been updated to include the playlist parameter, which specifies a comma-separated list of video IDs to play.

  • The definition of the fs has been updated to note that the fullscreen option will not work if you load the YouTube player into another SWF.

  • The example at the end of the document has been updated to use the embedded AS3 player instead of the embedded AS2 player. The parameters used in the example have also been updated to only include parameters that the AS3 player supports.

    In addition, the instructions for constructing the URLs that contain player parameters have been updated to reflect the URL formats used by the AS3 and AS2 embedded and chromeless players as well as by the HTML5 player.