No Description

AgoraConst.m 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. //
  2. // MyAgoraRtcEngineKit.m
  3. // RCTAgora
  4. //
  5. // Created by 邓博 on 2017/6/30.
  6. // Copyright © 2017年 Syan. All rights reserved.
  7. //
  8. #import "AgoraConst.h"
  9. @implementation AgoraConst
  10. static AgoraConst *_person;
  11. + (instancetype)allocWithZone:(struct _NSZone *)zone{
  12. static dispatch_once_t predicate;
  13. dispatch_once(&predicate, ^{
  14. _person = [super allocWithZone:zone];
  15. });
  16. return _person;
  17. }
  18. + (instancetype)share {
  19. static dispatch_once_t onceToken;
  20. dispatch_once(&onceToken, ^{
  21. _person = [[self alloc]init];
  22. });
  23. return _person;
  24. }
  25. + (NSArray<NSString*>*) supportEvents {
  26. NSArray<NSString*>* array = @[AGWarning,
  27. AGError,
  28. AGApiCallExecute,
  29. AGJoinChannelSuccess,
  30. AGRejoinChannelSuccess,
  31. AGLeaveChannel,
  32. AGClientRoleChanged,
  33. AGLocalUserRegistered,
  34. AGUserInfoUpdated,
  35. AGUserJoined,
  36. AGUserOffline,
  37. AGConnectionStateChanged,
  38. AGConnectionLost,
  39. AGTokenPrivilegeWillExpire,
  40. AGRequestToken,
  41. AGAudioVolumeIndication,
  42. AGActiveSpeaker,
  43. AGFirstLocalAudioFrame,
  44. AGFirstRemoteAudioFrame,
  45. AGFirstRemoteAudioDecoded,
  46. AGFirstLocalVideoFrame,
  47. AGFirstRemoteVideoFrame,
  48. AGUserMuteAudio,
  49. AGVideoSizeChanged,
  50. AGRemoteVideoStateChanged,
  51. AGLocalPublishFallbackToAudioOnly,
  52. AGRemoteSubscribeFallbackToAudioOnly,
  53. AGAudioRouteChanged,
  54. AGCameraFocusAreaChanged,
  55. AGCameraExposureAreaChanged,
  56. AGRtcStats,
  57. AGLastmileQuality,
  58. AGNetworkQuality,
  59. AGLocalVideoStats,
  60. AGRemoteVideoStats,
  61. AGRemoteAudioStats,
  62. AGLocalAudioStateChanged,
  63. AGRemoteAudioStateChanged,
  64. AGLocalAudioStats,
  65. AGMediaRelayStateChanged,
  66. AGReceivedChannelMediaRelay,
  67. AGAudioMixingStateChanged,
  68. AGRemoteAudioMixingStart,
  69. AGRemoteAudioMixingFinish,
  70. AGAudioEffectFinish,
  71. AGStreamPublished,
  72. AGStreamUnpublish,
  73. AGTranscodingUpdate,
  74. AGStreamInjectedStatus,
  75. AGReceiveStreamMessage,
  76. AGOccurStreamMessageError,
  77. AGMediaEngineLoaded,
  78. AGMediaEngineStartCall,
  79. AGIntervalTest,
  80. AGLastmileProbeTestResult,
  81. AGRtmpStreamingStateChanged,
  82. AGLocalVideoChanged,
  83. AGNetworkTypeChanged,
  84. AGFirstRemoteAudioFrame,
  85. AGMediaMetaDataReceived];
  86. NSMutableArray<NSString *> *eventList = [NSMutableArray arrayWithCapacity:[array count]];
  87. [array enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
  88. id mapObj = [NSString stringWithFormat:@"%@%@", AG_PREFIX, obj];
  89. [eventList addObject:mapObj];
  90. }];
  91. return eventList;
  92. }
  93. - (id)copyWithZone:(NSZone *)zone {
  94. return _person;
  95. }
  96. @end