-
Notifications
You must be signed in to change notification settings - Fork 0
/
musicdi.html
117 lines (106 loc) · 3.09 KB
/
musicdi.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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>html5 音频播放</title>
<link rel="stylesheet" type="text/css" href="css/audio.css">
</head>
<body style="height: 999px">
<div class="audio-box">
<div class="audio-container">
<div class="audio-view">
<div class="audio-cover" ></div>
<div class="audio-body">
<h3 class="audio-title">未知歌曲</h3>
<div class="audio-backs">
<div class="audio-this-time">00:00</div>
<div class="audio-count-time">00:00</div>
<div class="audio-setbacks">
<i class="audio-this-setbacks">
<span class="audio-backs-btn"></span>
</i>
<span class="audio-cache-setbacks">
</span>
</div>
</div>
</div>
<div class="audio-btn">
<div class="audio-select">
<div class="audio-prev"></div>
<div class="audio-play"></div>
<div class="audio-next"></div>
<div class="audio-menu"></div>
<div class="audio-volume"></div>
</div>
<div class="audio-set-volume">
<div class="volume-box">
<i><span></span></i>
</div>
</div>
<div class="audio-list">
<div class="audio-list-head">
<p>歌单</p>
<span class="menu-close">关闭</span>
</div>
<ul class="audio-inline">
</ul>
</div>
</div>
</div>
</div>
</div>
</body>
<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script type="text/javascript" src="js/audio.js"></script>
<script type="text/javascript">
$(function(){
var song = [
{
'cover' : 'images/cover2.jpg',
'src' : 'http://m2.music.126.net/4uhG3v3vvpRTwJ-HTd5P6w==/6637751697320553.mp3',
'title' : 'Memories'
},
{
'cover' : 'images/cover.png',
'src' : 'http://webmp3-1253691995.costj.myqcloud.com/audio/NumberOne.mp3',
'title' : 'number one'
},
{
'cover' : 'images/cover1.jpg',
'src' : 'http://webmp3-1253691995.costj.myqcloud.com/audio/dqwm.mp3',
'title' : '大橋のぞみ - 黒ネコのタンゴ'
},
{
'cover' : 'images/cover3.jpg',
'src' : 'http://webmp3-1253691995.costj.myqcloud.com/audio/qby.mp3',
'title' : '黒うさP,初音ミク - 千本桜'
},
{
'cover' : 'images/cover4.jpg',
'src' : 'http://webmp3-1253691995.costj.myqcloud.com/audio/jljt.mp3',
'title' : '极乐净土'
}
];
var audioFn = audioPlay({
song : song,
autoPlay : true //是否立即播放第一首,autoPlay为true且song为空,会alert文本提示并退出
});
/* 向歌单中添加新曲目,第二个参数true为新增后立即播放该曲目,false则不播放 */
audioFn.newSong({
'cover' : 'images/cover5.jpg',
'src' : 'http://webmp3-1253691995.costj.myqcloud.com/audio/baab.mp3',
'title' : 'B.A.A.B'
},false);
/* 暂停播放 */
//audioFn.stopAudio();
/* 开启播放 */
//audioFn.playAudio();
/* 选择歌单中索引为3的曲目(索引是从0开始的),第二个参数true立即播放该曲目,false则不播放 */
//audioFn.selectMenu(3,true);
/* 查看歌单中的曲目 */
//console.log(audioFn.song);
/* 当前播放曲目的对象 */
//console.log(audioFn.audio);
});
</script>
</html>