matrixbirds 5 years ago
parent
commit
e788ca4f9b

BIN
ios/RCTAgora.xcodeproj/project.xcworkspace/xcuserdata/ly.xcuserdatad/UserInterfaceState.xcuserstate View File


+ 16
- 16
ios/RCTAgora/AgoraConst.h View File

@@ -42,7 +42,7 @@ static NSString *RemoteVideoStateChangedOfUid = @"onRemoteVideoStateChanged";
42 42
 static NSString *DidLocalPublishFallbackToAudioOnly = @"onLocalPublishFallbackToAudioOnly";
43 43
 static NSString *DidRemoteSubscribeFallbackToAudioOnly = @"onRemoteSubscribeFallbackToAudioOnly";
44 44
 
45
-static NSString *DeviceTypeStateChanged = @"DeviceTypeStateChanged";
45
+static NSString *DeviceTypeStateChanged = @"onDeviceTypeStateChanged";
46 46
 static NSString *DidAudioRouteChanged = @"onAudioRouteChanged";
47 47
 static NSString *CameraDidReady = @"onCameraReady";
48 48
 static NSString *CameraFocusDidChangedToRect = @"onCameraFocusAreaChanged";
@@ -57,26 +57,26 @@ static NSString *RemoteAudioStats = @"onRemoteAudioStats";
57 57
 static NSString *AudioTransportStatsOfUid = @"AudioTransportStatsOfUid";
58 58
 static NSString *VideoTransportStatsOfUid = @"VideoTransportStatsOfUid";
59 59
 
60
-static NSString *LocalAudioMixingDidFinish = @"LocalAudioMixingDidFinish";
61
-static NSString *RemoteAudioMixingDidStart = @"RemoteAudioMixingDidStart";
62
-static NSString *RemoteAudioMixingDidFinish = @"RemoteAudioMixingDidFinish";
63
-static NSString *DidAudioEffectFinish = @"DidAudioEffectFinish";
60
+static NSString *LocalAudioMixingDidFinish = @"onLocalAudioMixingFinish";
61
+static NSString *RemoteAudioMixingDidStart = @"onRemoteAudioMixingStart";
62
+static NSString *RemoteAudioMixingDidFinish = @"onRemoteAudioMixingFinish";
63
+static NSString *DidAudioEffectFinish = @"onAudioEffectFinish";
64 64
 
65
-static NSString *StreamPublished = @"StreamPublished";
66
-static NSString *StreamUnpublish = @"StreamUnpublish";
67
-static NSString *TranscodingUpdated = @"TranscodingUpdated";
65
+static NSString *StreamPublished = @"onStreamPublished";
66
+static NSString *StreamUnpublish = @"onStreamUnpublish";
67
+static NSString *TranscodingUpdated = @"onTranscodingUpdate";
68 68
 
69
-static NSString *StreamInjectedStatus = @"StreamInjectedStatus";
69
+static NSString *StreamInjectedStatus = @"onStreamInjectedStatus";
70 70
 
71
-static NSString *ReceiveStreamMessage = @"ReceiveStreamMessage";
72
-static NSString *DidOccurStreamMessageError = @"DidOccurStreamMessageError";
71
+static NSString *ReceiveStreamMessage = @"onReceiveStreamMessage";
72
+static NSString *DidOccurStreamMessageError = @"onOccurStreamMessageError";
73 73
 
74
-static NSString *MediaEngineDidLoaded = @"MediaEngineDidLoaded";
75
-static NSString *MediaEngineDidStartCall = @"MediaEngineDidStartCall";
74
+static NSString *MediaEngineDidLoaded = @"onMediaEngineLoaded";
75
+static NSString *MediaEngineDidStartCall = @"onMediaEngineStartCall";
76 76
 
77
-static NSString *ConnectionDidInterrupted = @"ConnectionDidInterrupted";
78
-static NSString *ConnectionDidBanned = @"ConnectionDidBanned";
79
-static NSString *AudioQualityOfUid = @"AudioQualityOfUid";
77
+static NSString *ConnectionDidInterrupted = @"onConnectionInterrupted";
78
+static NSString *ConnectionDidBanned = @"onConnectionBanned";
79
+static NSString *AudioQualityOfUid = @"onAudioQuality";
80 80
 
81 81
 @interface AgoraConst : NSObject
82 82
 

+ 32
- 2
ios/RCTAgora/RCTAgora.m View File

@@ -74,6 +74,33 @@ RCT_EXPORT_MODULE();
74 74
            @"Connected": @(AgoraConnectionStateConnected),
75 75
            @"Reconnecting": @(AgoraConnectionStateReconnecting),
76 76
            @"ConnectionFailed": @(AgoraConnectionStateFailed),
77
+           @"ConnectionChangedConnecting": @(AgoraConnectionChangedConnecting),
78
+           @"ConnectionChangedJoinSuccess": @(AgoraConnectionChangedJoinSuccess),
79
+           @"ConnectionChangedInterrupted": @(AgoraConnectionChangedInterrupted),
80
+           @"ConnectionChangedBannedByServer": @(AgoraConnectionChangedBannedByServer),
81
+           @"ConnectionChangedJoinFailed": @(AgoraConnectionChangedJoinFailed),
82
+           @"ConnectionChangedLeaveChannel": @(AgoraConnectionChangedLeaveChannel),
83
+           @"AudioOutputRoutingDefault": @(AgoraAudioOutputRoutingDefault),
84
+           @"AudioOutputRoutingHeadset": @(AgoraAudioOutputRoutingHeadset),
85
+           @"AudioOutputRoutingEarpiece": @(AgoraAudioOutputRoutingEarpiece),
86
+           @"AudioOutputRoutingHeadsetNoMic": @(AgoraAudioOutputRoutingHeadsetNoMic),
87
+           @"AudioOutputRoutingSpeakerphone": @(AgoraAudioOutputRoutingSpeakerphone),
88
+           @"AudioOutputRoutingLoudspeaker": @(AgoraAudioOutputRoutingLoudspeaker),
89
+           @"AudioOutputRoutingHeadsetBluetooth": @(AgoraAudioOutputRoutingHeadsetBluetooth),
90
+           @"NetworkQualityUnknown": @(AgoraNetworkQualityUnknown),
91
+           @"NetworkQualityExcellent": @(AgoraNetworkQualityExcellent),
92
+           @"NetworkQualityGood": @(AgoraNetworkQualityGood),
93
+           @"NetworkQualityPoor": @(AgoraNetworkQualityPoor),
94
+           @"NetworkQualityBad": @(AgoraNetworkQualityBad),
95
+           @"NetworkQualityVBad": @(AgoraNetworkQualityVBad),
96
+           @"NetworkQualityDown": @(AgoraNetworkQualityDown),
97
+           @"ErrorCodeNoError": @(AgoraErrorCodeNoError),
98
+           @"ErrorCodeFailed": @(AgoraErrorCodeFailed),
99
+           @"ErrorCodeInvalidArgument": @(AgoraErrorCodeInvalidArgument),
100
+           @"ErrorCodeTimedOut": @(AgoraErrorCodeTimedOut),
101
+           @"ErrorCodeAlreadyInUse": @(AgoraErrorCodeAlreadyInUse),
102
+           @"ErrorCodeAbort": @(AgoraErrorCodeAbort),
103
+           @"ErrorCodeResourceLimited": @(AgoraErrorCodeResourceLimited),
77 104
            @"AudioProfileDefault": @(AgoraAudioProfileDefault),
78 105
            @"AudioProfileSpeechStandard": @(AgoraAudioProfileSpeechStandard),
79 106
            @"AudioProfileMusicStandard": @(AgoraAudioProfileMusicStandard),
@@ -107,7 +134,10 @@ RCT_EXPORT_MODULE();
107 134
            @"AgoraVideoMirrorModeAuto": @(AgoraVideoMirrorModeAuto),
108 135
            @"AgoraVideoMirrorModeEnabled": @(AgoraVideoMirrorModeEnabled),
109 136
            @"AgoraVideoMirrorModeDisabled": @(AgoraVideoMirrorModeDisabled),
110
-           };
137
+           @"AgoraChannelProfileCommunication": @(AgoraChannelProfileCommunication),
138
+           @"AgoraChannelProfileLiveBroadcasting": @(AgoraChannelProfileLiveBroadcasting),
139
+           @"AgoraChannelProfileGame": @(AgoraChannelProfileGame)
140
+         };
111 141
 }
112 142
 
113 143
 // init
@@ -133,7 +163,7 @@ RCT_EXPORT_METHOD(init:(NSDictionary *)options) {
133 163
     }
134 164
   }
135 165
   
136
-  AgoraVideoEncoderConfiguration *video_encoder_config = [[AgoraVideoEncoderConfiguration new] initWithWidth:[options[@"videoEncoderConfig.width"] integerValue] height:[options[@"videoEncoderConfig.height"] integerValue] frameRate:(AgoraVideoFrameRate)[options[@"videoEncoderConfig.frameRate"] integerValue] bitrate:[options[@"videoEncoderConfig.bitrate"] integerValue] orientationMode: (AgoraVideoOutputOrientationMode)[options[@"videoEncoderCnofig.orientationMode"] integerValue]];
166
+  AgoraVideoEncoderConfiguration *video_encoder_config = [[AgoraVideoEncoderConfiguration new] initWithWidth:[options[@"videoEncoderConfig"][@"width"] integerValue] height:[options[@"videoEncoderConfig"][@"height"] integerValue] frameRate:(AgoraVideoFrameRate)[options[@"videoEncoderConfig"][@"frameRate"] integerValue] bitrate:[options[@"videoEncoderConfig"][@"bitrate"] integerValue] orientationMode: (AgoraVideoOutputOrientationMode)[options[@"videoEncoderConfig"][@"orientationMode"] integerValue]];
137 167
   [self.rtcEngine setVideoEncoderConfiguration:video_encoder_config];
138 168
   [self.rtcEngine setClientRole:(AgoraClientRole)[options[@"clientRole"] integerValue]];
139 169
   [self.rtcEngine setAudioProfile:(AgoraAudioProfile)[options[@"audioProfile"] integerValue]