Skip to content

Commit

Permalink
fix. ios
Browse files Browse the repository at this point in the history
  • Loading branch information
Matrixbirds committed Feb 12, 2019
1 parent 9a66481 commit eb9e132
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 18 deletions.
Binary file not shown.
32 changes: 16 additions & 16 deletions ios/RCTAgora/AgoraConst.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static NSString *RemoteVideoStateChangedOfUid = @"onRemoteVideoStateChanged";
static NSString *DidLocalPublishFallbackToAudioOnly = @"onLocalPublishFallbackToAudioOnly";
static NSString *DidRemoteSubscribeFallbackToAudioOnly = @"onRemoteSubscribeFallbackToAudioOnly";

static NSString *DeviceTypeStateChanged = @"DeviceTypeStateChanged";
static NSString *DeviceTypeStateChanged = @"onDeviceTypeStateChanged";
static NSString *DidAudioRouteChanged = @"onAudioRouteChanged";
static NSString *CameraDidReady = @"onCameraReady";
static NSString *CameraFocusDidChangedToRect = @"onCameraFocusAreaChanged";
Expand All @@ -57,26 +57,26 @@ static NSString *RemoteAudioStats = @"onRemoteAudioStats";
static NSString *AudioTransportStatsOfUid = @"AudioTransportStatsOfUid";
static NSString *VideoTransportStatsOfUid = @"VideoTransportStatsOfUid";

static NSString *LocalAudioMixingDidFinish = @"LocalAudioMixingDidFinish";
static NSString *RemoteAudioMixingDidStart = @"RemoteAudioMixingDidStart";
static NSString *RemoteAudioMixingDidFinish = @"RemoteAudioMixingDidFinish";
static NSString *DidAudioEffectFinish = @"DidAudioEffectFinish";
static NSString *LocalAudioMixingDidFinish = @"onLocalAudioMixingFinish";
static NSString *RemoteAudioMixingDidStart = @"onRemoteAudioMixingStart";
static NSString *RemoteAudioMixingDidFinish = @"onRemoteAudioMixingFinish";
static NSString *DidAudioEffectFinish = @"onAudioEffectFinish";

static NSString *StreamPublished = @"StreamPublished";
static NSString *StreamUnpublish = @"StreamUnpublish";
static NSString *TranscodingUpdated = @"TranscodingUpdated";
static NSString *StreamPublished = @"onStreamPublished";
static NSString *StreamUnpublish = @"onStreamUnpublish";
static NSString *TranscodingUpdated = @"onTranscodingUpdate";

static NSString *StreamInjectedStatus = @"StreamInjectedStatus";
static NSString *StreamInjectedStatus = @"onStreamInjectedStatus";

static NSString *ReceiveStreamMessage = @"ReceiveStreamMessage";
static NSString *DidOccurStreamMessageError = @"DidOccurStreamMessageError";
static NSString *ReceiveStreamMessage = @"onReceiveStreamMessage";
static NSString *DidOccurStreamMessageError = @"onOccurStreamMessageError";

static NSString *MediaEngineDidLoaded = @"MediaEngineDidLoaded";
static NSString *MediaEngineDidStartCall = @"MediaEngineDidStartCall";
static NSString *MediaEngineDidLoaded = @"onMediaEngineLoaded";
static NSString *MediaEngineDidStartCall = @"onMediaEngineStartCall";

static NSString *ConnectionDidInterrupted = @"ConnectionDidInterrupted";
static NSString *ConnectionDidBanned = @"ConnectionDidBanned";
static NSString *AudioQualityOfUid = @"AudioQualityOfUid";
static NSString *ConnectionDidInterrupted = @"onConnectionInterrupted";
static NSString *ConnectionDidBanned = @"onConnectionBanned";
static NSString *AudioQualityOfUid = @"onAudioQuality";

@interface AgoraConst : NSObject

Expand Down
34 changes: 32 additions & 2 deletions ios/RCTAgora/RCTAgora.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,33 @@ - (NSDictionary *)constantsToExport {
@"Connected": @(AgoraConnectionStateConnected),
@"Reconnecting": @(AgoraConnectionStateReconnecting),
@"ConnectionFailed": @(AgoraConnectionStateFailed),
@"ConnectionChangedConnecting": @(AgoraConnectionChangedConnecting),
@"ConnectionChangedJoinSuccess": @(AgoraConnectionChangedJoinSuccess),
@"ConnectionChangedInterrupted": @(AgoraConnectionChangedInterrupted),
@"ConnectionChangedBannedByServer": @(AgoraConnectionChangedBannedByServer),
@"ConnectionChangedJoinFailed": @(AgoraConnectionChangedJoinFailed),
@"ConnectionChangedLeaveChannel": @(AgoraConnectionChangedLeaveChannel),
@"AudioOutputRoutingDefault": @(AgoraAudioOutputRoutingDefault),
@"AudioOutputRoutingHeadset": @(AgoraAudioOutputRoutingHeadset),
@"AudioOutputRoutingEarpiece": @(AgoraAudioOutputRoutingEarpiece),
@"AudioOutputRoutingHeadsetNoMic": @(AgoraAudioOutputRoutingHeadsetNoMic),
@"AudioOutputRoutingSpeakerphone": @(AgoraAudioOutputRoutingSpeakerphone),
@"AudioOutputRoutingLoudspeaker": @(AgoraAudioOutputRoutingLoudspeaker),
@"AudioOutputRoutingHeadsetBluetooth": @(AgoraAudioOutputRoutingHeadsetBluetooth),
@"NetworkQualityUnknown": @(AgoraNetworkQualityUnknown),
@"NetworkQualityExcellent": @(AgoraNetworkQualityExcellent),
@"NetworkQualityGood": @(AgoraNetworkQualityGood),
@"NetworkQualityPoor": @(AgoraNetworkQualityPoor),
@"NetworkQualityBad": @(AgoraNetworkQualityBad),
@"NetworkQualityVBad": @(AgoraNetworkQualityVBad),
@"NetworkQualityDown": @(AgoraNetworkQualityDown),
@"ErrorCodeNoError": @(AgoraErrorCodeNoError),
@"ErrorCodeFailed": @(AgoraErrorCodeFailed),
@"ErrorCodeInvalidArgument": @(AgoraErrorCodeInvalidArgument),
@"ErrorCodeTimedOut": @(AgoraErrorCodeTimedOut),
@"ErrorCodeAlreadyInUse": @(AgoraErrorCodeAlreadyInUse),
@"ErrorCodeAbort": @(AgoraErrorCodeAbort),
@"ErrorCodeResourceLimited": @(AgoraErrorCodeResourceLimited),
@"AudioProfileDefault": @(AgoraAudioProfileDefault),
@"AudioProfileSpeechStandard": @(AgoraAudioProfileSpeechStandard),
@"AudioProfileMusicStandard": @(AgoraAudioProfileMusicStandard),
Expand Down Expand Up @@ -107,7 +134,10 @@ - (NSDictionary *)constantsToExport {
@"AgoraVideoMirrorModeAuto": @(AgoraVideoMirrorModeAuto),
@"AgoraVideoMirrorModeEnabled": @(AgoraVideoMirrorModeEnabled),
@"AgoraVideoMirrorModeDisabled": @(AgoraVideoMirrorModeDisabled),
};
@"AgoraChannelProfileCommunication": @(AgoraChannelProfileCommunication),
@"AgoraChannelProfileLiveBroadcasting": @(AgoraChannelProfileLiveBroadcasting),
@"AgoraChannelProfileGame": @(AgoraChannelProfileGame)
};
}

// init
Expand All @@ -133,7 +163,7 @@ - (NSDictionary *)constantsToExport {
}
}

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]];
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]];
[self.rtcEngine setVideoEncoderConfiguration:video_encoder_config];
[self.rtcEngine setClientRole:(AgoraClientRole)[options[@"clientRole"] integerValue]];
[self.rtcEngine setAudioProfile:(AgoraAudioProfile)[options[@"audioProfile"] integerValue]
Expand Down

0 comments on commit eb9e132

Please sign in to comment.