TXRTCService.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. //
  2. // TXRTCService.h
  3. // StudentDaya
  4. //
  5. // Created by 王智 on 2023/4/18.
  6. // Copyright © 2023 DayaMusic. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "TXLiteAVSDK_Professional/TXLiteAVSDK.h"
  10. #import "TxRTCRoomConfig.h"
  11. #define TRTC_MANAGER ([TXRTCService shareInstance])
  12. typedef void(^KSRTCCallback)(NSInteger code);
  13. @protocol TXRTCServiceDelegate <NSObject>
  14. - (void)didReportNetworkQuality:(TRTCQuality)quality remoteQuality:(NSArray<TRTCQualityInfo *> *_Nullable)remoteQuality;
  15. - (void)didReportUserVolume:(NSArray<TRTCVolumeInfo *> *_Nullable)userVolumes;
  16. @end
  17. NS_ASSUME_NONNULL_BEGIN
  18. @interface TXRTCService : NSObject
  19. @property (nonatomic, assign) NSInteger ANS;
  20. @property (nonatomic, assign) NSInteger AEC;
  21. @property (nonatomic, assign) NSInteger AGC;
  22. @property (nonatomic, weak) id <TXRTCServiceDelegate> delegate;
  23. + (instancetype)shareInstance;
  24. // 刷新publish重力感应模式
  25. - (void)refreshGSMode;
  26. - (void)setting3AParmWithANS:(NSInteger)ANS AEC:(NSInteger)AEC AGC:(NSInteger)AGC;
  27. - (void)config3AWithANS:(NSInteger)ANS AEC:(NSInteger)AEC AGC:(NSInteger)AGC;
  28. - (void)configWithRoomConfig:(TxRTCRoomConfig *)roomConfig successCallback:(void(^)(void))callback;
  29. - (void)joinRTCRoom:(NSString *)roomId success:(KSRTCCallback)success failer:(KSRTCCallback)error;
  30. - (void)leaveRoom:(KSRTCCallback)callback;
  31. - (void)publishStream;
  32. - (void)renderLocalUserInView:(UIView *)displayView isCameraEnable:(BOOL)cameraEnable;
  33. - (void)renderRemoteUser:(NSString *)userId inView:(UIView *)displayView;
  34. - (void)cancleRenderUserVideo:(NSString *)userId;
  35. #pragma mark ---- 不播放音频流
  36. - (void)unPlayRemoteStudentAudioStream;
  37. - (void)playAllRemoteStudentAudioStream;
  38. - (void)unPlayRemoteStudentWithId:(NSString *)studentId;
  39. #pragma mark - 顶部工具栏接口
  40. /**
  41. 关闭/打开麦克风
  42. @param disable YES 关闭,NO 打开
  43. */
  44. - (void)setMicrophoneDisable:(BOOL)disable;
  45. /**
  46. 采集运行中关闭或打开摄像头
  47. @param disable YES 关闭,否则打开
  48. */
  49. - (void)setCameraDisable:(BOOL)disable;
  50. /**
  51. 切换前后摄像头
  52. */
  53. - (void)switchCamera;
  54. /**
  55. 切换使用外放/听筒
  56. */
  57. - (void)useSpeaker:(BOOL)useSpeaker;
  58. - (UIImage *)generalCloseImage;
  59. @end
  60. NS_ASSUME_NONNULL_END