pod 'TCICSDK_Pro', '1.8.5.4'
<key>NSCameraUsageDescription</key><key>NSMicrophoneUsageDescription</key><key>NSPhotoLibraryAddUsageDescription</key><key>NSPhotoLibraryUsageDescription</key>
Field | Type | Meaning | Remarks | Mandatory |
schoolId | Int | School Number | Choose Application Management > Application Configuration through the console to obtain the SDKAppId. | Yes |
classId | Long | Classroom Number | Yes | |
userId | string | User account | Yes | |
token | String | Backend authentication parameters | Yes | |
scene | String | Scene name | It is used to distinguish different custom layouts. It is configured through the SetAppCustomContent interface. [roomConfig setValue:@"scene_name" forKey:@"scene"]; | No |
lng | String | Language parameters | You can enter zh-Hans or en. The default value is Chinese (zh-Hans). You can set this parameter on this interface. [roomConfig setValue:@"en" forKey:@"language"]; | No |
camera | Int | Initialize and turn on the camera. | 1 indicates to turn on the camera, and 0 indicates to turn it off. You can set this parameter through roomConfig.jsParams. | No |
mic | Int | Initialize and turn on the microphone. | 1 indicates to turn on the microphone, and 0 indicates to turn it off. You can set this parameter through roomConfig.jsParams. | No |
speaker | Int | Initialize and turn on the speaker. | 1 indicates to turn on the speaker, and 0 indicates to turn it off. You can set this parameter through roomConfig.jsParams. | No |
TCICClassConfig *roomConfig = [[TCICClassConfig alloc] init];roomConfig.schoolId = 123456;roomConfig.userId = "test";roomConfig.token = "test_token";roomConfig.classId = 654321;[roomConfig setValue:@"en" forKey:@"language"]; //Language settings, optional[roomConfig setValue:@"scene_name" forKey:@"scene"]; //Customized according to different scenes, optional[roomConfig setValue:@(0) forKey:@"preferPortrait"]; //Default landscape, optional (0 indicates landscape and 1 indicates portrait)TCICClassController *vc = [TCICClassController classRoomWithConfig:roomConfig];if (vc) {[(UINavigationController *)self.window.rootViewController pushViewController:vc animated:YES];}else {NSLog(@"Incorrect parameter");}
[[NSNotificationCenter defaultCenter] addObserver:selfselector:@selector(yourselector)name:@"TCICExitClassRoomCompleteNotify" object:nil];
App Group
. Refer to TRTC Documentation.Broadcast Upload Extension
. Refer to TRTC Documentation.Target
, depend on TCICSDK_ReplayKit
as follows, and then simply re-run pod install
.target 'New target name' do# Comment the next line if you do not need to use dynamic frameworks.# use_frameworks!pod 'TCICSDK_Pro_ReplayKit'end
SampleHandler.m
, and replace APPGROUP
with the App Group
created in Step 1.#import "SampleHandler.h"#import <TXLiteAVSDK_ReplayKitExt/TXLiteAVSDK_ReplayKitExt.h>#import <TCICScreenKit/TCICScreenKit.h>// Note: Replace `APPGROUP` with the ID of the App Group created earlier.#define APPGROUP ""@interface SampleHandler() <TXReplayKitExtDelegate>@end@implementation SampleHandler- (void)broadcastStartedWithSetupInfo:(NSDictionary<NSString *,NSObject *> *)setupInfo {[[TXReplayKitExt sharedInstance] setupWithAppGroup:APPGROUP delegate:self];[[TCICScreenKit sharedScreenKit] onScreenKitStarted];}- (void)broadcastPaused {// The user has requested to pause the broadcast. Samples will stop being delivered.[[TCICScreenKit sharedScreenKit] onScreenKitPaused];}- (void)broadcastResumed {// The user has requested to resume the broadcast. Samples delivery will resume.[[TCICScreenKit sharedScreenKit] onScreenKitResumed];}- (void)broadcastFinished {[[TXReplayKitExt sharedInstance] finishBroadcast];// The user has requested to finish the broadcast.[[TCICScreenKit sharedScreenKit] onScreenKitFinished];}#pragma mark - TXReplayKitExtDelegate- (void)broadcastFinished:(TXReplayKitExt *)broadcast reason:(TXReplayKitExtReason)reason{NSString *tip = @"";switch (reason) {case TXReplayKitExtReasonRequestedByMain:tip = @"Screen sharing ended";break;case TXReplayKitExtReasonDisconnected:tip = @"Application disconnected";break;case TXReplayKitExtReasonVersionMismatch:tip = @"Integration error (SDK version mismatch)";break;}NSError *error = [NSError errorWithDomain:NSStringFromClass(self.class) code:0 userInfo:@{NSLocalizedFailureReasonErrorKey:tip}];[self finishBroadcastWithError:error];}- (void)processSampleBuffer:(CMSampleBufferRef)sampleBuffer withType: (RPSampleBufferType)sampleBufferType {switch (sampleBufferType) {case RPSampleBufferTypeVideo:[[TXReplayKitExt sharedInstance] sendVideoSampleBuffer:sampleBuffer];break;case RPSampleBufferTypeAudioApp:// Handle audio sample buffer for app audiobreak;case RPSampleBufferTypeAudioMic:// Handle audio sample buffer for mic audiobreak;default:break;}}@end
TCICClassConfig *roomConfig = [[TCICClassConfig alloc] init];roomConfig.userId = "test";roomConfig.token = "test_token";roomConfig.classId = 123454;roomConfig.schoolId = xxxxx;// Set AppGroup using the KVC method.[roomConfig setValue:@"group.com.xx.xxxx" forKey:@"appGroup"];
Scenedelegate
, refer to Xcode 11 Remove Scenedelegate to remove it. For example, in the Demo, the pop-up effect is as follows. Click Start live streaming to begin.Broadcast Upload Extension
to trigger, as exemplified below with Tencent Meeting:Upload Extension
created should have its Deployment target
set to iOS 11.0
(since Replay Kit
is only supported from iOS11
), and ensure that the physical device used for debugging is also on iOS11
or later.Background Modes
needs to be added.
Was this page helpful?