-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchapter6.html
More file actions
96 lines (89 loc) Β· 3.73 KB
/
chapter6.html
File metadata and controls
96 lines (89 loc) Β· 3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chapter 6: HTML Multimedia</title>
<link rel="stylesheet" href="style.css">
<style>
.media-box {
border: 1px solid #ccc;
border-radius: 8px;
padding: 10px;
margin: 10px 0;
background: #f9f9f9;
}
audio, video {
display: block;
margin: 10px auto;
max-width: 100%;
}
</style>
</head>
<body>
<h2 class="chapter-header" id="heading">Chapter 6: HTML MULTIMEDIA</h2>
<!-- Audio Section -->
<div class="tag-section">
<h3>.1 Audio</h3>
<div class="tag-demo">
<div class="head-demo">
<p>
The <strong>audio</strong> element is used to embed sound into a webpage.
Supported formats: MP3, WAV, and OGG (MP3 recommended).
</p>
<ul style="margin-left: 7px;">
<li><strong>controls</strong> β shows play/pause, timeline, volume</li>
<li><strong>autoplay</strong> β plays audio automatically</li>
<li><strong>muted</strong> β starts with no sound</li>
<li><strong>loop</strong> β repeats automatically</li>
<li><strong>preload</strong> β load audio when page loads</li>
</ul>
<div class="media-box">
<h4>Example 1: Audio with multiple sources</h4>
<audio controls autoplay loop>
<source src="audio.ogg" type="audio/ogg" />
<source src="audio.mp3" type="audio/MP3" />
Your browser does not support the audio element.
</audio>
</div>
<div class="media-box">
<h4>Example 2: Audio with src attribute</h4>
<audio controls autoplay loop src="audio.mp3"></audio>
</div>
</div>
</div>
</div>
<!-- Video Section -->
<div class="tag-section">
<h3>.2 Video</h3>
<div class="tag-demo">
<div class="head-demo">
<p>
The <strong>video</strong> element is used to embed video into a webpage.
Supported formats: MP4, WebM, OGG (MP4 recommended).
</p>
<ul style="margin-left: 7px;">
<li><strong>controls</strong> β shows play/pause, timeline, volume</li>
<li><strong>autoplay</strong> β plays video automatically</li>
<li><strong>muted</strong> β starts with no sound</li>
<li><strong>loop</strong> β repeats automatically</li>
<li><strong>preload</strong> β load video when page loads</li>
<li><strong>width / height</strong> β set player size</li>
</ul>
<div class="media-box">
<h4>Example 1: Video with src attribute</h4>
<video src="video.mp4" controls loop width="320" height="240"></video>
</div>
<div class="media-box">
<h4>Example 2: Video with multiple sources</h4>
<video width="320" height="240" controls>
<source src="video.mp4" type="video/mp4" />
<source src="video.ogg" type="video/ogg" />
Your browser does not support the video element.
</video>
</div>
</div>
</div>
</div>
</body>
</html>