mirror of
https://github.com/pierre42100/ComunicWeb
synced 2025-06-19 04:15:17 +00:00
Created song player class
This commit is contained in:
@ -18,24 +18,13 @@ ComunicWeb.components.notifications.song = {
|
||||
|
||||
//Create song element if required
|
||||
if(this.songElem == null){
|
||||
this.songElem = createElem2({
|
||||
type: "audio"
|
||||
});
|
||||
|
||||
createElem2({
|
||||
type: "source",
|
||||
appendTo: this.songElem,
|
||||
src: ComunicWeb.__config.assetsURL + "audio/notif_song.mp3"
|
||||
});
|
||||
|
||||
createElem2({
|
||||
type: "source",
|
||||
appendTo: this.songElem,
|
||||
src: ComunicWeb.__config.assetsURL + "audio/notif_song.ogg"
|
||||
});
|
||||
this.songElem = new SongPlayer([
|
||||
ComunicWeb.__config.assetsURL + "audio/notif_song.mp3",
|
||||
ComunicWeb.__config.assetsURL + "audio/notif_song.ogg"
|
||||
]);
|
||||
}
|
||||
|
||||
//Play song
|
||||
this.songElem.play();
|
||||
this.songElem.playOnce();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user