English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
HTMLMediaElement.autoplay 속성은 HTML 속성의 autoplay과 동일합니다. 이는 플레이어가 재생할 수 있는 enough 파일을 다운로드했을 때 자동으로 재생할지 여부를 나타냅니다. 주의: 일부 Chrome 버전은 autostart를 지원하지만 autoplay를 지원하지 않습니다
자동 재생을 활성화하고 비디오를 다시 로드하십시오:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML 오디오/video audioTracks 속성 사용-기본 강의(oldtoolbag.com)</title> </head> <body> <button onclick="enableAutoplay()" type="button">자동 재생 활성화</button> <button onclick="disableAutoplay()" type="button">자동 재생 비활성화</button> <button onclick="checkAutoplay()" type="button">자동 재생 상태 확인</button> <br> <video id="video1" controls="controls"> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> 당신의 브라우저는 HTML을 지원하지 않습니다5 video 레이블. </video> <script> myVid=document.getElementById("video1"); function enableAutoplay() { myVid.autoplay=true; myVid.load(); } function disableAutoplay() { myVid.autoplay=false; myVid.load(); } function checkAutoplay()} { alert(myVid.autoplay); } </script> </body> </html>테스트해 보세요 ‹/›
autoplay 속성이 로드된 오디오에서 재생되는지 여부를 설정하거나 반환합니다./비디오가 바로 재생됩니다.
IEFirefoxOperaChromeSafari
모든 주요 브라우저는 autoplay 속성을 지원합니다.
주의:Internet Explorer 8 이전 버전은 이 속성을 지원하지 않습니다.
autoplay 속성 설정:
audio|video.autoplay=true|false
autoplay 속성 반환:
audio|video.autoplay
값 | 설명 |
---|---|
true | 오디오 지시/로드 후 즉시 재생되도록 합니다. |
false | 기본./로드 후 즉시 재생되지 않도록 합니다. |
반환 값: | 부울 값, true|false |
---|---|
기본 값: | false |