{{ $t('Panels.WebcamPanel.UnknownWebcamService') }}
@@ -55,6 +55,7 @@ import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types' export default class WebcamWrapperItem extends Mixins(BaseMixin) { @Prop({ type: Object, required: true }) webcam!: GuiWebcamStateWebcam @Prop({ type: Boolean, default: true }) showFps!: Boolean + @Prop({ default: null }) printerUrl!: string | null get service() { return this.webcam?.service ?? 'unknown' diff --git a/src/components/webcams/WebrtcMediaMTX.vue b/src/components/webcams/WebrtcMediaMTX.vue index 9a54934e9..65abd7892 100644 --- a/src/components/webcams/WebrtcMediaMTX.vue +++ b/src/components/webcams/WebrtcMediaMTX.vue @@ -21,10 +21,12 @@ import { Component, Mixins, Prop, Ref, Watch } from 'vue-property-decorator' import BaseMixin from '@/components/mixins/base' import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types' +import WebcamMixin from '@/components/mixins/webcam' @Component -export default class WebrtcRTSPSimpleServer extends Mixins(BaseMixin) { +export default class WebrtcRTSPSimpleServer extends Mixins(BaseMixin, WebcamMixin) { @Prop({ required: true }) readonly camSettings!: GuiWebcamStateWebcam + @Prop({ default: null }) readonly printerUrl!: string | null @Ref() declare video: HTMLVideoElement // webrtc player vars @@ -54,11 +56,12 @@ export default class WebrtcRTSPSimpleServer extends Mixins(BaseMixin) { } get url() { - if (this.camSettings.stream_url.startsWith('http')) { - return this.camSettings.stream_url.replace('http', 'ws') + 'ws' + let baseUrl = this.camSettings.stream_url + if (baseUrl.startsWith('http')) { + baseUrl = baseUrl.replace('http', 'ws') + 'ws' } - return this.camSettings.stream_url + return this.convertUrl(baseUrl, this.printerUrl) } // stop and restart the video if the url changes