-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebplay.html
More file actions
42 lines (34 loc) · 1.45 KB
/
webplay.html
File metadata and controls
42 lines (34 loc) · 1.45 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
<!DOCTYPE html>
<html>
<head>
<title>The latest and greatest music player</title>
<!-- TODO: a link to a .css file containing default styles for the music player -->
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.5.1.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-1.7-development-only.js"></script>
<!-- TODO: your MusicPlayer jQuery plugin reference!!!! -->
</head>
<body>
<!-- <div id="thePlayer"><audio src= playlist controls></audio></div> <!-- this element will host the player!! -->
<p>The latest and greatest music player</p>
<button id="pause">pause</button>
<button id="play">play</button>
<audio id= "audioPlayer"> </audio>
<script type="text/javascript">
$(document).ready( function() {
var player = document.getElementById("audioPlayer");
player.src = "http://rokk.is/mp3/t/thingtak_buttmunch.mp3";
$("#play").click( function() {
player.play();
});
$("#pause").click( function() {
player.pause();
});
// Note: this version assumes a JavaScript array of songs, but
// the other approach is also acceptable
var playlist = [ "http://rokk.is/mp3/t/thingtak_buttmunch.mp3",
"http://www.rokk.is/mp3/kanis/kanis_litill_drengur.mp3",
"http://rokk.is/mp3/a/althingi_oxara.mp3" ];
});
</script>
</body>
</html>