-
Notifications
You must be signed in to change notification settings - Fork 0
/
audio.html
39 lines (35 loc) · 885 Bytes
/
audio.html
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
<!doctype html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>html5 experiment "audio"</title>
</head>
<body style="text-align:center;">
<h1>audio experiment</h1>
<audio src="sample.mp3" controls id="experiment"></audio>
<fieldset>
<label>ボリューム
<input type="range" min="0" max="1" step="0.01" value="1" id="volume">
</label>
<button id="play">play</button>
<button id="pause">pause</button>
</fieldset>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
$(function() {
"use strict";
console.log('Yo-Ho!');
var audio = $('#experiment')[0];
$('#play').on('click', function() {
audio.play();
});
$('#pause').on('click', function() {
audio.pause();
});
$('#volume').on('change', function() {
audio.volume = this.value;
});
});
</script>
</body>
</html>