diff --git a/web_src/components/AdminLTE.vue b/web_src/components/AdminLTE.vue index b480e53..a404ae8 100644 --- a/web_src/components/AdminLTE.vue +++ b/web_src/components/AdminLTE.vue @@ -141,13 +141,6 @@ export default { nice: null, } }, - watch: { - serverInfo(val) { - if (val) { - document.title = val.LogoText || "LiveGBS"; - } - } - }, mounted() { $(document).ajaxError((evt, xhr, opts, ex) => { if (xhr.status == 401) { diff --git a/web_src/components/Login.vue b/web_src/components/Login.vue index d2fa746..68eb685 100644 --- a/web_src/components/Login.vue +++ b/web_src/components/Login.vue @@ -119,8 +119,10 @@ export default { ...mapState(["userInfo", "serverInfo"]) }, async mounted() { - await this.getServerInfo(); - document.title = this.serverInfo.LogoText || "LiveGBS"; + var serverInfo = await this.getServerInfo(); + if(serverInfo) { + document.title = serverInfo.LogoText || "LiveGBS"; + } var userInfo = await this.getUserInfo(); if(userInfo) { window.location.href = "/" diff --git a/web_src/components/Play.vue b/web_src/components/Play.vue index f06b101..d33643c 100644 --- a/web_src/components/Play.vue +++ b/web_src/components/Play.vue @@ -228,7 +228,7 @@ export default { shareUrl: "", snapUrl: "", ptz: true, - share: true, + share: false, fluent: true, stretch: false, autoplay: true, @@ -255,12 +255,17 @@ export default { this.ctrlStop(); $(document).off("mouseup touchend", this.ctrlStop); }, - created() { + async mounted() { + await this.getServerInfo(); + await this.getUserInfo(); + document.title = this.serverInfo.LogoText || "LiveGBS"; + this.aspect = this.getQueryString("aspect","").replace("x", ":"); this.autoplay = this.getQueryString("autoplay", "yes") == "yes"; this.controls = this.getQueryString("controls", "yes") == "yes"; this.ptz = this.getQueryString("ptz", "yes") == "yes"; - this.share = this.getQueryString("share", "yes") == "yes"; + var defShare = this.serverInfo.ShowShare ? "yes" : "no"; + this.share = this.getQueryString("share", defShare) == "yes"; this.fluent = this.getQueryString("fluent", "yes") == "yes"; this.stretch = this.getQueryString("stretch", "no") == "yes"; this.type = this.getQueryString("type", "stream"); @@ -276,11 +281,6 @@ export default { this.talk = this.getQueryString("talk", "no") == "yes"; this.otherParams = this.getOtherParams(["aspect", "autoplay", "controls", "ptz", "share", "fluent", "stretch", "type", "starttime", "endtime", "serial", "code", "channel", "protocol", "muted", "talk", "debug"]) this.shareUrl = location.href; - }, - async mounted() { - await this.getServerInfo(); - await this.getUserInfo(); - document.title = this.serverInfo.LogoText || "LiveGBS"; $(document).ajaxError((evt, xhr, opts, ex) => { if (xhr.status == 401) { if (this.serverInfo.IsDemo) { diff --git a/web_src/router.js b/web_src/router.js index 4969c60..2630d2b 100644 --- a/web_src/router.js +++ b/web_src/router.js @@ -232,6 +232,9 @@ const router = new Router({ router.beforeEach(async (to, from, next) => { var serverInfo = await store.dispatch("getServerInfo"); + if(serverInfo) { + document.title = serverInfo.LogoText || "LiveGBS"; + } var userInfo = await store.dispatch("getUserInfo"); // if (serverInfo && serverInfo.APIAuth === false && !userInfo) { // next();