1 2 3 4 5 6 7 8 9 10 11 12 13 14
export class Radio { bgm playMusic(file) { if (this.bgm != undefined) this.bgm.pause() this.bgm = new Audio(file) this.bgm.play() this.bgm.loop = true } playSound(file) { let audio = new Audio(file) audio.play() } }