-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaudiooplayer mini project.html
More file actions
54 lines (48 loc) · 1.25 KB
/
audiooplayer mini project.html
File metadata and controls
54 lines (48 loc) · 1.25 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
<!DOCTYPE html>
<html>
<head>
<style>
div.ex1{background-color:#CCCCCC;max-width:475px;max-height:356px;}
div.ex2{background-color:#CCCCCC;max-width:480px;max-height:356px; border:2px solid black;}
div.ex{ background-color:grey; max-width: 475px;}
</style>
</head>
<body>
<div class="ex2">
<audio id="AudioPlayer">
<source src="swades.mp3" type="audio/mpeg">
</audio>
<div class="ex1" align="center">
<img src="swades.jpg" width="250px" length="250px">
</div><hr>
<div class="ex">
<br>
<button onclick="playAudio()" type="button">Play Audio</button>
<button onclick="pauseAudio()" type="button">Pause Audio</button>
<button onclick="stopAudio()" type="button">Stop Audio</button>
<button onclick="frwdAudio()" type="button">Forwind Audio</button>
<button onclick="revsAudio()" type="button">Rewind Audio</button>
<br>
</div>
</div>
<script>
var m = document.getElementById("AudioPlayer"); <!--To get myaudio id-->
function playAudio() {
m.play();
}
function pauseAudio() {
m.pause();
}
function stopAudio(){
m.pause();
m.currentTime = 0;
}
function frwdAudio(){
m.currentTime = m.currentTime+10;
}
function revsAudio(){
m.currentTime = m.currentTime-10;
}
</script>
</body>
</html>