-
JS / 유튜브 자주쓰는 iframe player API 매개변수 정리Web dev/ETC 2024. 2. 14. 23:01728x90반응형
자주 쓰는 유튜브 iframe player 매개변수 정리
유튜브영상 시작시간 설정
// 시작시간 설정 <iframe src="https://www.youtube.com/embed/유튜브_ID?start=61" allowfullscreen=""></iframe>
유튜브영상 끝나는시간 설정
// 끝나는시간 설정 <iframe src="https://www.youtube.com/embed/유튜브_ID?end=120" allowfullscreen=""></iframe>
유튜브영상 자동재생
// 자동재생 설정 mute=1 로 소리없음을 해야 자동재생 <iframe src="https://www.youtube.com/embed/유튜브_ID?autoplay=1&mute=1" allowfullscreen=""></iframe>
유튜브영상 컨트롤러 제거
// controls=0(컨트롤 제거), controls=1(기본값)플레이어 컨트롤이 플레이어에 표시 <iframe src="https://www.youtube.com/embed/유튜브_ID??controls=0" allowfullscreen=""></iframe>
유튜브영상 로고 제거
// 유튜브 로고 제거: modestbranding=1 <iframe src="https://www.youtube.com/embed/유튜브_ID??modestbranding=1" allowfullscreen=""></iframe>
유튜브영상 반복 재생
// 반복재생 단일영상은 playlist를 추가 해줘야한다. <iframe src="https://www.youtube.com/embed/비디오_ID?loop=1&playlist=비디오_ID" allowfullscreen=""></iframe>
유튜브영상 관련 영상 표시 안하기
// 관련 동영상 표시 안하기 <iframe src="https://www.youtube.com/embed/비디오_ID?rel=0" allowfullscreen=""></iframe>
https://developers.google.com/youtube/player_parameters?hl=ko
728x90반응형'Web dev > ETC' 카테고리의 다른 글
swiperJS 구버전 DEMO,API 확인하기 (0) 2023.02.26 localStorage 와 sessionStorage 의 차이점 (0) 2022.03.26