fix: fix img size without a stream (u4vl-mode) (#860)

This commit is contained in:
Stefan Dej authored and GitHub committed 2022-05-29 13:28:42 +02:00
1 parent 4be40b6457
commit 4671935491
2 files changed
+8 -4

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
<style>
<style scoped>
.webcamImage {
width: 100%;
background: lightgray;
+7 -3
View File
@@ -9,15 +9,13 @@
<img
ref="webcamUv4lMjpegImage"
v-observe-visibility="viewportVisibilityChanged"
:src="url"
:alt="camSettings.name"
:style="webcamStyle"
class="webcamImage"
@load="onload" />
</template>
<script lang="ts">
import { Component, Mixins, Prop } from 'vue-property-decorator'
import { Component, Mixins, Prop, Watch } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
@@ -109,5 +107,11 @@ export default class Uv4lMjpeg extends Mixins(BaseMixin) {
this.$refs.webcamUv4lMjpegImage.naturalWidth / this.$refs.webcamUv4lMjpegImage.naturalHeight
}
}
@Watch('url')
async urlChanged() {
await this.stopStream()
await this.startStream()
}
}
</script>