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

add setAllParticipantsVolume method on Ios side #291

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
}