|
@@ -8,6 +8,15 @@ var Manage = function(){
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+let allBgm = document.createElement('video')
|
|
|
|
|
+allBgm.src = './music/bgm.mp3'
|
|
|
|
|
+allBgm.autoplay = true
|
|
|
|
|
+allBgm.loop = true
|
|
|
|
|
+allBgm.volume = 0.1
|
|
|
|
|
+allBgm.load()
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//动态加载js文件
|
|
//动态加载js文件
|
|
|
Manage.prototype.LoadJs = function(_files, succes){
|
|
Manage.prototype.LoadJs = function(_files, succes){
|
|
|
/* 已加载文件缓存列表,用于判断文件是否已加载过,若已加载则不再次加载*/
|
|
/* 已加载文件缓存列表,用于判断文件是否已加载过,若已加载则不再次加载*/
|
|
@@ -175,7 +184,7 @@ Manage.prototype.ifTourCanPlay = function(){//只有导览在播放时才能继
|
|
|
|
|
|
|
|
|
|
|
|
|
Manage.prototype.switchMusicState = function(state){ //按钮按钮掌管全局音频,导览优先,没有了才放bgm
|
|
Manage.prototype.switchMusicState = function(state){ //按钮按钮掌管全局音频,导览优先,没有了才放bgm
|
|
|
- this.musicShouldPlay = state
|
|
|
|
|
|
|
+ this.musicShouldPlay = state
|
|
|
if(state){
|
|
if(state){
|
|
|
if(! (this.ifTourCanPlay() && player.director.playAudio())){
|
|
if(! (this.ifTourCanPlay() && player.director.playAudio())){
|
|
|
this.switchBgmState(true)
|
|
this.switchBgmState(true)
|
|
@@ -196,10 +205,9 @@ Manage.prototype.switchMusicState = function(state){ //按钮按钮掌管全
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-Manage.prototype.switchBgmState = function(state){
|
|
|
|
|
- if(!this.musicShouldPlay)return
|
|
|
|
|
|
|
+Manage.prototype.switchBgmState = function(state){
|
|
|
if(!g_bgAudio || !g_bgAudio.src) return;
|
|
if(!g_bgAudio || !g_bgAudio.src) return;
|
|
|
- //this.currentPlay = 'bgm'
|
|
|
|
|
|
|
+ this.currentPlay = 'bgm'
|
|
|
|
|
|
|
|
var played = function(){
|
|
var played = function(){
|
|
|
console.log('begin play bgm '+ g_bgAudio.src);
|
|
console.log('begin play bgm '+ g_bgAudio.src);
|