diff --git a/src/components/settings/Webcams/WebcamForm.vue b/src/components/settings/Webcams/WebcamForm.vue index 167dc1f85..5a43c4fbc 100644 --- a/src/components/settings/Webcams/WebcamForm.vue +++ b/src/components/settings/Webcams/WebcamForm.vue @@ -111,6 +111,15 @@ :label="$t('Settings.WebcamsTab.HideFps')" /> + + + + +
@@ -231,6 +240,7 @@ export default class WebcamForm extends Mixins(BaseMixin, WebcamMixin) { { value: 'uv4l-mjpeg', text: this.$t('Settings.WebcamsTab.Uv4lMjpeg') }, { value: 'ipstream', text: this.$t('Settings.WebcamsTab.Ipstream') }, { value: 'webrtc-camerastreamer', text: this.$t('Settings.WebcamsTab.WebrtcCameraStreamer') }, + { value: 'webrtc-go2rtc', text: this.$t('Settings.WebcamsTab.WebrtcGo2rtc') }, { value: 'webrtc-mediamtx', text: this.$t('Settings.WebcamsTab.WebrtcMediaMTX') }, { value: 'hlsstream', text: this.$t('Settings.WebcamsTab.Hlsstream') }, { value: 'jmuxer-stream', text: this.$t('Settings.WebcamsTab.JMuxerStream') }, @@ -263,6 +273,10 @@ export default class WebcamForm extends Mixins(BaseMixin, WebcamMixin) { return ['mjpegstreamer', 'mjpegstreamer-adaptive'].includes(this.webcam.service) } + get hasAudioOption() { + return ['webrtc-go2rtc'].includes(this.webcam.service) + } + get hideFps() { return this.webcam.extra_data?.hideFps ?? false } @@ -280,6 +294,23 @@ export default class WebcamForm extends Mixins(BaseMixin, WebcamMixin) { this.webcam.extra_data.hideFps = newVal } + get enableAudio() { + return this.webcam.extra_data?.enableAudio ?? false + } + + set enableAudio(newVal) { + if (!('extra_data' in this.webcam)) { + this.webcam.extra_data = { + enableAudio: newVal, + } + + return + } + + // @ts-ignore + this.webcam.extra_data.enableAudio = newVal + } + mounted() { this.oldWebcamName = this.webcam.name } diff --git a/src/components/webcams/WebcamWrapperItem.vue b/src/components/webcams/WebcamWrapperItem.vue index 989a88e07..4e7217ef1 100644 --- a/src/components/webcams/WebcamWrapperItem.vue +++ b/src/components/webcams/WebcamWrapperItem.vue @@ -27,6 +27,9 @@ + @@ -51,6 +54,7 @@ import { DynamicCamLoader } from '@/components/webcams/streamers/DynamicCamLoade Uv4lMjpegAsync: DynamicCamLoader('Uv4lMjpeg'), WebrtcCameraStreamerAsync: DynamicCamLoader('WebrtcCameraStreamer'), WebrtcMediaMTXAsync: DynamicCamLoader('WebrtcMediaMTX'), + WebrtcGo2rtcAsync: DynamicCamLoader('WebrtcGo2rtc'), }, }) export default class WebcamWrapperItem extends Mixins(BaseMixin) { diff --git a/src/components/webcams/streamers/DynamicCamLoader.ts b/src/components/webcams/streamers/DynamicCamLoader.ts index 663206e51..a41182f37 100644 --- a/src/components/webcams/streamers/DynamicCamLoader.ts +++ b/src/components/webcams/streamers/DynamicCamLoader.ts @@ -10,6 +10,7 @@ type StreamerTypes = | 'Uv4lMjpeg' | 'WebrtcCameraStreamer' | 'WebrtcMediaMTX' + | 'WebrtcGo2rtc' function getDynamicCamImport(componentName: StreamerTypes) { // split each webcam streamer into its own chunk @@ -32,6 +33,8 @@ function getDynamicCamImport(componentName: StreamerTypes) { return () => import('@/components/webcams/streamers/WebrtcCameraStreamer.vue') case 'WebrtcMediaMTX': return () => import('@/components/webcams/streamers/WebrtcMediaMTX.vue') + case 'WebrtcGo2rtc': + return () => import('@/components/webcams/streamers/WebrtcGo2rtc.vue') } } diff --git a/src/components/webcams/streamers/WebrtcGo2rtc.vue b/src/components/webcams/streamers/WebrtcGo2rtc.vue new file mode 100644 index 000000000..f3bb47926 --- /dev/null +++ b/src/components/webcams/streamers/WebrtcGo2rtc.vue @@ -0,0 +1,247 @@ + + + + + diff --git a/src/locales/de.json b/src/locales/de.json index 44326dbd9..e8b227864 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -1146,6 +1146,7 @@ "CreateWebcam": "Erstelle Webcam", "EditCrowsnestConf": "crowsnest.conf bearbeiten", "EditWebcam": "Webcam bearbeiten", + "EnableAudio": "Ton einschalten", "FlipWebcam": "Webcam-Bild spiegeln:", "HideFps": "FPS-Anzeige verstecken", "Hlsstream": "HLS-Stream", diff --git a/src/locales/en.json b/src/locales/en.json index 8388d465f..c0f99508f 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1164,6 +1164,7 @@ "CreateWebcam": "Create Webcam", "EditCrowsnestConf": "Edit crowsnest.conf", "EditWebcam": "Edit Webcam", + "EnableAudio": "Enable audio", "FlipWebcam": "Flip webcam image:", "HideFps": "Hide FPS counter", "Hlsstream": "HLS Stream", @@ -1194,6 +1195,7 @@ "Vertically": "vertically", "Webcams": "Webcams", "WebrtcCameraStreamer": "WebRTC (camera-streamer)", + "WebrtcGo2rtc": "WebRTC (go2rtc)", "WebrtcJanus": "WebRTC (janus-gateway)", "WebrtcMediaMTX": "WebRTC (MediaMTX)" } diff --git a/src/store/gui/webcams/types.ts b/src/store/gui/webcams/types.ts index 50f03153b..a5566b62c 100644 --- a/src/store/gui/webcams/types.ts +++ b/src/store/gui/webcams/types.ts @@ -26,6 +26,7 @@ export interface GuiWebcamStateWebcam { rotation: number aspect_ratio?: string extra_data?: { + enableAudio?: boolean hideFps?: boolean } source?: 'config' | 'database'