mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-26 13:59:23 +00:00
Can play forever songs
This commit is contained in:
parent
289a66e55b
commit
35c4597017
@ -29,6 +29,23 @@ class SongPlayer {
|
|||||||
* Play audio just once
|
* Play audio just once
|
||||||
*/
|
*/
|
||||||
playOnce(){
|
playOnce(){
|
||||||
|
this.songElem.loop = false;
|
||||||
this.songElem.play();
|
this.songElem.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Play song forever
|
||||||
|
*/
|
||||||
|
playForever(){
|
||||||
|
this.songElem.loop = true;
|
||||||
|
this.songElem.play();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stop song
|
||||||
|
*/
|
||||||
|
stop(){
|
||||||
|
this.songElem.pause();
|
||||||
|
this.songElem.currentTime = 0;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user