mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-31 23:29:27 +08:00
修复音乐播放bug
This commit is contained in:
parent
3604c7550f
commit
85f9a9fd07
@ -3585,19 +3585,19 @@ control.prototype.playBgm = function (bgm, startTime) {
|
||||
|
||||
////// 暂停背景音乐的播放 //////
|
||||
control.prototype.pauseBgm = function () {
|
||||
if (main.mode != 'play') return;
|
||||
if (main.mode !== 'play') return;
|
||||
ancTe.bgm.pause();
|
||||
};
|
||||
|
||||
////// 恢复背景音乐的播放 //////
|
||||
control.prototype.resumeBgm = function (resumeTime) {
|
||||
if (main.mode != 'play') return;
|
||||
if (main.mode !== 'play') return;
|
||||
ancTe.bgm.resume();
|
||||
};
|
||||
|
||||
////// 更改背景音乐的播放 //////
|
||||
control.prototype.triggerBgm = function () {
|
||||
if (main.mode != 'play') return;
|
||||
if (main.mode !== 'play') return;
|
||||
|
||||
core.musicStatus.bgmStatus = !core.musicStatus.bgmStatus;
|
||||
if (core.musicStatus.bgmStatus) this.resumeBgm();
|
||||
|
@ -63,6 +63,7 @@ export class BgmController extends ResourceController<HTMLAudioElement> {
|
||||
if (has(this.playing) || !this.lastBgm) return;
|
||||
const bgm = this.get(this.lastBgm);
|
||||
bgm.play();
|
||||
this.playing = this.lastBgm;
|
||||
}
|
||||
|
||||
get(id: BgmIds) {
|
||||
|
Loading…
Reference in New Issue
Block a user