Skip to content

Commit

Permalink
Resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Decoder07 committed Aug 26, 2024
1 parent 82d944c commit cd12093
Show file tree
Hide file tree
Showing 9 changed files with 187 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ library;
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:hms_room_kit/src/widgets/common_widgets/hms_cross_button.dart';
import 'package:hmssdk_flutter/hmssdk_flutter.dart';
import 'package:provider/provider.dart';

///Project imports
Expand Down Expand Up @@ -51,7 +52,7 @@ class _LocalPeerBottomSheetState extends State<LocalPeerBottomSheet> {
@override
Widget build(BuildContext context) {
return FractionallySizedBox(
heightFactor: widget.isInsetTile ? 0.26 : 0.2,
heightFactor: widget.isInsetTile ? 0.46 : 0.4,
child: Padding(
padding: const EdgeInsets.only(top: 16.0, left: 24, right: 24),
child: Column(
Expand Down Expand Up @@ -228,6 +229,44 @@ class _LocalPeerBottomSheetState extends State<LocalPeerBottomSheet> {
widget.meetingStore.peerTracks.length > 1
? HMSThemeColors.onSurfaceHighEmphasis
: HMSThemeColors.onSurfaceLowEmphasis)),
ListTile(
horizontalTitleGap: 2,
onTap: () async {
Navigator.pop(context);
HMSCameraControls.setZoom(zoomValue: 2);
},
contentPadding: EdgeInsets.zero,
leading: SvgPicture.asset(
"packages/hms_room_kit/lib/src/assets/icons/maximize.svg",
semanticsLabel: "fl_local_pin_tile",
height: 20,
width: 20,
colorFilter: ColorFilter.mode(
HMSThemeColors.onSurfaceHighEmphasis,
BlendMode.srcIn),
),
title: HMSSubheadingText(
text: "Zoom In (2x)",
textColor: HMSThemeColors.onSurfaceHighEmphasis)),
ListTile(
horizontalTitleGap: 2,
onTap: () async {
Navigator.pop(context);
HMSCameraControls.resetZoom();
},
contentPadding: EdgeInsets.zero,
leading: SvgPicture.asset(
"packages/hms_room_kit/lib/src/assets/icons/minimize.svg",
semanticsLabel: "fl_local_pin_tile",
height: 20,
width: 20,
colorFilter: ColorFilter.mode(
HMSThemeColors.onSurfaceHighEmphasis,
BlendMode.srcIn),
),
title: HMSSubheadingText(
text: "Reset zoom",
textColor: HMSThemeColors.onSurfaceHighEmphasis)),
],
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,13 @@ class HMSCameraControlsAction {
result: Result,
hmssdk: HMSSDK
){
val zoomValue = call.argument<Float>("zoom_value")
val zoomValue = call.argument<Double>("zoom_value")
zoomValue?.let { _zoomValue ->
hmssdk.getLocalPeer()?.let { localPeer ->
localPeer.videoTrack?.let { localVideoTrack ->
localVideoTrack.getCameraControl()?.setZoom(_zoomValue) ?: run {
result.success(HMSResultExtension.toDictionary(false, HMSExceptionExtension.getError("cameraControl is null")))
return
}
localVideoTrack.getCameraControl()?.setZoom(
_zoomValue.toFloat()
)
} ?: run {
result.success(HMSResultExtension.toDictionary(false, HMSExceptionExtension.getError("local video track is null")))
return
Expand All @@ -232,6 +231,9 @@ class HMSCameraControlsAction {
result.success(HMSResultExtension.toDictionary(false, HMSExceptionExtension.getError("local peer is null")))
return
}
}?:run{
HMSErrorLogger.returnArgumentsError("zoom value parameter is null in setZoom method")
return
}
}

Expand All @@ -241,10 +243,7 @@ class HMSCameraControlsAction {
){
hmssdk.getLocalPeer()?.let { localPeer ->
localPeer.videoTrack?.let { localVideoTrack ->
localVideoTrack.getCameraControl()?.let { cameraControl ->
result.success(HMSResultExtension.toDictionary(true, cameraControl.resetZoom()))
return
} ?: run {
localVideoTrack.getCameraControl()?.resetZoom() ?: run {
result.success(HMSResultExtension.toDictionary(false, HMSExceptionExtension.getError("cameraControl is null")))
return
}
Expand Down
2 changes: 1 addition & 1 deletion packages/hmssdk_flutter/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ SPEC CHECKSUMS:
FirebaseRemoteConfigInterop: 6efda51fb5e2f15b16585197e26eaa09574e8a4d
FirebaseSessions: dbd14adac65ce996228652c1fc3a3f576bdf3ecc
FirebaseSharedSwift: 20530f495084b8d840f78a100d8c5ee613375f6e
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_foreground_task: 21ef182ab0a29a3005cc72cd70e5f45cb7f7f817
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
GoogleMLKit: 2bd0dc6253c4d4f227aad460f69215a504b2980e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1340;
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = 100ms;
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
68 changes: 46 additions & 22 deletions packages/hmssdk_flutter/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev"
source: hosted
version: "1.17.2"
version: "1.18.0"
cross_file:
dependency: transitive
description:
Expand Down Expand Up @@ -439,6 +439,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.6.7"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
url: "https://pub.dev"
source: hosted
version: "10.0.4"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
linkify:
dependency: transitive
description:
Expand All @@ -459,26 +483,26 @@ packages:
dependency: transitive
description:
name: matcher
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.dev"
source: hosted
version: "0.12.16"
version: "0.12.16+1"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev"
source: hosted
version: "0.5.0"
version: "0.8.0"
meta:
dependency: transitive
description:
name: meta
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.12.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -523,10 +547,10 @@ packages:
dependency: transitive
description:
name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
source: hosted
version: "1.8.3"
version: "1.9.0"
path_parsing:
dependency: transitive
description:
Expand Down Expand Up @@ -784,18 +808,18 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.11.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
string_scanner:
dependency: transitive
description:
Expand All @@ -816,10 +840,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
url: "https://pub.dev"
source: hosted
version: "0.6.0"
version: "0.7.0"
tuple:
dependency: transitive
description:
Expand Down Expand Up @@ -948,14 +972,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.4.0+2"
web:
vm_service:
dependency: transitive
description:
name: web
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
name: vm_service
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
url: "https://pub.dev"
source: hosted
version: "0.1.4-beta"
version: "14.2.1"
webview_flutter:
dependency: transitive
description:
Expand Down Expand Up @@ -1013,5 +1037,5 @@ packages:
source: hosted
version: "6.3.0"
sdks:
dart: ">=3.1.0 <4.0.0"
flutter: ">=3.13.0"
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,15 @@ class HMSCameraControlsAction {

case "toggle_flash":
toggleFlash(result, hmsSDK)

case "set_zoom":
setZoom(call, result, hmsSDK)

case "reset_zoom":
resetZoom(result, hmsSDK)

// these method calls return FlutterMethodNotImplemented to indicate that the requested functionality is not yet implemented.
case "is_tap_to_focus_supported", "is_zoom_supported":
case "is_tap_to_focus_supported", "is_zoom_supported", "get_max_zoom", "get_min_zoom":
result(FlutterMethodNotImplemented)

// If the method call does not match any of the above cases, also return FlutterMethodNotImplemented.
Expand Down Expand Up @@ -170,4 +176,51 @@ class HMSCameraControlsAction {
formatter.timeStyle = .medium
return formatter.string(from: Date())
}

static private func setZoom(_ call: FlutterMethodCall, _ result: @escaping FlutterResult, _ hmsSDK: HMSSDK?){
guard let localPeer = hmsSDK?.localPeer else {
result(HMSResultExtension.toDictionary(false, HMSErrorExtension.getError("\(#function) An instance of Local Peer could not be found. Please check if a Room is joined.")))
return
}

guard let localVideoTrack = localPeer.localVideoTrack()
else {
result(HMSResultExtension.toDictionary(false, HMSErrorExtension.getError("\(#function) Video Track of Local Peer could not be found. Please check if the Local Peer has permission to publish video & video is unmuted currently.")))
return
}

let arguments = call.arguments as? [AnyHashable: Any]

guard let zoomValue = arguments?["zoom_value"] as? CGFloat
else{
HMSErrorLogger.returnArgumentsError("zoom value can't be empty")
return
}

localVideoTrack.modifyCaptureDevice { device in

guard let device = device else { return }

device.videoZoomFactor = zoomValue
}
}

static private func resetZoom(_ result: @escaping FlutterResult, _ hmsSDK: HMSSDK?){
guard let localPeer = hmsSDK?.localPeer else {
result(HMSResultExtension.toDictionary(false, HMSErrorExtension.getError("\(#function) An instance of Local Peer could not be found. Please check if a Room is joined.")))
return
}

guard let localVideoTrack = localPeer.localVideoTrack()
else {
result(HMSResultExtension.toDictionary(false, HMSErrorExtension.getError("\(#function) Video Track of Local Peer could not be found. Please check if the Local Peer has permission to publish video & video is unmuted currently.")))
return
}

localVideoTrack.modifyCaptureDevice { device in

guard let device = device else { return }
device.videoZoomFactor = 1.0
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public class SwiftHmssdkFlutterPlugin: NSObject, FlutterPlugin, HMSUpdateListene

// MARK: - Advanced Camera Controls

case "capture_image_at_max_supported_resolution", "is_tap_to_focus_supported", "is_zoom_supported", "is_flash_supported", "toggle_flash":
case "capture_image_at_max_supported_resolution", "is_tap_to_focus_supported", "is_zoom_supported", "is_flash_supported", "toggle_flash", "set_zoom", "reset_zoom", "get_max_zoom", "get_min_zoom":
HMSCameraControlsAction.cameraControlsAction(call, result, hmsSDK)

// MARK: - Session Store
Expand Down
Loading

0 comments on commit cd12093

Please sign in to comment.