Skip to content

Commit

Permalink
Fixes #304 - Added Support for Go2Rtc
Browse files Browse the repository at this point in the history
  • Loading branch information
Clon1998 committed Dec 29, 2023
1 parent 1437e51 commit 74116d1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion common/lib/data/enums/webcam_service_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
3 changes: 2 additions & 1 deletion lib/ui/components/webcam/webcam.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion lib/ui/components/webcam/webcam_webrtc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 74116d1

Please sign in to comment.