zhouenguang il y a 3 ans
Parent
commit
61de2d2161
2 fichiers modifiés avec 36 ajouts et 14 suppressions
  1. 29 14
      web/public/static/js/main_2020_show.js
  2. 7 0
      webM/public/static/js/main_2020_show.js

+ 29 - 14
web/public/static/js/main_2020_show.js

@@ -21988,22 +21988,37 @@ window.Modernizr = function(n, e, t) {
                 return function(t, i, n, r, o, a, s, l) {
                     if (!t)
                         throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
+                    // 周恩光加 loadTiledPano有时会在progress中卡住,此时判断为成功加载
+                    let isDone = false
+                    let handle
                     return e.copy(d.FORWARD),
                     this.getDirection(e),
-                    !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
-                        return t.isLoaded(i)
-                    }),
-                    t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
-                        n && n(e, t)
-                    }
-                    .bind(this)).fail(function(e) {
-                        r && r(e)
-                    }
-                    .bind(this)).progress(function(e, t, i) {
-                        o && o(e, t, i)
-                    }
-                    .bind(this)),
-                    !0)
+                    !t.isLoaded(i) && (
+                        a && this.model.waitForLoad(t, function() {
+                            return t.isLoaded(i)
+                        }),
+
+                        t.loadTiledPano(i, e, null, s, l)
+
+                            .done(function(e, t) {
+                                isDone = true
+                                n && n(e, t)
+                            }.bind(this))
+
+                            .fail(function(e) {
+                                r && r(e)
+                            }.bind(this))
+
+                            .progress(function(e, t, i) {
+                                handle && clearTimeout(handle)
+                                handle = setTimeout(() => {
+                                    if(isDone == false) n && n(e, t)
+                                }, 3000)    // 卡住3秒判断为加载成功
+                                o && o(e, t, i)
+                            }.bind(this)),
+
+                        !0
+                    )
                 }
             }(),
             n.prototype.switchCameraMode = function(e, t) {

+ 7 - 0
webM/public/static/js/main_2020_show.js

@@ -21981,18 +21981,25 @@ window.Modernizr = function(n, e, t) {
                 return function(t, i, n, r, o, a, s, l) {
                     if (!t)
                         throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
+                    let isDone = false
+                    let handle
                     return e.copy(d.FORWARD),
                     this.getDirection(e),
                     !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
                         return t.isLoaded(i)
                     }),
                     t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
+                        isDone = true
                         n && n(e, t)
                     }
                     .bind(this)).fail(function(e) {
                         r && r(e)
                     }
                     .bind(this)).progress(function(e, t, i) {
+                        handle && clearTimeout(handle)
+                        handle = setTimeout(() => {
+                            if(isDone == false) n && n(e, t)
+                        }, 3000)
                         o && o(e, t, i)
                     }
                     .bind(this)),