HTML5의 <video> μš”μ†ŒλŠ” μ›Ή νŽ˜μ΄μ§€μ—μ„œ λ™μ˜μƒμ„ μž¬μƒν•˜λŠ” 데 μ‚¬μš©λ©λ‹ˆλ‹€. μ•„λž˜λŠ” κ°„λ‹¨ν•œ <video> μš”μ†Œλ₯Ό μ΄μš©ν•œ λͺ‡ κ°€μ§€ μ˜ˆμ‹œμž…λ‹ˆλ‹€.

  1. 기본적인 μ‚¬μš©:
html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Video Example</title> </head> <body> <video width="640" height="360" controls> <source src="example.mp4" type="video/mp4"> Your browser does not support the video tag. </video> </body> </html>
  1. μ—¬λŸ¬ ν˜•μ‹ 지원:
html
<video width="640" height="360" controls> <source src="example.mp4" type="video/mp4"> <source src="example.webm" type="video/webm"> Your browser does not support the video tag. </video>
  1. μžλ™ μž¬μƒκ³Ό 루프:
html
<video width="640" height="360" controls autoplay loop> <source src="example.mp4" type="video/mp4"> Your browser does not support the video tag. </video>
  1. ν¬μŠ€ν„° 이미지 μΆ”κ°€:
html
<video width="640" height="360" controls poster="poster.jpg"> <source src="example.mp4" type="video/mp4"> Your browser does not support the video tag. </video>
  1. μžλ§‰ μΆ”κ°€:
html
<video width="640" height="360" controls> <source src="example.mp4" type="video/mp4"> <track label="Korean" kind="subtitles" srclang="ko" src="subtitles_ko.vtt" default> <track label="English" kind="subtitles" srclang="en" src="subtitles_en.vtt"> Your browser does not support the video tag. </video>
  1. 이벀트 처리 μΆ”κ°€:
html
<video width="640" height="360" controls id="myVideo"> <source src="example.mp4" type="video/mp4"> Your browser does not support the video tag. </video> <script> var video = document.getElementById("myVideo"); video.onplay = function() { console.log("Video is playing"); }; video.onended = function() { console.log("Video has ended"); }; </script>

μ΄λŸ¬ν•œ μ˜ˆμ‹œλ“€μ€ <video> μš”μ†Œμ˜ λ‹€μ–‘ν•œ 속성과 κΈ°λŠ₯을 보여주고 μžˆμŠ΅λ‹ˆλ‹€. μ‹€μ œ ν”„λ‘œμ νŠΈμ—μ„œλŠ” λ™μ˜μƒ 파일 경둜, μžλ§‰ 파일 경둜 등을 μ‹€μ œλ‘œ μ‚¬μš©ν•˜λŠ” κ°’μœΌλ‘œ λŒ€μ²΄ν•΄μ•Ό ν•©λ‹ˆλ‹€.