-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathapp.js
50 lines (49 loc) · 1.09 KB
/
app.js
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
//app.js
App({
onLaunch: function () {
wx.setNavigationBarTitle({
title: 'mySkey音乐'
})
this.initAudio()
},
onShow(){
if(this.audioDom.paused){
this.player.status = 2;
}
},
onHide: function () {
},
player: {
list: [],
current_music: 0,
mode: 0, // 0 单曲 1 顺序 2 随机
status: 0, // 0 未播放 1 播放 2 暂停中 3 已结束
playbackRate: 1, // 倍速
a_resource: '',
i_resource: '',
global_show: 0, // 全局显示 0 不显示 1 显示
playing: {
id: '',
name: '',
cover: '',
url: '',
singer: {
avatar: '',
name: ''
},
currentTime: 0,
duration: 0,
timeArr: [],
lrcArr: []
}
},
audioDom: wx.getBackgroundAudioManager(),
initAudio(){
this.audioDom.title = '起风了';
this.audioDom.epname = '555';
this.audioDom.singer = 'mySkey';
this.audioDom.coverImgUrl = 'http://img.22family.com/mySKey/favicon.ico';
this.audioDom.paused = true;
this.audioDom.stop = true;
}
})