From 74116d15daf8d807aaa953d02ee772fb5d50b8e9 Mon Sep 17 00:00:00 2001 From: Patrick Schmidt Date: Fri, 29 Dec 2023 16:00:25 +0100 Subject: [PATCH] Fixes #304 - Added Support for Go2Rtc --- common/lib/data/enums/webcam_service_type.dart | 4 +++- lib/ui/components/webcam/webcam.dart | 3 ++- lib/ui/components/webcam/webcam_webrtc.dart | 6 +++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/common/lib/data/enums/webcam_service_type.dart b/common/lib/data/enums/webcam_service_type.dart index 0006f289..c90ff4e9 100644 --- a/common/lib/data/enums/webcam_service_type.dart +++ b/common/lib/data/enums/webcam_service_type.dart @@ -19,7 +19,9 @@ enum WebcamServiceType { @JsonValue('ipstream') ipSream(false, false), @JsonValue('webrtc-camerastreamer') - webRtc(true, true), + webRtcCamStreamer(true, true), + @JsonValue('webrtc-go2rtc') + webRtcGo2Rtc(true, true), @JsonValue('unknown') unknown(false, false); diff --git a/lib/ui/components/webcam/webcam.dart b/lib/ui/components/webcam/webcam.dart index 1873139c..87858e68 100644 --- a/lib/ui/components/webcam/webcam.dart +++ b/lib/ui/components/webcam/webcam.dart @@ -98,7 +98,8 @@ class Webcam extends ConsumerWidget { stackChild: modifiedStack, ); - case WebcamServiceType.webRtc: + case WebcamServiceType.webRtcGo2Rtc: + case WebcamServiceType.webRtcCamStreamer: return WebcamWebRtc( machine: machine, webcamInfo: webcamInfo, diff --git a/lib/ui/components/webcam/webcam_webrtc.dart b/lib/ui/components/webcam/webcam_webrtc.dart index 98b7ff1a..81e3adec 100644 --- a/lib/ui/components/webcam/webcam_webrtc.dart +++ b/lib/ui/components/webcam/webcam_webrtc.dart @@ -3,6 +3,7 @@ * All rights reserved. */ +import 'package:common/data/enums/webcam_service_type.dart'; import 'package:common/data/model/hive/machine.dart'; import 'package:common/data/model/moonraker_db/webcam_info.dart'; import 'package:common/network/dio_provider.dart'; @@ -64,7 +65,9 @@ class WebcamWebRtc extends ConsumerWidget { } var remoteConfig = ref.watch(remoteConfigProvider); - if (clientType == ClientType.octo && remoteConfig.oeWebrtc) { + if (clientType == ClientType.octo && + remoteConfig.oeWebrtc && + webcamInfo.service == WebcamServiceType.webRtcCamStreamer) { return Text( 'components.web_rtc.oe_warning', style: Theme.of(context).textTheme.bodySmall, @@ -75,6 +78,7 @@ class WebcamWebRtc extends ConsumerWidget { key: ValueKey(webcamInfo.uuid + machine.uuid), camUri: webRtcUri, dio: dio, + service: webcamInfo.service, stackContent: stackContent, rotation: webcamInfo.rotation, transform: webcamInfo.transformMatrix,