-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
32 lines (31 loc) · 1.28 KB
/
script.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
console.log("Welcome to Spotify");
let songs= [
{songname: "Alag Aasman", filepath: "song/1.mp3", coverpath: "cover/1.jpg"},
{songname: "Alag Aasman", filepath: "song/1.mp3", coverpath: "cover/1.jpg"},
{songname: "salam-e-ishq", filepath: "song/1.mp3", coverpath: "cover/1.jpg"},
{songname: "salam-e-ishq", filepath: "song/1.mp3", coverpath: "cover/1.jpg"},
{songname: "salam-e-ishq", filepath: "song/1.mp3", coverpath: "cover/1.jpg"},
{songname: "salam-e-ishq", filepath: "song/1.mp3", coverpath: "cover/1.jpg"},
{songname: "salam-e-ishq", filepath: "song/1.mp3", coverpath: "cover/1.jpg"},
{songname: "salam-e-ishq", filepath: "song/1.mp3", coverpath: "cover/1.jpg"},
]
let audioElement=new Audio('1.mp3');
//audioElement.play();
//handle play/pause click
masterPlay.addeventListner('click', ()=>{
if (audioElement.paused || audioElement.currenttime<=0){
audioElement.play();
masterPlay.classlist.remove('fa-play-circle');
masterPlay.classlist.add('fa-pause-circle');
}
else{
audioElement.play();
masterPlay.classlist.remove('fa-pause-circle');
masterPlay.classlist.add('fa-play-circle');
}
})
//Listen to events
myprogressBar.addeventListner('timeupdate', ()=>{
console.log('timeupdate');
//update seekbar
})