mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-25 05:19:22 +00:00
41 lines
678 B
JavaScript
41 lines
678 B
JavaScript
/**
|
|
* Notification song
|
|
*
|
|
* @author Pierre HUBERT
|
|
*/
|
|
|
|
ComunicWeb.components.notifications.song = {
|
|
|
|
/**
|
|
* Song element : null by default
|
|
*/
|
|
songElem: null,
|
|
|
|
/**
|
|
* Play notification song once
|
|
*/
|
|
play: function(){
|
|
|
|
//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"
|
|
});
|
|
}
|
|
|
|
//Play song
|
|
this.songElem.play();
|
|
}
|
|
} |