diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 39097043..a0714cb8 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -333,9 +333,9 @@ PODS: - React-jsinspector (0.71.3) - React-logger (0.71.3): - glog - - react-native-comms-sdk (3.10.0): + - react-native-comms-sdk (3.10.1): - React-Core - - VoxeetSDK (~> 3.10.1) + - VoxeetSDK (~> 3.11.0) - react-native-document-picker (7.1.3): - React-Core - react-native-safe-area-context (3.4.1): @@ -457,8 +457,8 @@ PODS: - React-RCTText - ReactCommon/turbomodule/core - Yoga - - SocketRocket (0.6.0) - - VoxeetSDK (3.10.1) + - SocketRocket (0.6.1) + - VoxeetSDK (3.11.0) - Yoga (1.14.0) - YogaKit (1.18.1): - Yoga (~> 1.14) @@ -676,7 +676,7 @@ SPEC CHECKSUMS: React-jsiexecutor: 515b703d23ffadeac7687bc2d12fb08b90f0aaa1 React-jsinspector: 9f7c9137605e72ca0343db4cea88006cb94856dd React-logger: 957e5dc96d9dbffc6e0f15e0ee4d2b42829ff207 - react-native-comms-sdk: ce52cf67ff732bc3166459f26462c5bed4ffed2e + react-native-comms-sdk: c26debe23427f633d02d573d2dde97ecc281743d react-native-document-picker: ec07866a30707f23660c0f3ae591d669d3e89096 react-native-safe-area-context: 9e40fb181dac02619414ba1294d6c2a807056ab9 React-perflogger: af8a3d31546077f42d729b949925cc4549f14def @@ -696,8 +696,8 @@ SPEC CHECKSUMS: RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211 RNPermissions: 314155ed6ce65237e7bd9fb6239219cce83228d3 RNReanimated: cc5e3aa479cb9170bcccf8204291a6950a3be128 - SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608 - VoxeetSDK: bc2f2566624c2ad13dfb0fa4498020e7c15e85fa + SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 + VoxeetSDK: 04a92e5ff875404191f93de89557cf8250b81f7e Yoga: 5ed1699acbba8863755998a4245daa200ff3817b YogaKit: f782866e155069a2cca2517aafea43200b01fd5a diff --git a/ios/Services/AudioService/RNRemoteAudioServiceModuleBridge.m b/ios/Services/AudioService/RNRemoteAudioServiceModuleBridge.m index 6b09c2bd..18ed87f8 100644 --- a/ios/Services/AudioService/RNRemoteAudioServiceModuleBridge.m +++ b/ios/Services/AudioService/RNRemoteAudioServiceModuleBridge.m @@ -11,4 +11,9 @@ @interface RCT_EXTERN_REMAP_MODULE(CommsAPIRemoteAudioModule, RNRemoteAudioServi resolver:(RCTPromiseResolveBlock _Nonnull)resolve rejecter:(RCTPromiseRejectBlock _Nonnull)reject); +RCT_EXTERN_METHOD(setVolume:(NSDictionary * _Nonnull)participant + volume:(NSNumber * _Nonnull)volume + resolver:(RCTPromiseResolveBlock _Nonnull)resolve + rejecter:(RCTPromiseRejectBlock _Nonnull)reject); + @end diff --git a/ios/Services/AudioService/RemoteAudioServiceModule.swift b/ios/Services/AudioService/RemoteAudioServiceModule.swift index 76c5addb..e64942b9 100644 --- a/ios/Services/AudioService/RemoteAudioServiceModule.swift +++ b/ios/Services/AudioService/RemoteAudioServiceModule.swift @@ -55,4 +55,25 @@ public class RemoteAudioServiceModule: NSObject { error.send(with: reject) } } + + /// Sets the volume of a selected participant in non-Dolby Voice conferences to a preferred value between 0 and 1. + /// - Parameters: + /// - participant: The selected remote participant who should be locally muted. + /// - volume: The preferred volume level between 0 (no audio) and 1 (full volume). + /// - resolve: returns on success + /// - reject: returns error on failure + @objc(setVolume:volume:resolver:rejecter:) + public func setVolume( + participant: [String: Any], + volume: Float, + resolve: @escaping RCTPromiseResolveBlock, + reject: @escaping RCTPromiseRejectBlock + ) { + guard let participantObject = VoxeetSDK.shared.conference.current?.findParticipant(with: participant.identifier) else { + ModuleError.noParticipant(participant.description).send(with: reject) + return + } + let result = VoxeetSDK.shared.audio.remote.setVolume(participant: participantObject, volume: volume) + resolve(result) + } } diff --git a/react-native-comms-sdk.podspec b/react-native-comms-sdk.podspec index e661fa26..dc1e7acf 100644 --- a/react-native-comms-sdk.podspec +++ b/react-native-comms-sdk.podspec @@ -16,5 +16,5 @@ Pod::Spec.new do |s| s.source_files = "ios/**/*.{h,m,mm,swift}" s.dependency "React-Core" - s.dependency "VoxeetSDK", '~> 3.10.1' + s.dependency "VoxeetSDK", '~> 3.11.0' end