html 자동재생 방법 안내

Posted by 슈퍼너드 리보
2021. 9. 10. 11:40 인터넷 수입원/유튜브
반응형

<iframe width="560" height="315" src="https://www.youtube.com/embed/0EWWXQA9D48" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

 

예시코드입니다. 여기를 보면 src 주소 마지막에  0EWWXQA9D48을 키값이라고 합니다. 키값 뒤에다가 

?autoplay=1를 붙여주면 자동 재생이 됩니다. 

 

구분자로 /넣어주고 /?autoplay=1이라고 넣어주면 됩니다. 이렇게요!

 

<iframe width="560" height="315" src="https://www.youtube.com/embed/0EWWXQA9D48/?autoplay=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

 

영상이 자동재생 되는것을 확인 할 수 있습니다.

 

※티스토리상에선 자동재생이 안될 수 있습니다. 

반응형