Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
add setAllParticipantsVolume method on Ios side (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbetl-dlb authored Sep 12, 2023
1 parent 4b3bc16 commit c593cb0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ios/Services/AudioService/RNRemoteAudioServiceModuleBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ @interface RCT_EXTERN_REMAP_MODULE(CommsAPIRemoteAudioModule, RNRemoteAudioServi
rejecter:(RCTPromiseRejectBlock _Nonnull)reject);

RCT_EXTERN_METHOD(setParticipantVolume:(NSDictionary * _Nonnull)participant
volume:(NSNumber * _Nonnull)volume
volume:(float)volume
resolver:(RCTPromiseResolveBlock _Nonnull)resolve
rejecter:(RCTPromiseRejectBlock _Nonnull)reject);

RCT_EXTERN_METHOD(setAllParticipantsVolume:(float)volume
resolver:(RCTPromiseResolveBlock _Nonnull)resolve
rejecter:(RCTPromiseRejectBlock _Nonnull)reject);

Expand Down
15 changes: 15 additions & 0 deletions ios/Services/AudioService/RemoteAudioServiceModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,19 @@ public class RemoteAudioServiceModule: NSObject {
let result = VoxeetSDK.shared.audio.remote.setVolume(participant: participantObject, volume: volume)
resolve(result)
}

/// Sets the volume for all participants in non-Dolby Voice conferences to a preferred value between 0 and 1.
/// - Parameters:
/// - volume: The preferred volume level between 0 (no audio) and 1 (full volume).
/// - resolve: returns on success
/// - reject: returns error on failure
@objc(setAllParticipantsVolume:resolver:rejecter:)
public func setAllParticipantVolume(
volume: Float,
resolve: @escaping RCTPromiseResolveBlock,
reject: @escaping RCTPromiseRejectBlock
) {
let result = VoxeetSDK.shared.audio.remote.setOutputVolume(volume)
resolve(result)
}
}

0 comments on commit c593cb0

Please sign in to comment.