From: Vincent Vanwaelscappel Date: Fri, 15 Sep 2023 09:14:26 +0000 (+0200) Subject: wait #6269 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=163c143d41accf8454e37c812a753abb22e86e18;p=fluidbook-html5.git wait #6269 @0.25 --- diff --git a/js/libs/fluidbook/fluidbook.loader.js b/js/libs/fluidbook/fluidbook.loader.js index 9b9e37f1..661bbb4b 100644 --- a/js/libs/fluidbook/fluidbook.loader.js +++ b/js/libs/fluidbook/fluidbook.loader.js @@ -18,6 +18,7 @@ function FluidbookLoader(fluidbook) { this.imageMimeType = this.format === 'jpg' ? 'image/jpeg' : 'image/png'; this._needSeparateTextures = []; this.loadbalancing = false; + this._loadbalancingServerURL = []; } FluidbookLoader.prototype = { @@ -734,8 +735,10 @@ FluidbookLoader.prototype = { if (!this.loadbalancing) { return url; } - let server = this.loadbalancing[Math.floor(Math.random() * this.loadbalancing.length)]; - return 'https://' + server + '/' + this.fluidbook.settings.id + '_' + this.fluidbook.settings.hash + '/' + url; + if(this._loadbalancingServerURL[url]===undefined){ + this._loadbalancingServerURL[url]=this.loadbalancing[Math.floor(Math.random() * this.loadbalancing.length)]; + } + return 'https://' + this._loadbalancingServerURL[url] + '/' + this.fluidbook.settings.id + '_' + this.fluidbook.settings.hash + '/' + url; }, getTexture: function (page, callback, enter) {