본문 바로가기

Story/html/css

YouTube 내장 플레이어 및 플레이어 매개변수

반응형

YouTube 내장 플레이어 및 플레이어 매개변수

개요

이 문서에서는 애플리케이션에 YouTube 플레이어를 삽입하는 방법을 설명하고 YouTube 내장 플레이어에서 사용할 수 있는 매개변수를 정의합니다.

YouTube 플레이어는 <iframe> 태그 또는 <object> 태그를 사용하여 웹페이지에 삽입할 수 있습니다. IFrame 또는 SWF URL에 매개변수를 추가하여 애플리케이션의 재생 환경을 맞춤설정할 수 있습니다. 예를 들어 autoplay 매개변수를 사용하여 동영상을 자동으로 재생하거나 loop 매개변수를 사용하여 동영상이 반복해서 재생되도록 할 수 있습니다. 또한 enablejsapi 매개변수로 플레이어에 를 사용하도록 설정할 수 있습니다.

이 페이지에서는 현재 YouTube 내장 플레이어에서 지원되는 모든 매개변수를 정의합니다. 각 매개변수 정의는 해당 매개변수를 지원하는 플레이어를 식별합니다.

참고: 내장 플레이어에는 200x200픽셀 이상의 표시 영역이 있어야 합니다. 플레이어에 컨트롤이 표시되는 경우에는 표시 영역이 최소 크기 미만으로 축소되지 않고 컨트롤이 완전히 표시될 만큼 커야 합니다. 16:9 플레이어의 경우 가로 480픽셀, 세로 270픽셀 이상으로 지정하는 것이 좋습니다.

YouTube 플레이어 삽입

권장사항: IFrame은 고객의 사용 환경 및 사용할 수 있는 YouTube 파일 형식에 따라 적절한 플레이어를 선택하기 때문에 IFrame 삽입은 YouTube 플레이어 삽입에 권장되는 방식입니다.

다음 여러 메소드를 사용하여 애플리케이션에 YouTube 플레이어를 삽입하고 플레이어 매개변수를 지정할 수 있습니다. 아래 안내는 단일 동영상을 로드하는 플레이어를 삽입하는 방법을 보여줍니다. 다음 섹션에서는 플레이어를 구성하여 재생목록 및 검색결과와 같은 다른 유형의 콘텐츠를 로드하는 방법을 설명합니다.

<iframe> 태그를 사용하여 IFrame 삽입

src URL로 플레이어에서 로드할 콘텐츠는 물론 설정하려는 다른 플레이어 매개변수를 지정하는 <iframe> 태그를 애플리케이션에서 정의합니다. <iframe> 태그의 height  width 매개변수는 플레이어의 크기를 지정합니다.

IFrame Player API를 사용하여 만드는 대신 <iframe> 요소를 직접 만드는 경우 URL의 끝에 플레이어 매개변수를 바로 추가할 수 있습니다. URL의 형식은 다음과 같습니다.

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

아래의 <iframe> 태그는 YouTube 동영상 M7lc1UVf-VE를 재생하는 640x390픽셀 플레이어를 로드합니다. URL에서autoplay 매개변수를 1로 설정하므로 플레이어가 로드되면 동영상이 자동으로 재생됩니다.

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

IFrame Player API를 사용하여 IFrame 삽입

를 따라 Player API의 JavaScript 코드가 로드된 후에 동영상 플레이어를 웹페이지 또는 애플리케이션에 삽입합니다. 동영상 플레이어에 대한 생성자의 두 번째 매개변수는 플레이어 옵션을 지정하는 개체입니다. 해당 개체 내에서 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: '390',
      width: '640',
      videoId: 'M7lc1UVf-VE'
    });
  }
</script>

AS3 개체 삽입

개체 삽입은 <object> 태그를 사용하여 플레이어의 크기 및 매개변수를 지정합니다. 아래의 샘플 코드는 개체 삽입을 사용하여 이전 두 가지 예처럼 동일한 동영상을 자동으로 재생하는 AS3 플레이어를 로드하는 방법을 보여줍니다.

<object width="640" height="390">
  <param name="movie"
         value="https://www.youtube.com/v/M7lc1UVf-VE?version=3&autoplay=1"></param>
  <param name="allowScriptAccess" value="always"></param>
  <embed src="https://www.youtube.com/v/M7lc1UVf-VE?version=3&autoplay=1"
         type="application/x-shockwave-flash"
         allowscriptaccess="always"
         width="640" height="390"></embed>
</object>

재생할 콘텐츠 선택

내장 플레이어를 구성하여 동영상, 재생목록, 사용자가 업로드한 동영상 또는 특정 검색어의 검색결과를 로드할 수 있습니다. 그러나 단일 동영상을 로드하는 것 이외의 옵션은 AS3 개체 삽입 및 AS3 플레이어를 로드하는 IFrame 삽입에서만 지원됩니다. IFrame 삽입에서 HTML5 플레이어를 로드할 수도 있습니다.

다음 목록은 이러한 옵션을 설명합니다.

  • 동영상 로드

    IFrame 삽입의 경우 로드할 동영상의 YouTube 동영상 ID는 IFrame의 src URL에 지정되어 있습니다. AS3 개체 삽입의 경우 동영상 ID는 플레이어의 SWF URL에 지정되어 있습니다.

    IFrame embed:
    http://www.youtube.com/embed/VIDEO_ID
    
    Embedded AS3 player:
    http://www.youtube.com/v/VIDEO_ID?version=3
    
    Chromeless AS3 player:
    http://www.youtube.com/apiplayer?video_id=VIDEO_ID&version=3
    

    YouTube Data API(v3)를 사용하는 경우 검색결과, 재생목록 항목 리소스, 동영상 리소스 또는 기타 리소스에서 동영상 ID를 검색하여 이러한 URL을 프로그래밍 방식으로 생성할 수 있습니다. 동영상 ID를 가져온 후 위 URL의VIDEO_ID 텍스트를 이 값으로 대체하여 플레이어 URL을 만듭니다.

  • 재생목록 로드

    listType 플레이어 매개변수를 playlist로 설정합니다. 또한 list 플레이어 매개변수를 로드하려는 YouTube 재생목록 ID로 설정합니다.

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

    다음 예에 표시된 것처럼 재생목록 ID 앞에 PL 문자를 붙여야 합니다.

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

    YouTube Data API(v3)를 사용하는 경우 검색결과, 채널 리소스 또는 활동 리소스에서 재생목록 ID를 검색하여 이러한 URL을 프로그래밍 방식으로 생성할 수 있습니다. 재생목록 ID를 가져온 후 위 URL의 PLAYLIST_ID 텍스트를 이 값으로 대체합니다.

  • 사용자가 업로드한 동영상 로드

    listType 플레이어 매개변수를 user_uploads로 설정합니다. 또한 list 플레이어 매개변수를 로드하려는 동영상을 업로드한 YouTube 사용자 이름으로 설정합니다.

    http://www.youtube.com/embed?listType=user_uploads&list=USERNAME
  • 지정한 쿼리에 대한 검색결과 로드

    listType 플레이어 매개변수를 search로 설정합니다. 또한 list 플레이어 매개변수를 플레이어에 로드하려는 검색결과에 대한 검색어로 설정합니다.

    http://www.youtube.com/embed?listType=search&list=QUERY

매개변수

다음 매개변수는 모두 선택사항입니다. 목록에는 모든 YouTube 내장 플레이어에서 지원하는 매개변수가 표시됩니다. 일부 플레이어가 특정 매개변수를 지원하지 않는 경우 해당 매개변수의 정의에서 지원하는 플레이어를 식별합니다. 이러한 매개변수는 내장 플레이어에서만 공식적으로 지원되지만 매개변수의 하위 집합이 재생목록 플레이어와 같은 다른 플레이어에서도 작동할 수 있습니다.

참고: IFrame 삽입은 HTML5 플레이어 또는 AS 플레이어를 로드할 수 있습니다. 두 플레이어에서 모두 지원되지 않는 매개변수도 있지만 AS3 플레이어를 로드하는 IFrame 삽입은 해당 플레이어로 작동하는 모든 매개변수를 지원하며 다른 모든 매개변수를 무시합니다. 마찬가지로 HTML5 플레이어를 로드하는 IFrame 삽입은 다른 모든 매개변수를 무시하면서 해당 플레이어로 작동하는 모든 매개변수를 지원합니다.

예를 들어 HTML5 플레이어는 현재 playerapiid 매개변수를 지원하지 않지만 IFrame 삽입 시에는 이 매개변수를 지정할 수 있습니다. 삽입으로 AS3 플레이어가 로드되면 플레이어가 매개변수를 지원하고 삽입으로 HTML5 플레이어가 로드되면 플레이어가 매개변수를 무시합니다.

Parameters

autohide

지원 플레이어: HTML5, AS3
Description 값: 2(기본값), 1, 0. 이 매개변수는 동영상 재생이 시작된 후 동영상 컨트롤을 자동으로 숨길지 여부를 나타냅니다. 기본 동작(autohide=2)은 플레이어 컨트롤(재생 버튼, 볼륨 조절 등)이 계속 표시되는 반면 동영상 진행률 표시줄은 점차 사라지는 것입니다.
  • 이 매개변수가 1로 설정되면 동영상 진행률 표시줄 및 플레이어 컨트롤이 동영상 재생이 시작되고 몇 초 후에 사라집니다. 사용자가 동영상 플레이어 위에 마우스를 올려놓거나 키보드의 키를 누르는 경우에만 다시 나타납니다.
  • 이 매개변수가 0으로 설정되면 동영상 진행률 표시줄 및 동영상 플레이어 컨트롤이 동영상이 재생되는 동안 표시되고 전체화면에서도 표시됩니다.

autoplay

지원 플레이어: HTML5, AS3
Description 값: 0 또는 1. 기본값은 0입니다. 플레이어가 로드될 때 초기 동영상을 자동재생할지 여부를 설정합니다.

cc_load_policy

지원 플레이어: HTML5, AS3
Description 값: 1. 기본값은 사용자 환경설정에 따라 다릅니다. 1로 설정하면 사용자가 자막을 끈 경우에도 자막이 기본적으로 표시됩니다.

color

지원 플레이어: HTML5, AS3
Description 이 매개변수는 시청자가 동영상에서 이미 본 부분을 강조표시하기 위해 플레이어의 동영상 진행률 표시줄에서 사용할 색상을 지정합니다. 유효한 매개변수 값은 red  white이며 기본적으로 플레이어는 동영상 진행률 표시줄에서 빨간색을 사용합니다. 색상 옵션에 대한 자세한 내용은 YouTube API 블로그를 참조하세요.

참고: color 매개변수를 white로 설정하면 modestbranding 옵션이 사용 중지됩니다.

controls

지원 플레이어: HTML5, AS3
Description 값: 0, 1 또는 2. 기본값은 1입니다. 이 매개변수는 동영상 플레이어 컨트롤을 표시할지 여부를 나타냅니다. Flash 플레이어를 로드하는 IFrame 삽입의 경우 이 매개변수가 플레이어에서 컨트롤이 표시되는 시점 및 플레이어가 로드되는 시점도 정의합니다.

  • controls=0 – 플레이어 컨트롤이 플레이어에서 표시되지 않습니다. IFrame 삽입의 경우 Flash 플레이어가 즉시 로드됩니다.
  • controls=1 – 플레이어 컨트롤이 플레이어에서 표시됩니다. IFrame 삽입의 경우 컨트롤이 즉시 표시되고 Flash 플레이어 또한 즉시 로드됩니다.
  • controls=2 – 플레이어 컨트롤이 플레이어에서 표시됩니다. IFrame 삽입의 경우 사용자가 동영상 재생을 시작한 후 컨트롤이 표시되고 Flash 플레이어가 로드됩니다.

참고: 매개변수 값 1  2는 동일한 사용자 환경을 제공하기 위해 마련되었지만 controls=2는 IFrame 삽입에 controls=1보다 개선된 성능을 제공합니다. 현재 두 값에는 동영상 제목의 글꼴 크기와 같은 몇 가지 시각적인 플레이어 상의 차이가 있습니다. 그러나 두 값의 차이점이 사용자에게 완전히 투명하게 보이면 기본 매개변수 값이 1에서 2로 변경될 수도 있습니다.

disablekb

지원 플레이어: HTML5, AS3
Description 값: 0 또는 1. 기본값은 0입니다. 1로 설정하면 플레이어 키보드 컨트롤이 사용 중지됩니다. 키보드 컨트롤은 다음과 같습니다.

  • 스페이스바: 재생/일시중지
  • 왼쪽 화살표: 현재 동영상에서 뒤로 10% 이동
  • 오른쪽 화살표: 현재 동영상에서 앞으로 10% 이동
  • 위쪽 화살표: 볼륨 높임
  • 아래쪽 화살표: 볼륨 낮춤

enablejsapi

지원 플레이어: HTML5, AS3
Description 값: 0 또는 1. 기본값은 0입니다. 이 매개변수를 1로 설정하면 JavaScript API를 사용하도록 설정됩니다. JavaScript API에 대한 자세한 내용과 사용 방법은 JavaScript API 설명서를 참조하세요.

end

지원 플레이어: HTML5, AS3
Description 값: 양의 정수. 이 매개변수는 플레이어가 동영상 재생을 중지해야 할 시간을 동영상 시작 부분부터 초 단위로 측정하여 지정합니다. 시간은 동영상을 로드하거나 대기열에 넣기 위해 YouTube Player API 함수에서 사용하는 start 플레이어 매개변수 또는 startSeconds 매개변수의 값으로 측정되는 것이 아니라 동영상 시작 부분부터 측정됩니다.

fs

지원 플레이어: HTML5, AS3
Description 값: 0 또는 1. 기본값은 1이며 전체화면 버튼이 표시됩니다. 이 매개변수를 0으로 설정하면 전체화면 버튼이 표시되지 않습니다.

hl

지원 플레이어: HTML5, AS3
Description 플레이어의 인터페이스 언어를 설정합니다. 매개변수 값은 ISO 639-1 두 문자 언어 코드입니다. IETF 언어 태그(BCP 47)와 같이 다른 언어 입력 코드를 사용해도 올바르게 처리될 수 있습니다.

인터페이스 언어는 플레이어의 툴팁에 사용되며 기본 자막 트랙에도 영향을 줍니다. YouTube는 사용자의 개별 언어 환경설정과 자막 트랙의 사용 가능 여부에 따라 특정 사용자의 자막 트랙 언어를 다르게 선택할 수 있습니다.

iv_load_policy

지원 플레이어: HTML5, AS3
Description 값: 1 또는 3. 기본값은 1입니다. 1로 설정하면 동영상 특수효과가 기본적으로 표시됩니다. 반면에 3으로 설정하면 동영상 특수효과가 기본적으로 표시되지 않습니다.

list

지원 플레이어: HTML5, AS3
Description list 매개변수는 listType 매개변수와 함께 플레이어에서 로드될 콘텐츠를 식별합니다.

  • listType 매개변수 값이 search인 경우 list 매개변수 값이 검색어를 지정합니다.
  • listType 매개변수 값이 user_uploads인 경우 list 매개변수 값이 로드할 동영상을 업로드한 YouTube 채널을 식별합니다.
  • listType 매개변수 값이 playlist인 경우 list 매개변수 값이 YouTube 재생목록 ID를 지정합니다. 매개변수 값에서 아래 예에 표시된 것처럼 재생목록 ID 앞에 PL 문자를 붙여야 합니다.
    http://www.youtube.com/embed?listType=playlist&list=PLC77007E23FF423C6

참고: list  listType 매개변수에 대한 값을 지정하는 경우 IFrame 삽입 URL에서 동영상 ID를 지정할 필요가 없습니다.

listType

지원 플레이어: HTML5, AS3
Description listType 매개변수는 list 매개변수와 함께 플레이어에서 로드할 콘텐츠를 식별합니다. 유효한 매개변수 값은 playlist, search  user_uploads입니다.

list  listType 매개변수에 대한 값을 지정하는 경우 IFrame 삽입 URL에서 동영상 ID를 지정할 필요가 없습니다.

loop

지원 플레이어: HTML5, AS3
Description 값: 0 또는 1. 기본값은 0입니다. 단일 동영상 플레이어의 경우 1로 설정하면 플레이어가 초기 동영상을 반복해서 재생합니다. 재생목록 플레이어(또는 맞춤 플레이어)의 경우 플레이어가 전체 재생목록을 재생한 다음 첫 번째 동영상부터 다시 시작합니다.

참고: 이 매개변수는 AS3 플레이어 및 AS3 또는 HTML5 플레이어를 로드할 수 있는 IFrame 삽입에서 제한적으로 지원됩니다. 현재 loop 매개변수는 playlist 매개변수와 함께 사용하는 경우에만 AS3 플레이어에서 작동합니다. 단일 동영상을 반복 재생하려면 loop 매개변수 값을 1로 설정하고 playlist 매개변수 값을 Player API URL에서 이미 지정한 동일한 동영상 ID로 설정합니다.
http://www.youtube.com/v/VIDEO_ID?version=3&loop=1&playlist=VIDEO_ID

modestbranding

지원 플레이어: HTML5, AS3
Description 이 매개변수를 통해 YouTube 로고를 표시하지 않는 YouTube 플레이어를 사용할 수 있습니다. YouTube 로고가 컨트롤바에 표시되지 않도록 하려면 매개변수 값을 1로 설정합니다. 하지만 사용자가 마우스 포인터를 플레이어 위에 올려놓으면 작은 YouTube 텍스트 라벨이 일시중지된 동영상의 오른쪽 상단에 표시됩니다.

origin

지원 플레이어: HTML5, AS3
Description 이 매개변수는 IFrame API에 대한 추가 보안 수단을 제공하며 IFrame 삽입에서만 지원됩니다.enablejsapi 매개변수를 1로 설정하여 IFrame API를 사용하는 경우 도메인을 항상 origin 매개변수 값으로 지정해야 합니다.

playerapiid

지원 플레이어: AS3
Description 값으로 모든 영숫자 문자열을 사용할 수 있습니다. 이 설정은 JavaScript API와 함께 사용됩니다. 자세한 내용은 JavaScript API 설명서를 참조하세요.

playlist

지원 플레이어: HTML5, AS3
Description 값은 재생할 동영상 ID를 쉼표로 구분한 목록입니다. 값을 지정하는 경우 URL 경로에서 지정한 VIDEO_ID가 먼저 재생되며 playlist 매개변수에서 지정한 동영상이 그 후에 재생됩니다.

playsinline

지원 플레이어: HTML5
Description 이 매개변수는 iOS의 HTML5 플레이어에서 동영상을 인라인으로 재생할지 전체화면으로 재생할지 여부를 제어합니다. 유효한 값은 다음과 같습니다.

  • 0: 이 값을 지정하면 전체화면으로 재생됩니다. 현재 기본값이지만 기본값은 변경될 수 있습니다.
  • 1: 이 값을 지정하면 TRUE로 설정된 allowsInlineMediaPlayback 속성과 함께 만들어진UIWebViews이 인라인으로 재생됩니다.

rel

지원 플레이어: HTML5, AS3
Description 값: 0 또는 1. 기본값은 1입니다. 이 매개변수는 초기 동영상의 재생이 종료되면 플레이어에서 관련 동영상을 표시할지 여부를 나타냅니다.

showinfo

지원 플레이어: HTML5, AS3
Description 값: 0 또는 1. 매개변수의 기본값은 1입니다. 매개변수 값을 0으로 설정하면 플레이어에서 동영상 재생을 시작하기 전에 동영상 제목 및 업로더와 같은 정보를 표시하지 않습니다.

플레이어가 재생목록을 로드하고 있고 매개변수 값을 명시적으로 1로 설정한 경우 로드 후에 플레이어에 재생목록에 있는 동영상에 대한 미리보기 이미지도 표시됩니다.이 기능은 재생목록을 로드할 수 있는 유일한 플레이어인 AS3 플레이어에서만 지원된다는 점에 유의하세요.

start

지원 플레이어: HTML5, AS3
Description 값: 양의 정수. 이 매개변수는 플레이어가 동영상 시작 부분에서 특정 시간(단위: 초) 이후에 동영상 재생을 시작하도록 합니다. 플레이어는 seekTo 함수와 비슷하게 지정한 시간에 가장 가까운 키프레임을 찾는다는 점에 유의하세요. 즉, 재생 헤드에서 요청한 시간의 바로 앞 부분을 찾을 수도 있으며 일반적으로 2초 이내입니다.

theme

지원 플레이어: HTML5, AS3
Description 이 매개변수는 내장 플레이어의 플레이어 컨트롤(예: 재생 버튼 또는 볼륨 조절)이 어두운 컨트롤바 내에 표시될지 밝은 컨트롤바 내에 표시될지 나타냅니다. 유효한 매개변수 값은 dark  light이며 기본적으로 플레이어는 dark 테마를 사용하여 플레이어 컨트롤을 표시합니다. 어두운 테마와 밝은 테마에 대한 자세한 내용은 YouTube 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 forUIWebViews 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 thecontrols 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. See the YouTube API blog for more information.

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 theplaylist parameter value to the same video ID already specified in the Player API URL:

    http://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.

 

 

 

 

출처 : https://developers.google.com/youtube/player_parameters?hl=ko

반응형