웹 사이트에 유튜브 소스 코드 추가 시 전체화면

chosh·2022년 2월 7일
0

유튜브 동영상을 웹에 추가할 때 전체화면을 하려고 하면 전체 화면을 사용할 수 없습니다 라고 뜨면 아래와 같이 하면 된다


유튜브에서 소스 코드 복사 하면 나오는 iframe 요소

<iframe
  width="1259"
  height="708"
  src="URL"
  title="YouTube video player"
  frameborder="0"
  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
  allowfullscreen
></iframe>

allowfullscreen 말고,
allow 속성에 fullscreen 을 추가
ex)

<iframe
  width="1259"
  height="708"
  src="URL"
  title="YouTube video player"
  frameborder="0"
  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen"
></iframe>
profile
제가 참고하기 위해 만든 블로그라 글을 편하게 작성했습니다. 틀린거 있다면 댓글 부탁드립니다.

0개의 댓글