Use Remote BGM

This commit is contained in:
oc 2018-02-27 14:12:21 +08:00
parent 0b548955c4
commit bfd22c8b83
2 changed files with 3 additions and 1 deletions

View File

@ -695,7 +695,8 @@ core.prototype.loadMusic = function (callback) {
else {
var music = new Audio();
music.preload = core.musicStatus.startDirectly?'auto':'none';
music.src = 'sounds/'+t;
if (main.bgmRemote) music.src = 'https://gitee.com/ckcz123/h5music/raw/master/'+core.firstData.name+'/'+t;
else music.src = 'sounds/'+t;
music.loop = 'loop';
core.material.bgms[t] = music;
}

View File

@ -30,6 +30,7 @@ function main() {
// 音频名不能使用中文,不能带空格或特殊字符;可以直接改名拼音就好
'floor.mp3', 'attack.ogg', 'door.ogg', 'item.ogg', 'zone.ogg'
];
this.bgmRemote = false; // 是否使用远程的背景音乐;此项一般不要开启
//------------------------ 用户修改内容 END ------------------------//