No Description

AgoraConst.m 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. AGUserJoined,
  34. AGUserOffline,
  35. AGConnectionStateChanged,
  36. AGConnectionLost,
  37. AGTokenPrivilegeWillExpire,
  38. AGRequestToken,
  39. AGMicrophoneEnabled,
  40. AGAudioVolumeIndication,
  41. AGActiveSpeaker,
  42. AGFirstLocalAudioFrame,
  43. AGFirstRemoteAudioFrame,
  44. AGFirstRemoteAudioDecoded,
  45. AGVideoStopped,
  46. AGFirstLocalVideoFrame,
  47. AGFirstRemoteVideoDecoded,
  48. AGFirstRemoteVideoFrame,
  49. AGUserMuteAudio,
  50. AGUserMuteVideo,
  51. AGUserEnableVideo,
  52. AGUserEnableLocalVideo,
  53. AGVideoSizeChanged,
  54. AGRemoteVideoStateChanged,
  55. AGLocalPublishFallbackToAudioOnly,
  56. AGRemoteSubscribeFallbackToAudioOnly,
  57. AGAudioRouteChanged,
  58. AGCameraReady,
  59. AGCameraFocusAreaChanged,
  60. AGCameraExposureAreaChanged,
  61. AGRtcStats,
  62. AGLastmileQuality,
  63. AGNetworkQuality,
  64. AGLocalVideoStats,
  65. AGRemoteVideoStats,
  66. AGRemoteAudioStats,
  67. AGAudioTransportStatsOfUid,
  68. AGVideoTransportStatsOfUid,
  69. AGAudioMixingStateChanged,
  70. AGRemoteAudioMixingStart,
  71. AGRemoteAudioMixingFinish,
  72. AGAudioEffectFinish,
  73. AGStreamPublished,
  74. AGStreamUnpublish,
  75. AGTranscodingUpdate,
  76. AGStreamInjectedStatus,
  77. AGReceiveStreamMessage,
  78. AGOccurStreamMessageError,
  79. AGMediaEngineLoaded,
  80. AGMediaEngineStartCall,
  81. AGIntervalTest,
  82. AGLastmileProbeTestResult,
  83. AGRtmpStreamingStateChanged,
  84. AGLocalVideoChanged,
  85. AGNetworkTypeChanged,
  86. AGFirstRemoteAudioFrame,
  87. AGMediaMetaDataReceived];
  88. NSMutableArray<NSString *> *eventList = [NSMutableArray arrayWithCapacity:[array count]];
  89. [array enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
  90. id mapObj = [NSString stringWithFormat:@"%@%@", AG_PREFIX, obj];
  91. [eventList addObject:mapObj];
  92. }];
  93. return eventList;
  94. }
  95. - (id)copyWithZone:(NSZone *)zone {
  96. return _person;
  97. }
  98. @end