Overview of Scenario-Based Solutions
소셜 엔터테인먼트
이커머스 라이브 방송
Audio/Video Call
원거리 실시간 조작
스마트 고객 서비스
AI 인터뷰







sudo gem install cocoapods
pod init
platform :ios, '8.0'target 'App' do# RTC Engine 라이트 버전# 설치 패키지 크기 증가가 최소화되었지만 RTC Engine와 라이브 방송 플레이어(TXLivePlayer) 두 가지 기능만 지원됩니다.pod 'TXLiteAVSDK_TRTC', :podspec => 'https://liteav.sdk.qcloud.com/pod/liteavsdkspec/TXLiteAVSDK_TRTC.podspec'# Professional 프로페셔널 버전# Real-Time Communication Engine (RTC Engine), 라이브방송 플레이어(TXLivePlayer), RTMP 푸시 스트리밍(TXLivePusher), VOD 플레이어(TXVodPlayer), 짧은 비디오 레코딩 및 편집(UGSV) 등 다양한 기능을 포함합니다.# pod 'TXLiteAVSDK_Professional', :podspec => 'https://liteav.sdk.qcloud.com/pod/liteavsdkspec/TXLiteAVSDK_Professional.podspec'# 뷰티 AR SDK 예: S1-07 패키지pod 'TencentEffect_S1-07'end
pod install
pod update
pod setuppod repo updaterm ~/Library/Caches/CocoaPods/search_index.json
-ObjC을 추가합니다.


[TELicenseCheck setTELicense:LicenseURL key:LicenseKey completion:^(NSInteger authresult, NSString * _Nonnull errorMsg) {if (authresult == TELicenseCheckOk) {NSLog(@"인증 성공");} else {NSLog(@"인증 실패");}}];
// RTC Engine SDK 인스턴스의 생성(싱글톤 모드)self.trtcCloud = [TRTCCloud sharedInstance];// 이벤트 리스너의 설정self.trtcCloud.delegate = self;// SDK의 다양한 이벤트 알림(예: 오류 코드, 경고 코드, 오디오/비디오 상태 매개변수 등)- (void)onError:(TXLiteAVError)errCode errMsg:(nullable NSString *)errMsg extInfo:(nullable NSDictionary *)extInfo {NSLog(@"%d: %@", errCode, errMsg);}- (void)onWarning:(TXLiteAVWarning)warningCode warningMsg:(nullable NSString *)warningMsg extInfo:(nullable NSDictionary *)extInfo {NSLog(@"%d: %@", warningCode, warningMsg);}// 이벤트 리스너의 제거self.trtcCloud.delegate = nil;// RTC Engine SDK 인스턴스(싱글톤 모드)를 파기합니다.[TRTCCloud destroySharedIntance];
// 뷰티 관련 리소스의 로드NSDictionary *assetsDict = @{@"core_name":@"LightCore.bundle",@"root_path":[[NSBundle mainBundle] bundlePath]};// 텐센트 이펙트 SDK의 초기화self.beautyKit = [[XMagic alloc] initWithRenderSize:previewSize assetsDict:assetsDict];// 텐센트 이펙트 SDK의 릴리스[self.beautyKit deinit]
// 스트리머의 로컬 화면 미리보기를 표시하는 데 사용되는 비디오 렌더링 컨트롤 가져옵니다@property (nonatomic, strong) UIView *anchorPreviewView;@property (nonatomic, strong) TRTCCloud *trtcCloud;- (void)setupTRTC {self.trtcCloud = [TRTCCloud sharedInstance];self.trtcCloud.delegate = self;// 원격 사용자가 보는 화면 품질을 결정하는 비디오 인코딩 매개변수를 설정합니다.TRTCVideoEncParam *encParam = [[TRTCVideoEncParam alloc] init];encParam.videoResolution = TRTCVideoResolution_960_540;encParam.videoFps = 15;encParam.videoBitrate = 1300;encParam.resMode = TRTCVideoResolutionModePortrait;[self.trtcCloud setVideoEncoderParam:encParam];// isFrontCamera는 전면/후면 카메라를 사용하여 비디오를 캡처하도록 지정할 수 있습니다[self.trtcCloud startLocalPreview:self.isFrontCamera view:self.anchorPreviewView];// 여기서는 음질을 지정할 수 있으며, 낮음에서 높음 순으로 SPEECH/DEFAULT/MUSIC입니다.[self.trtcCloud startLocalAudio:TRTCAudioQualityDefault];}
enterRoom 전에 위 인터페이스를 호출하면 SDK는 카메라 미리보기와 오디오 수집만 시작하며, enterRoom을 호출한 후에야 스트리밍을 시작합니다.enterRoom 후에 위 인터페이스를 호출하면 SDK는 카메라 미리보기와 오디오 수집을 시작하고 자동으로 스트리밍을 시작합니다.- (void)setupRenderParams {TRTCRenderParams *params = [[TRTCRenderParams alloc] init];// 화면 미러 모드params.mirrorType = TRTCVideoMirrorTypeAuto;// 화면 채우기 모드params.fillMode = TRTCVideoFillMode_Fill;// 화면 회전 각도params.rotation = TRTCVideoRotation_0;// 로컬 화면의 렌더링 매개변수를 설정합니다[self.trtcCloud setLocalRenderParams:params];// 인코더 출력 화면 미러 모드를 설정합니다[self.trtcCloud setVideoEncoderMirror:YES];// 비디오 인코더 출력 화면의 방향을 설정합니다[self.trtcCloud setVideoEncoderRotation:TRTCVideoRotation_0];}
- (void)enterRoomByAnchorWithUserId:(NSString *)userId roomId:(NSString *)roomId {TRTCParams *params = [[TRTCParams alloc] init];// 문자열 방 번호를 예로 들면params.strRoomId = roomId;params.userId = userId;// 업무 백엔드에서 가져온 UserSigparams.userSig = @"userSig";// 손님의 SDKAppID로 교체합니다params.sdkAppId = 0;// 스트리머 역할의 지정params.role = TRTCRoleAnchor;// 인터랙티브 라이브 방송 시나리오로 방 입장하기[self.trtcCloud enterRoom:params appScene:TRTCAppSceneLIVE];}// 방 입장 결과 이벤트의 콜백- (void)onEnterRoom:(NSInteger)result {if (result > 0) {// result는 방에 임장하는 데 소요된 시간(밀리초)을 나타냅니다.NSLog(@"Enter room succeed!");} else {// result는 방 입장 실패의 오류 코드를 나타냅니다.NSLog(@"Enter room failed!");}}
roomId와 문자열 형식 strRoomId로 나뉘며, 두 유형의 방은 서로 통하지 않으므로 방 번호 유형을 통일하는 것이 좋습니다.TRTCAppSceneLIVE으로 선택하는 것이 좋습니다.- (void)enterRoomByAudienceWithUserId:(NSString *)userId roomId:(NSString *)roomId {TRTCParams *params = [[TRTCParams alloc] init];// 문자열 방 번호를 예로 들면params.strRoomId = roomId;params.userId = userId;// 업무 백엔드에서 가져온 UserSigparams.userSig = @"userSig";// 손님의 SDKAppID로 교체합니다params.sdkAppId = 0;// 시청자 역할의 지정params.role = TRTCRoleAudience;// 인터랙티브 라이브 방송 시나리오로 방 입장하기[self.trtcCloud enterRoom:params appScene:TRTCAppSceneLIVE];}// 방 입장 결과 이벤트의 콜백- (void)onEnterRoom:(NSInteger)result {if (result > 0) {// result는 방에 임장하는 데 소요된 시간(밀리초)을 나타냅니다.NSLog(@"Enter room succeed!");} else {// result는 방 입장 실패의 오류 코드를 나타냅니다.NSLog(@"Enter room failed!");}}
- (void)onUserAudioAvailable:(NSString *)userId available:(BOOL)available {// 원격 사용자가 자신의 오디오를 게시/취소합니다// 자동 구독 모드에서는 사용자가 아무런 작업을 하지 않아도 SDK가 원격 사용자의 오디오를 자동으로 재생합니다.}- (void)onUserVideoAvailable:(NSString *)userId available:(BOOL)available {// 원격 사용자가 메인 비디오 화면을 게시/취소합니다if (available) {// 원격 사용자의 비디오 스트림을 구독하고 비디오 렌더링 컨트롤을 바인딩합니다[self.trtcCloud startRemoteView:userId streamType:TRTCVideoStreamTypeBig view:self.remoteView];} else {// 원격 사용자의 비디오 스트림 구독을 중지하고 렌더링 컨트롤을 릴리스합니다[self.trtcCloud stopRemoteView:userId streamType:TRTCVideoStreamTypeBig];}}
- (void)setupRemoteRenderParams {TRTCRenderParams *params = [[TRTCRenderParams alloc] init];// 화면 미러 모드params.mirrorType = TRTCVideoMirrorTypeAuto;// 화면 채우기 모드params.fillMode = TRTCVideoFillMode_Fill;// 화면 회전 각도params.rotation = TRTCVideoRotation_0;// 원격 화면의 렌더링 모드를 설정합니다[self.trtcCloud setRemoteRenderParams:@"userId" streamType:TRTCVideoStreamTypeBig params:params];}
- (void)switchToAnchor {// 스트리머 역할로 전환됩니다[self.trtcCloud switchRole:TRTCRoleAnchor];}// 역할 전환 이벤트의 콜백- (void)onSwitchRole:(TXLiteAVError)errCode errMsg:(NSString *)errMsg {if (errCode == ERR_NULL) {// 역할 전환 성공}}
- (void)setupTRTC {// 원격 사용자가 보는 화면 품질을 결정하는 비디오 인코딩 매개변수를 설정합니다.TRTCVideoEncParam *encParam = [[TRTCVideoEncParam alloc] init];encParam.videoResolution = TRTCVideoResolution_480_270;encParam.videoFps = 15;encParam.videoBitrate = 550;encParam.resMode = TRTCVideoResolutionModePortrait;[self.trtcCloud setVideoEncoderParam:encParam];// isFrontCamera는 전면/후면 카메라를 사용하여 비디오를 캡처하도록 지정할 수 있습니다[self.trtcCloud startLocalPreview:self.isFrontCamera view:self.audiencePreviewView];// 여기서는 음질을 지정할 수 있으며, 낮음에서 높음 순으로 SPEECH/DEFAULT/MUSIC입니다.[self.trtcCloud startLocalAudio:TRTCAudioQualityDefault];}
- (void)switchToAudience {// 시청자 역할로 전환됩니다[self.trtcCloud switchRole:TRTCRoleAudience];}// 역할 전환 이벤트의 콜백- (void)onSwitchRole:(TXLiteAVError)errCode errMsg:(NSString *)errMsg {if (errCode == ERR_NULL) {// 카메라 수집 및 스트리밍 중지합니다[self.trtcCloud stopLocalPreview];// 마이크 수집 및 스트리밍 중지합니다[self.trtcCloud stopLocalAudio];}}
- (void)exitRoom {[self.trtcCloud stopLocalAudio];[self.trtcCloud stopLocalPreview];[self.trtcCloud exitRoom];}// 방 나가기 이벤트의 콜백- (void)onExitRoom:(NSInteger)reason {if (reason == 0) {NSLog(@"exitRoom을 호출하여 방에서 나가기");} else if (reason == 1) {NSLog(@"서버에 의해 현재 방에서 나가게 됩니다");} else if (reason == 2) {NSLog(@"현재 방 전체가 해체됩니다");}}
onExitRoom 콜백을 통해 알려줍니다.enterRoom을 다시 호출하거나 다른 음성/영상 SDK로 전환하려면 onExitRoom 콜백이 발생한 후 관련 작업을 수행하십시오. 그렇지 않으면 카메라, 마이크 장치에 강제로 점유됨 등 다양한 이상 현상이 발생할 수 있습니다.DismissRoom(숫자 방 ID와 문자열 방 ID 구분)을 제공합니다. 이 인터페이스를 호출하여 방의 모든 사용자를 방에서 나가게 시키하고 방을 해산할 수 있습니다.exitRoom 인터페이스를 통해 방 내 모든 스트리머와 청취자의 퇴장을 완료시키고, 퇴장 후 RTC Engine 방 라이프사이클 규칙에 따라 방이 자동으로 해산됩니다. 자세한 내용은 방에서 나가기를 참조하세요.- (void)connectOtherRoom:(NSString *)roomId {NSMutableDictionary *jsonDict = [[NSMutableDictionary alloc] init];// 숫자 방 번호는 roomId입니다[jsonDict setObject:roomId forKey:@"strRoomId"];[jsonDict setObject:self.userId forKey:@"userId"];NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsonDict options:NSJSONWritingPrettyPrinted error:nil];NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];[self.trtcCloud connectOtherRoom:jsonString];}// 크로스 룸 연결 결과의 콜백- (void)onConnectOtherRoom:(NSString *)userId errCode:(TXLiteAVError)errCode errMsg:(NSString *)errMsg {// 크로스 룸 연결을 하려는 다른 방의 스트리머의 사용자 ID// 에러 코드, ERR_NULL은 요청 성공을 나타냅니다// 에러 정보}
- (void)onUserAudioAvailable:(NSString *)userId available:(BOOL)available {// 원격 사용자가 자신의 오디오를 게시/취소합니다// 자동 구독 모드에서는 사용자가 아무런 작업을 하지 않아도 SDK가 원격 사용자의 오디오를 자동으로 재생합니다.}- (void)onUserVideoAvailable:(NSString *)userId available:(BOOL)available {// 원격 사용자가 메인 비디오 화면을 게시/취소합니다if (available) {// 원격 사용자의 비디오 스트림을 구독하고 비디오 렌더링 컨트롤에 바인딩합니다[self.trtcCloud startRemoteView:userId streamType:TRTCVideoStreamTypeBig view:self.remoteView];} else {// 원격 사용자의 비디오 스트림 구독을 중지하고 렌더링 컨트롤을 릴리스합니다[self.trtcCloud stopRemoteView:userId streamType:TRTCVideoStreamTypeBig];}}
// 크로스 룸 채팅 연결 종료[self.trtcCloud disconnectOtherRoom];// 크로스 룸 연결 종료 결과의 콜백- (void)onDisconnectOtherRoom:(TXLiteAVError)errCode errMsg:(NSString *)errMsg {}
DisconnectOtherRoom()을 호출하면 모든 다른 방의 스트리머와의 크로스 룸 PK 연결이 종료됩니다.DisconnectOtherRoom()을 호출하여 크로스 룸 PK 연결을 종료할 수 있습니다.NSString *beautyConfigPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];beautyConfigPath = [beautyConfigPath stringByAppendingPathComponent:@"beauty_config.json"];NSFileManager *localFileManager=[[NSFileManager alloc] init];BOOL isDir = YES;NSDictionary * beautyConfigJson = @{};if ([localFileManager fileExistsAtPath:beautyConfigPath isDirectory:&isDir] && !isDir) {NSString *beautyConfigJsonStr = [NSString stringWithContentsOfFile:beautyConfigPath encoding:NSUTF8StringEncoding error:nil];NSError *jsonError;NSData *objectData = [beautyConfigJsonStr dataUsingEncoding:NSUTF8StringEncoding];beautyConfigJson = [NSJSONSerialization JSONObjectWithData:objectDataoptions:NSJSONReadingMutableContainerserror:&jsonError];}NSDictionary *assetsDict = @{@"core_name":@"LightCore.bundle",@"root_path":[[NSBundle mainBundle] bundlePath],@"tnn_"@"beauty_config":beautyConfigJson};// SDK 초기화: width와 height는 각각 texture의 너비와 높이입니다.self.xMagicKit = [[XMagic alloc] initWithRenderSize:CGSizeMake(width,height) assetsDict:assetsDict];
// RTC Engine SDK가 서드파티 뷰티의 비디오 데이터 콜백을 설정합니다[self.trtcCloud setLocalVideoProcessDelegete:self pixelFormat:TRTCVideoPixelFormat_Texture_2D bufferType:TRTCVideoBufferType_Texture];#pragma mark - TRTCVideoFrameDelegate// YTProcessInput을 구성하여 SDK 내부로 전달하여 렌더링 처리를 합니다- (uint32_t)onProcessVideoFrame:(TRTCVideoFrame *_Nonnull)srcFrame dstFrame:(TRTCVideoFrame *_Nonnull)dstFrame {if (!self.xMagicKit) {[self buildBeautySDK:srcFrame.width and:srcFrame.height texture:srcFrame.textureId];//XMagic SDK의 초기화self.heightF = srcFrame.height;self.widthF = srcFrame.width;}if(self.xMagicKit!=nil && (self.heightF!=srcFrame.height || self.widthF!=srcFrame.width)){self.heightF = srcFrame.height;self.widthF = srcFrame.width;[self.xMagicKit setRenderSize:CGSizeMake(srcFrame.width, srcFrame.height)];}YTProcessInput *input = [[YTProcessInput alloc] init];input.textureData = [[YTTextureData alloc] init];input.textureData.texture = srcFrame.textureId;input.textureData.textureWidth = srcFrame.width;input.textureData.textureHeight = srcFrame.height;input.dataType = kYTTextureData;YTProcessOutput *output = [self.xMagicKit process:input withOrigin:YtLightImageOriginTopLeft withOrientation:YtLightCameraRotation0];dstFrame.textureId = output.textureData.texture;return 0;}
- (void)enableDualStreamMode:(BOOL)enable {// 소형 비디오 스트림의 인코딩 매개변수 (자체 정의 가능)TRTCVideoEncParam *smallVideoEncParam = [[TRTCVideoEncParam alloc] init];smallVideoEncParam.videoResolution = TRTCVideoResolution_480_270;smallVideoEncParam.videoFps = 15;smallVideoEncParam.videoBitrate = 550;smallVideoEncParam.resMode = TRTCVideoResolutionModePortrait;[self.trtcCloud enableEncSmallVideoStream:enable withQuality:smallVideoEncParam];}
// 원격 사용자 비디오 스트림을 구독할 때 선택 가능한 비디오 스트림의 유형[self.trtcCloud startRemoteView:userId streamType:TRTCVideoStreamTypeBig view:view];// 원격 사용자의 화면 크기를 언제든지 전환할 수 있습니다[self.trtcCloud setRemoteVideoStreamType:userId type:TRTCVideoStreamTypeSmall];
streamType 비디오 스트림 유형을 TRTCVideoStreamTypeSmall로 지정하여 저화질 소형 화면을 가져올 수 있습니다.// 로컬 미리보기 화면 렌더링 컨트롤의 업데이트[self.trtcCloud updateLocalView:view];// 원격 사용자 비디오 렌더링 컨트롤의 업데이트[self.trtcCloud updateRemoteView:view streamType:TRTCVideoStreamTypeBig forUser:userId];
view를 대상 비디오 렌더링 컨트롤로 전달합니다.streamType은 TRTCVideoStreamTypeBig 및 TRTCVideoStreamTypeSub만 지원합니다.// 좋아요 메시지 본문 구성NSDictionary *msgDict = @{@"type": @1, // 좋아요 메시지의 유형@"likeCount": @10 // 좋아요 메시지의 수량};NSDictionary *dataDict = @{@"cmd": @"like_msg",@"msg": msgDict};NSError *error;NSData *data = [NSJSONSerialization dataWithJSONObject:dataDict options:0 error:&error];// 그룹 커스텀 메시지 전송 (좋아요 메시지는 낮은 우선순위로 설정 권장드립니다)[[V2TIMManager sharedInstance] sendGroupCustomMessage:data to:groupID priority:V2TIM_PRIORITY_LOW succ:^{// 좋아요 메시지 전송 성공// 로컬에서 좋아요 효과 렌더링합니다} fail:^(int code, NSString *desc) {// 좋아요 메시지 전송 실패}];
// 그룹 커스텀 메시지의 수신[[V2TIMManager sharedInstance] addSimpleMsgListener:self];- (void)onRecvGroupCustomMessage:(NSString *)msgID groupID:(NSString *)groupID sender:(V2TIMGroupMemberInfo *)info customData:(NSData *)data {if (data.length > 0) {NSError *error;NSDictionary *dataDict = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];if (!error) {NSString *command = dataDict[@"cmd"];NSDictionary *msgDict = dataDict[@"msg"];if ([command isEqualToString:@"like_msg"]) {NSNumber *type = msgDict[@"type"]; // 좋아요 유형NSNumber *likeCount = msgDict[@"likeCount"]; // 좋아요 수// 좋아요 메시지의 유형과 수량에 따라 좋아요 효과 렌더링합니다}} else {NSLog(@"파싱 오류: %@", error.localizedDescription);}}}
https://xxxxxx/v4/group_open_http_svc/send_group_msg?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json
{"GroupId": "@TGS#12DEVUDHQ","Random": 2784275388,"MsgPriority": "High", // 메시지의 우선순위이고 선물 메시지는 높은 우선순위로 설정해야 합니다"MsgBody": [{"MsgType": "TIMCustomElem","MsgContent": {// type: 선물 유형; giftUrl: 선물 리소스 주소; giftName: 선물 이름; giftCount: 선물 수량"Data": "{""cmd"": ""gift_msg", ""msg"": {""type"": 1, ""giftUrl"": ""xxx", ""giftName"": ""xxx", ""giftCount"": 1}}"}}]}
// 그룹 커스텀 메시지의 수신[[V2TIMManager sharedInstance] addSimpleMsgListener:self];- (void)onRecvGroupCustomMessage:(NSString *)msgID groupID:(NSString *)groupID sender:(V2TIMGroupMemberInfo *)info customData:(NSData *)data {if (data.length > 0) {NSError *error;NSDictionary *dataDict = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];if (!error) {NSString *command = dataDict[@"cmd"];NSDictionary *msgDict = dataDict[@"msg"];if ([command isEqualToString:@"gift_msg"]) {NSNumber *type = msgDict[@"type"]; // 선물 유형NSNumber *giftCount = msgDict[@"giftCount"]; // 선물 수량NSString *giftUrl = msgDict[@"giftUrl"]; // 선물 리소스 주소NSString *giftName = msgDict[@"giftName"]; // 선물 이름// 선물 유형, 선물 수량, 선물 리소스 주소, 선물 이름에 따라 선물 효과를 렌더링합니다.}} else {NSLog(@"파싱 오류: %@", error.localizedDescription);}}}
// 공개 탄막 메시지의 전송[[V2TIMManager sharedInstance] sendGroupTextMessage:text to:groupID priority:V2TIM_PRIORITY_NORMAL succ:^{// 탄막 메시지의 전송이 성공됩니다// 로컬에서 메시지 텍스트가 표시됨} fail:^(int code, NSString *desc) {// 탄막 메시지의 전송이 실패됩니다}];// 공개 탄막 메시지의 수신[[V2TIMManager sharedInstance] addSimpleMsgListener:self];- (void)onRecvGroupTextMessage:(NSString *)msgID groupID:(NSString *)groupID sender:(V2TIMGroupMemberInfo *)info text:(NSString *)text {// 발신자 정보 info 및 메시지 텍스트 text에 따라 탄막 메시지 렌더링합니다}
열거형 | 값 | 설명 |
ERR_TRTC_INVALID_USER_SIG | -3320 | 방 입장 매개변수 userSig가 올바르지 않습니다. TRTCParams.userSig이 비어 있는지 확인하세요. |
ERR_TRTC_USER_SIG_CHECK_FAILED | -100018 | UserSig 검증에 실패했습니다. 매개변수 TRTCParams.userSig이 올바르게 입력되었는지 또는 만료되지 않았는지 확인하세요. |
열거형 | 값 | 설명 |
ERR_TRTC_CONNECT_SERVER_TIMEOUT | -3308 | 입장 요청 시간 초과, 네트워크 연결이 끊겼는지 또는 VPN이 켜져 있는지 확인하세요. 4G로 전환하여 테스트할 수도 있습니다. |
ERR_TRTC_INVALID_SDK_APPID | -3317 | 입장 매개변수 sdkAppId가 잘못되었습니다. TRTCParams.sdkAppId이 비어 있는지 확인하세요. |
ERR_TRTC_INVALID_ROOM_ID | -3318 | 입장 매개변수 roomId가 잘못되었습니다. TRTCParams.roomId 또는 TRTCParams.strRoomId이 비어 있는지 확인하세요. roomId와 strRoomId는 혼용할 수 없습니다. |
ERR_TRTC_INVALID_USER_ID | -3319 | 입장 매개변수 userId가 올바르지 않습니다. TRTCParams.userId이 비어 있는지 확인하세요. |
ERR_TRTC_ENTER_ROOM_REFUSED | -3340 | 입장 요청이 거부되었습니다. enterRoom을 연속적으로 호출하여 동일한 ID의 방에 입장했는지 확인하세요. |
열거형 | 값 | 설명 |
ERR_CAMERA_START_FAIL | -1301 | Windows 또는 Mac 장치에서 카메라 구성 프로그램(드라이버)이 비정상일 경우, 카메라 열 수가 없습니다. 장치를 비활성화한 후 다시 활성화하거나, 기기를 재시작하거나, 구성 프로그램을 업데이트하세요. |
ERR_MIC_START_FAIL | -1302 | Windows 또는 Mac 장치에서 마이크 구성 프로그램(드라이버)에 이상이 있는 경우 마이크를 열 수 없습니다. 장치를 비활성화한 후 다시 활성화하거나, 기기를 재시작하거나, 구성 프로그램을 업데이트하세요. |
ERR_CAMERA_NOT_AUTHORIZED | -1314 | 카메라 장치에 권한이 없습니다. 일반적으로 모바일 장치에서 발생하며, 사용자가 권한을 거부했을 수 있습니다. |
ERR_MIC_NOT_AUTHORIZED | -1317 | 마이크 장치에 권한이 없습니다. 일반적으로 모바일 장치에서 발생하며, 사용자가 권한을 거부했을 수 있습니다. |
ERR_CAMERA_OCCUPY | -1316 | 카메라가 사용 중입니다. 다른 카메라를 열어 볼 수 있습니다. |
ERR_MIC_OCCUPY | -1319 | 마이크가 사용 중입니다. 예를 들어 모바일 장치에서 통화 중일 때 마이크를 열 수가 없습니다. |
setLocalRenderParams와 비디오 인코더 미러 setVideoEncoderMirror로 나뉘며, 각각 로컬 미리보기 화면 미러 효과와 비디오 인코딩 출력 화면의 미러 효과(원격 시청자 및 클라우드 레코딩의 미러 모드)에 영향을 미칩니다. 로컬 미리보기의 미러 효과가 원격 시청자 측에서도 동시에 적용되도록 하려면 다음과 같이 코딩하십시오.// 로컬 화면의 렌더링 매개변수를 설정합니다TRTCRenderParams *params = [[TRTCRenderParams alloc] init];params.mirrorType = TRTCVideoMirrorTypeEnable; // 화면 미러 모드params.fillMode = TRTCVideoFillMode_Fill; // 화면 채우기 모드params.rotation = TRTCVideoRotation_0; // 화면 회전 각도[self.trtcCloud setLocalRenderParams:params];// 인코더 출력 화면 미러 모드를 설정합니다[self.trtcCloud setVideoEncoderMirror:YES];
// 카메라 최대 줌 배율 가져오기(모바일 전용)CGFloat zoomRatio = [[self.trtcCloud getDeviceManager] getCameraZoomMaxRatio];// 카메라 줌 배율의 설정(모바일 전용)// 범위는 1-5이며, 1은 가장 먼 시야(일반 렌즈)이고 5는 가장 가까운 시야(확대 렌즈)를 나타냅니다. 최대값은 5를 권장하며 5를 초과하면 비디오 데이터가 흐릿해질 수 있습니다[[self.trtcCloud getDeviceManager] setCameraZoomRatio:zoomRatio];
// 카메라 자동 초점 기능의 켜기 또는 끄기(모바일만 적용)[[self.trtcCloud getDeviceManager] enableCameraAutoFocus:NO];// 카메라 초점 위치의 설정(모바일 전용)// 해당 인터페이스를 사용하려면 먼저 enableCameraAutoFocus로 자동 초점 기능을 꺼야 합니다[[self.trtcCloud getDeviceManager] setCameraFocusPosition:CGPointMake(x, y)];
// 현재 전면 카메라인지 판단하세요(모바일만 적용)BOOL isFrontCamera = [[self.trtcCloud getDeviceManager] isFrontCamera];// 전면 또는 후면 카메라의 전환(모바일만 적용)// true 전달: 전면으로 전환; false 전달: 후면으로 전환[[self.trtcCloud getDeviceManager] switchCamera:!isFrontCamera];
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan