ui_migration bugfix(component) add fallback override for img src
This commit is contained in:
parent
8fb445bcbf
commit
5e15a423ee
2 changed files with 3 additions and 5 deletions
|
|
@ -5,7 +5,7 @@
|
||||||
class="stream-display uk-width-1-1 uk-height-1-1 scrollTarget"
|
class="stream-display uk-width-1-1 uk-height-1-1 scrollTarget"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
v-show="isVisible && streamEnabled "
|
v-show="isVisible && streamEnabled"
|
||||||
ref="click-frame"
|
ref="click-frame"
|
||||||
class="uk-align-center uk-margin-remove-bottom"
|
class="uk-align-center uk-margin-remove-bottom"
|
||||||
:src="streamImgUri"
|
:src="streamImgUri"
|
||||||
|
|
@ -88,12 +88,14 @@ export default {
|
||||||
);
|
);
|
||||||
this.stopIntersectionObserver = stop;
|
this.stopIntersectionObserver = stop;
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeUnmount() {
|
beforeUnmount() {
|
||||||
clearTimeout(this.observerTimeout); // Clean up the timer!
|
clearTimeout(this.observerTimeout); // Clean up the timer!
|
||||||
if (this.stopIntersectionObserver) {
|
if (this.stopIntersectionObserver) {
|
||||||
this.stopIntersectionObserver();
|
this.stopIntersectionObserver();
|
||||||
}
|
}
|
||||||
this.store.removeStream(this.streamId);
|
this.store.removeStream(this.streamId);
|
||||||
|
// Override img source to single pixel and drop MJPEG stream
|
||||||
const imgElement = this.$refs["click-frame"];
|
const imgElement = this.$refs["click-frame"];
|
||||||
if (imgElement) {
|
if (imgElement) {
|
||||||
imgElement.src = ONE_PIXEL_FALLBACK;
|
imgElement.src = ONE_PIXEL_FALLBACK;
|
||||||
|
|
|
||||||
|
|
@ -69,10 +69,6 @@ export default {
|
||||||
streamEnabled: function () {
|
streamEnabled: function () {
|
||||||
return this.ready && !this.disableStream;
|
return this.ready && !this.disableStream;
|
||||||
},
|
},
|
||||||
streamOpen: function () {
|
|
||||||
// Only a single MJPEG connection should be open at a time
|
|
||||||
return !(this.displaySize[0] == 0) && !(this.displaySize[1] == 0);
|
|
||||||
},
|
|
||||||
streamImgUri: function () {
|
streamImgUri: function () {
|
||||||
// Only request the real stream if it's enabled AND currently visible on screen
|
// Only request the real stream if it's enabled AND currently visible on screen
|
||||||
if (this.isVisible && this.streamEnabled) {
|
if (this.isVisible && this.streamEnabled) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue