نظرة عامة
يشرح هذا المستند كيفية تضمين مشغّل YouTube في تطبيقك، كما يحدّد المَعلمات المتوفّرة في مشغّل YouTube المضمّن.
من خلال إلحاق مَعلمات بعنوان URL الخاص بـ IFrame، يمكنك تخصيص تجربة التشغيل في تطبيقك. على سبيل المثال، يمكنك تشغيل الفيديوهات تلقائيًا باستخدام المَعلمة autoplay أو تكرار تشغيل فيديو باستخدام المَعلمة loop. يمكنك أيضًا استخدام المَعلمة enablejsapi للسماح بالتحكّم في المشغّل من خلال IFrame Player API.
تحدّد هذه الصفحة حاليًا جميع المَعلمات المتوافقة مع أي مشغّل YouTube مضمّن. يحدّد كل تعريف مَعلمة المشغّلات التي تتيح المَعلمة المقابلة.
ملاحظة: يجب أن تشتمل المشغّلات المضمّنة على إطار عرض 200 بكسل في 200 بكسل على الأقل. إذا كان المشغّل يعرض عناصر التحكّم، يجب أن يكون كبيرًا بما يكفي لعرض عناصر التحكّم بالكامل بدون تصغير إطار العرض إلى أقل من الحد الأدنى للحجم. ننصح بأن يكون عرض المشغّلات بنسبة 16:9 على الأقل 480 بكسل وارتفاعها 270 بكسل.
تضمين مشغّل YouTube
يمكنك استخدام أي من الطرق التالية لتضمين مشغّل YouTube في تطبيقك وتحديد معلَمات المشغّل. يُرجى العِلم أنّ التعليمات أدناه توضّح كيفية تضمين مشغّل يحمّل فيديو واحدًا. يوضّح القسم التالي كيفية ضبط المشغّل لتحميل قائمة تشغيل أو فيديوهات حمّلها مستخدم.
تضمين مشغّل باستخدام علامة <iframe>
حدِّد علامة <iframe> في تطبيقك يحدِّد فيها عنوان URL الخاص بالسمة src المحتوى الذي سيحمّله المشغّل بالإضافة إلى أي مَعلمات أخرى تريد ضبطها للمشغّل. تحدّد المَعلمتان height وwidth في علامة <iframe> أبعاد المشغّل.
إذا أنشأت عنصر <iframe> بنفسك (بدلاً من استخدام واجهة IFrame Player API لإنشائه)، يمكنك إلحاق مَعلمات المشغّل مباشرةً بنهاية عنوان URL. يكون عنوان URL بالتنسيق التالي:
https://www.youtube.com/embed/VIDEO_ID
ستحمّل علامة <iframe> أدناه مشغّل فيديو بدقة 640x360 بكسل يشغّل فيديو على YouTube M7lc1UVf-VE. بما أنّ عنوان URL يضبط المَعلمة autoplay على 1، سيتم تشغيل الفيديو تلقائيًا بعد تحميل المشغّل.
<iframe id="ytplayer" type="text/html" width="640" height="360" src="/__yt2/d3d3LnlvdXR1YmUuY29t/embed/M7lc1UVf-VE?autoplay=1&origin=http://example.com" frameborder="0"></iframe>
تضمين مشغّل باستخدام واجهة برمجة التطبيقات IFrame Player API
اتّبِع تعليمات واجهة برمجة التطبيقات IFrame Player API لإدراج مشغّل فيديو في صفحة الويب أو التطبيق بعد تحميل رمز JavaScript الخاص بواجهة Player API. المَعلمة الثانية في الدالة الإنشائية لمشغّل الفيديو هي عنصر يحدّد خيارات المشغّل. ضمن هذا العنصر، تحدّد السمة playerVars مَعلمات المشغّل.
يعرض رمز HTML وJavaScript أدناه مثالاً بسيطًا يُدرج مشغّل YouTube في عنصر الصفحة الذي يتضمّن قيمة ytplayer لـ id. يتم تلقائيًا استدعاء الدالة 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 الذي تريد تحميله في عنوان URL الخاص بـ
srcفي IFrame.https://www.youtube.com/embed/VIDEO_ID
إذا كنت تستخدم YouTube Data API (الإصدار 3)، يمكنك إنشاء عناوين URL هذه آليًا من خلال استرداد معرّفات الفيديوهات من نتائج البحث أو موارد عناصر قوائم التشغيل أو موارد الفيديوهات أو موارد أخرى. بعد الحصول على معرّف الفيديو، استبدِل النص
VIDEO_IDفي عناوين URL أعلاه بهذه القيمة لإنشاء عنوان URL للمشغّل. -
تحميل قائمة تشغيل
اضبط مَعلمة المشغّل
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 (الإصدار 3)، يمكنك إنشاء عناوين URL هذه آليًا من خلال استرداد أرقام تعريف قوائم التشغيل من نتائج البحث أو موارد القناة أو موارد النشاط. بعد الحصول على رقم تعريف قائمة التشغيل، استبدِلوا النص
PLAYLIST_IDفي عنوان URL أعلاه بهذه القيمة. -
تحميل الفيديوهات التي حمّلها مستخدم
اضبط مَعلمة المشغّل
listTypeعلىuser_uploads. بالإضافة إلى ذلك، اضبط مَعلمة المشغّلlistعلى اسم مستخدم YouTube الذي تريد تحميل فيديوهاته.https://www.youtube.com/embed?listType=user_uploads&list=USERNAME
المَعلمات المتوافقة
جميع المَعلمات التالية اختيارية.
| المعلمات | |
|---|---|
|
تحدّد هذه المَعلمة ما إذا كان الفيديو الأوّلي سيبدأ تشغيله تلقائيًا عند تحميل المشغّل. والقيمتان المسموح بإدراجهما هما 0 أو 1. تكون القيمة التلقائية 0.في حال تفعيل ميزة "التشغيل التلقائي"، سيتم تشغيل الفيديو بدون أي تفاعل من المستخدم مع المشغّل، وبالتالي سيتم جمع بيانات التشغيل ومشاركتها عند تحميل الصفحة. |
|
تحدّد هذه المَعلمة اللغة التلقائية التي سيستخدمها المشغّل لعرض الترجمة. اضبط قيمة المَعلمة على رمز لغة مكوّن من حرفَين وفقًا لمعيار ISO 639-1 أو علامة لغة وفقًا لمعيار BCP 47 (مثل fr-CA).إذا استخدمت هذه المَعلمة وضبطت أيضًا المَعلمة cc_load_policy على 1، سيعرض المشغّل الترجمة باللغة المحدّدة عند تحميله. إذا لم تضبط أيضًا المَعلمة cc_load_policy، لن تظهر الترجمة تلقائيًا، ولكنها ستظهر باللغة المحدّدة إذا اختار المستخدم تفعيل الترجمة.
|
|
يؤدي ضبط قيمة المَعلمة على 1 إلى عرض الترجمة والشرح تلقائيًا، حتى إذا أوقف المستخدم الترجمة. ويستند الإعداد التلقائي إلى الإعدادات المفضّلة للمستخدم.
|
|
تحدّد هذه المَعلمة اللون الذي سيتم استخدامه في شريط تقدّم الفيديو في المشغّل لإبراز الجزء الذي شاهده المستخدم من الفيديو. قيم المَعلمات الصالحة هي red وwhite، ويستخدم المشغّل تلقائيًا اللون الأحمر في شريط تقدّم الفيديو.
|
|
تشير هذه المَعلمة إلى ما إذا كانت عناصر التحكّم في مشغّل الفيديو معروضة:
|
|
يؤدي ضبط قيمة المَعلمة على 1 إلى عدم استجابة المشغّل لعناصر التحكّم في لوحة المفاتيح. القيمة التلقائية هي 0، ما يعني أنّ عناصر التحكّم في لوحة المفاتيح مفعَّلة. عناصر التحكّم في لوحة المفاتيح المتوافقة حاليًا هي:
|
|
يؤدي ضبط قيمة المَعلمة على 1 إلى إتاحة التحكّم في المشغّل من خلال طلبات بيانات من واجهة برمجة التطبيقات IFrame Player API. القيمة التلقائية هي 0، ما يعني أنّه لا يمكن التحكّم في المشغّل باستخدام واجهة برمجة التطبيقات هذه.لمزيد من المعلومات حول واجهة برمجة التطبيقات IFrame API وكيفية استخدامها، يُرجى الاطّلاع على مستندات واجهة برمجة التطبيقات IFrame API. |
|
تحدّد هذه المَعلمة الوقت الذي يجب أن يتوقف فيه المشغّل عن تشغيل الفيديو، ويتم قياسه بالثواني من بداية الفيديو. قيمة المَعلمة هي عدد صحيح موجب. يُرجى العِلم أنّه يتم قياس الوقت من بداية الفيديو وليس من قيمة مَعلمة المشغّل start أو المَعلمة startSeconds التي يتم استخدامها في دوال YouTube Player API لتحميل فيديو أو إضافته إلى قائمة المحتوى التالي.
|
|
يؤدي ضبط هذه المَعلمة على 0 إلى منع عرض زر ملء الشاشة في المشغّل. القيمة التلقائية هي 1، ما يؤدي إلى عرض زر ملء الشاشة.
|
|
يضبط هذا المَعلمة لغة واجهة المشغّل. قيمة المَعلمة هي رمز لغة مكوّن من حرفَين وفقًا لمعيار ISO 639-1 أو لغة محلية محدّدة بالكامل. على سبيل المثال، القيمتان fr وfr-ca صالحتان. وقد تتم أيضًا معالجة رموز إدخال اللغات الأخرى بشكل صحيح، مثل علامات لغة IETF (BCP 47).يتم استخدام لغة الواجهة لتلميحات الشاشة في المشغّل، وتؤثر أيضًا في مسار الترجمة والشرح التلقائي. يُرجى العِلم أنّ YouTube قد يختار لغة مختلفة لمسار الترجمة والشرح لمستخدم معيّن استنادًا إلى اللغات المفضّلة للمستخدم ومدى توفّر مسارات الترجمة والشرح. |
|
يؤدي ضبط قيمة المَعلمة على 1 إلى عرض التعليقات التوضيحية في الفيديو تلقائيًا، في حين يؤدي ضبطها على 3 إلى عدم عرض التعليقات التوضيحية في الفيديو تلقائيًا. تكون القيمة التلقائية 1.
|
|
تحدّد المَعلمة list، بالاقتران مع المَعلمة listType، المحتوى الذي سيتم تحميله في المشغّل.
list وlistType، لن تحتاج إلى تحديد معرّف فيديو في عنوان URL الخاص بتضمين IFrame. |
|
تحدّد المَعلمة listType، بالاقتران مع المَعلمة list، المحتوى الذي سيتم تحميله في المشغّل. القيمتان الصالحتان للمَعلمة هما playlist وuser_uploads.إذا حدّدت قيمًا للمَعلمتَين list وlistType، لن يحتاج عنوان URL الخاص بتضمين IFrame إلى تحديد معرّف فيديو.
ملاحظة: تم إيقاف قيمة المَعلمة الثالثة search نهائيًا ولن تكون متاحة اعتبارًا من |
|
في حال استخدام مشغّل فيديو واحد، يؤدي ضبط الإعداد على 1 إلى تشغيل الفيديو الأوّلي مرارًا وتكرارًا. في حال استخدام مشغّل قائمة تشغيل (أو مشغّل مخصّص)، يشغّل المشغّل قائمة التشغيل بأكملها ثم يبدأ من جديد من الفيديو الأول.القيمتان المسموح بهما هما 0 و1، والقيمة التلقائية هي 0.ملاحظة: هذه المَعلمة متاحة بشكل محدود في عمليات تضمين IFrame. لتكرار فيديو واحد، اضبط قيمة المَعلمة loop على 1 واضبط قيمة المَعلمة playlist على معرّف الفيديو نفسه الذي سبق تحديده في عنوان URL الخاص بواجهة Player API:https://www.youtube.com/embed/VIDEO_ID?playlist=VIDEO_ID&loop=1 |
|
ملاحظة: تم إيقاف هذه المَعلمة نهائيًا وليس لها أي تأثير. يمكنك الاطّلاع على الإشعار عن الإيقاف النهائي للحصول على مزيد من المعلومات. |
|
توفّر هذه المَعلمة إجراء أمان إضافيًا لواجهة برمجة التطبيقات IFrame API، وهي متاحة فقط لعمليات تضمين IFrame. إذا كنت تستخدم واجهة برمجة التطبيقات IFrame API، أي أنّك تضبط قيمة المَعلمة enablejsapi على 1، عليك دائمًا تحديد نطاقك كقيمة المَعلمة origin.
|
|
تحدّد هذه المَعلمة قائمة معرّفات الفيديوهات المطلوب تشغيلها، وتكون مفصولة بفواصل. إذا حدّدت قيمة، سيكون أول فيديو يتم تشغيله هو VIDEO_ID المحدّد في مسار عنوان URL، وسيتم بعد ذلك تشغيل الفيديوهات المحدّدة في المَعلمة playlist.
|
|
تتحكّم هذه المَعلمة في ما إذا كان سيتم تشغيل الفيديوهات بشكل مضمّن أو في وضع ملء الشاشة على أجهزة iOS. القيم الصالحة هي:
|
|
ملاحظة: سيتم تغيير هذه المَعلمة في 25 سبتمبر 2018 أو بعده. قبل إجراء التغيير، كانت هذه المَعلمة تشير إلى ما إذا كان يجب أن يعرض المشغّل فيديوهات ذات صلة عند انتهاء تشغيل الفيديو الأوّلي.
rel على 0، ستكون الفيديوهات ذات الصلة من القناة نفسها التي تم تشغيل الفيديو منها.
|
|
تؤدي هذه المَعلمة إلى بدء تشغيل الفيديو في المشغّل بعدد الثواني المحدّد من بداية الفيديو. قيمة المَعلمة هي عدد صحيح موجب. يُرجى العِلم أنّه على غرار الدالة seekTo، سيبحث المشغّل عن أقرب إطار مفتاحي للوقت الذي تحدّده. وهذا يعني أنّه في بعض الأحيان، قد ينتقل رأس التشغيل إلى ما قبل الوقت المطلوب مباشرةً، وعادةً لا يزيد ذلك عن ثانيتين تقريبًا.
|
|
تحدّد هذه المَعلمة عنوان URL الذي تم تضمين المشغّل فيه. تُستخدَم هذه القيمة في تقارير "إحصاءات YouTube" عندما يكون مشغّل YouTube مضمّنًا في تطبيق مصغّر، ويكون هذا التطبيق المصغّر مضمّنًا في صفحة ويب أو تطبيق. في هذا السيناريو، تحدّد المَعلمة origin نطاق موفّر التطبيق المصغّر، ولكن يجب ألا تحدّد "إحصاءات YouTube" موفّر التطبيق المصغّر كمصدر الزيارات الفعلي. بدلاً من ذلك، تستخدم "إحصاءات YouTube" قيمة المَعلمة 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 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
relparameter 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
relparameter is set to0, the player will show related videos that are from the same channel as the video that was just played.
- Prior to the change, if the parameter's value is set to
- The
showinfoparameter, 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
disablekbparameter definition has been corrected to note that the default value is0, which means that keyboard controls are enabled. A value of1indicates 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.
0jumps to the beginning of the video,1jumps to the time 10% into the video,2jumps 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
autohideparameter 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 anautohidesetting of1. -
The
themeparameter 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
autohideparameter 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
hlparameter 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,frandfr-caare both valid parameter values. -
The definition of the
enablejsapiparameter 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
-
The HTML5 player now supports the
cc_load_policy,disablekb,end,fs,list, andlistTypeparameters. The parameter descriptions have been updated accordingly.
July 18, 2014
-
The new
hlparameter 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
playsinlineparameter, which only affects HTML5 players on iOS, has been modified slightly. The definition now notes that setting the parameter value to1causes inline playback only forUIWebViewscreated with theallowsInlineMediaPlaybackproperty set toTRUE.
January 28, 2014
-
The
playsinlineparameter controls whether videos play inline or fullscreen in an HTML5 player on iOS. Setting the value to1causes 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
controlsparameter'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 to2, 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:
-
YouTube no longer identifies experimental API features and services. Instead, we now provide a list of YouTube APIs that are subject to the deprecation policy.
July 20, 2012
This update contains the following changes:
-
The definition of the
controlsparameter has been updated to reflect support for a parameter value of2and to explain that, for AS3 players, the parameter value determines the time when the Flash player actually loads. If thecontrolsparameter is set to0or1, the Flash player loads immediately. If the parameter value is2, 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, andrelparameters, and the definitions for these parameters have been updated accordingly. -
The definition of the
showinfoparameter has been updated to explain how that if the player is loading a playlist, and you explicitly set the parameter value to1, 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
showinfoparameter'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
endparameter 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 thestartplayer parameter or thestartSecondsparameter, 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
listandlistTypeparameters 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
fsandrelparameters have been updated to more clearly explain the default parameter values for the AS3 player. -
The
border,color1,egm,hd, andshowsearchparameters, 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
themeandcolorparameters let you customize the appearance of the embedded player's player controls.
June 8, 2011
This update contains the following changes:
-
The new
modestbrandingparameter 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, andshowsearch.In addition, the
loopparameter has limited support in the AS3 player and in IFrame embeds, which could load either an AS3 or HTML player. Currently, theloopparameter only works in the AS3 player when used in conjunction with theplaylistparameter. To loop a single video, set theloopparameter to1and set theplaylistparameter 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
controlsandplaylistparameters 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
autohideparameter, 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
controlsparameter, 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
playlistparameter, which specifies a comma-separated list of video IDs to play. -
The definition of the
fshas 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.