Files
yinmeng-ios/xplan-ios/Main/RTC/RtcManager.h

139 lines
3.4 KiB
C
Raw Normal View History

//
// RTCManager.h
// xplan-ios
//
// Created by zu on 2021/10/19.
//
#import <Foundation/Foundation.h>
#import "RtcDelegate.h"
NS_ASSUME_NONNULL_BEGIN
typedef enum : NSUInteger {
RtcEngineType_Agora = 1001, // 声网
2021-12-06 20:43:58 +08:00
RtcEngineType_Zego, // 即构
RtcEngineType_WJ, // 无界
RtcEngineType_AgoraFast, // 声网急速
2021-12-06 20:43:58 +08:00
RtcEngineType_TRTC, // 腾讯TRTC
} RtcEngineType;
2022-05-09 22:18:42 +08:00
typedef NS_ENUM(NSInteger, BackMusicPlayState) {
///停止
BackMusicPlayState_Stop = 1,
///暂停
BackMusicPlayState_Pause,
///重新播放
BackMusicPlayState_Resume
};
/** 音频服务管理单例,对所有音频服务 SDK 的封装。
**Note:**
2021-11-01 18:25:13 +08:00
- RtcManager
- RtcManager
- RctImpl
*/
2021-10-20 14:21:57 +08:00
@interface RtcManager : NSObject
2021-10-20 17:06:31 +08:00
/**
*
* YES🔇🙉
* NO🔊🐵
*/
@property(nonatomic,getter=isRemoteMuted) BOOL remoteMuted;
/**
*
* YES🤐🙊
* NO😲🐵
*/
@property(nonatomic,getter=isLocalMuted) BOOL localMuted;
2021-10-20 17:06:31 +08:00
/** 初始化/重新初始化 RtcManager 实例,设置音频服务类型和 RtcDelegate。
**Note:**
- delegate
- RtcManager [RtcManager instance] RtcManager
@param type 使 RtcEngineType
@param delegate RtcDelegate
@return - RtcManager instance
2021-10-19 19:29:25 +08:00
*/
2021-10-20 17:06:31 +08:00
+ (instancetype _Nonnull)initEngineWithType:(RtcEngineType)type
delegate:(id<RtcDelegate> _Nullable)delegate;
/** 获取 RtcManager instance。
**Note:**
- [RtcManager initEngineWithType:delegate:] RtcEngineType RtcDelegate使
@return - RtcManager instance
2021-10-19 19:29:25 +08:00
*/
2021-10-20 14:21:57 +08:00
+ (instancetype _Nonnull)instance;
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
- (id)copy NS_UNAVAILABLE;
- (id)mutableCopy NS_UNAVAILABLE;
/** 加入频道(房间)。
**Note:**
- return YES
@return -
2021-11-01 18:25:13 +08:00
*/
- (BOOL)enterRoom:(NSString *)roomUid;
2021-10-20 17:06:31 +08:00
/** 加入频道房间TRTC 进房需要动态签名。
**Note:**
- return YES
@return -
2021-12-06 20:43:58 +08:00
*/
- (BOOL)enterRoom:(NSString *)roomUid trtcSign:(NSString *)sign;
2021-11-01 18:25:13 +08:00
/**
*
*/
2022-05-12 01:08:52 +08:00
- (void)broadcast:(BOOL)on;
2021-10-20 17:06:31 +08:00
2021-11-01 18:25:13 +08:00
/**
* 退
*/
- (void)exitRoom;
2021-10-20 17:06:31 +08:00
///发起跨房PK
- (void)connectOtherRoom:(NSString *)roomUid userId:(NSString *)uid;
///退出跨房通话
- (void)disconnectOtherRoom;
/// 静音某个人
/// @param userId 用户id
- (void)muteOne:(BOOL)mute userId:(NSString *)userId;
2022-05-09 22:18:42 +08:00
/// 播放背景音乐
/// @param filePath 音频文件的地址
/// @param musicId TRTC自己要的
- (BOOL)playBackMusic:(NSString *)filePath musicId:(int)musicId completion:(void (^)(NSString *))completion;
2022-05-09 22:18:42 +08:00
/// 改变播放器的状态
/// @param state 播放状态
- (BOOL)changePlayState:(BackMusicPlayState)state;
///背景音乐的音量大小
- (void)updateMusicSound:(int)soundVol;
///背景人声的音量大小
- (void)updateUserSound:(int)soundVol;
@end
NS_ASSUME_NONNULL_END