diff --git a/assets/js/common/songPlayer.js b/assets/js/common/songPlayer.js index 2a99a888..4d8b8d2b 100644 --- a/assets/js/common/songPlayer.js +++ b/assets/js/common/songPlayer.js @@ -29,6 +29,23 @@ class SongPlayer { * Play audio just once */ playOnce(){ + this.songElem.loop = false; this.songElem.play(); } + + /** + * Play song forever + */ + playForever(){ + this.songElem.loop = true; + this.songElem.play(); + } + + /** + * Stop song + */ + stop(){ + this.songElem.pause(); + this.songElem.currentTime = 0; + } } \ No newline at end of file