TUIRoomKit
Component in the shortest time. By following this document, you will complete the following key steps within an hour and ultimately obtain an audio/video conference function with a complete UI interface.pod 'TUIRoomKit'
pod install
pod repo update
<key>NSCameraUsageDescription</key><string>TUIRoom needs access to your Camera permission</string><key>NSMicrophoneUsageDescription</key><string>TUIRoom needs access to your Mic permission</string><key>NSPhotoLibraryUsageDescription</key><string>TUIRoom needs access to your Photo Library</string>
import TUICoreTUILogin.login(1400000001, // Please replace with the SDKAppID obtained in step 1userID: "998", // Please replace with your UserIDuserSig: "xxxxxxxxxx") { // You can calculate a UserSig in the Console and fill it in this positionprint("login success")} fail: { (code, message) inprint("login failed, code: \\(code), error: \\(message ?? "nil")")}
#import "TUICore/TUILogin.h"[TUILogin login:1400000001 // Please replace with the SDKAppID obtained in step 1userID:@"998" // Please replace with your UserIDuserSig:@"xxxxxxxxxx" succ:^{ // You can calculate a UserSig in the Console and fill it in this positionNSLog(@"login,success");} fail:^(int code, NSString * _Nullable msg) {NSLog(@"login,failed,code:%d,msg:%@",code,msg);}];
import TUIRoomKit// CreateConferenceViewController is your own ViewController.class CreateConferenceViewController: UIViewController {private var conferenceViewController: ConferenceMainViewController?func quickStartConferenceAction() {conferenceViewController = ConferenceMainViewController()let params = ConferenceParams() // The setting of params is optional, including microphone, camera and other status.params.isMuteMicrophone = falseparams.isOpenCamera = falseconferenceViewController?.setConferenceParams(params: params)conferenceViewController?.setConferenceObserver(observer: self)conferenceViewController?.quickStartConference(conferenceId: "123456")}}extension CreateConferenceViewController: ConferenceObserver {func onConferenceStarted(conferenceId: String, error: ConferenceError) {if error == .success, let vc = conferenceViewController {navigationController?.pushViewController(vc, animated: true)}conferenceViewController = nil}}
// CreateConferenceViewController is your own ViewController.@interface CreateConferenceViewController ()<ConferenceObserver>@property(strong, nonatomic) ConferenceMainViewController * conferenceController;@end@implementation CreateConferenceViewController- (void)quickStartConferenceAction {_conferenceController = [[ConferenceMainViewController alloc]init];ConferenceParams * params = [[ConferenceParams alloc]init]; // The setting of params is optional, including microphone, camera and other status.params.isMuteMicrophone = false;params.isOpenCamera = false;[_conferenceController setConferenceParamsWithParams:params];[_conferenceController setConferenceObserverWithObserver:self];[_conferenceController quickStartConferenceWithConferenceId:@"123456"];}- (void)onConferenceStartedWithConferenceId:(NSString *)conferenceId error:(enum ConferenceError)error {if (error == ConferenceErrorSuccess) {[self.navigationController pushViewController:_conferenceController animated:true];}_conferenceController = nil;}@end
import TUIRoomKit// EnterConferenceViewController is your own ViewController.class EnterConferenceViewController: UIViewController {private var conferenceViewController: ConferenceMainViewController?private func joinConferenceAction() {conferenceViewController = ConferenceMainViewController()let params = ConferenceParams() // The setting of params is optional, including microphone and camera status.params.isMuteMicrophone = falseparams.isOpenCamera = falseconferenceViewController?.setConferenceParams(params: params)conferenceViewController?.setConferenceObserver(observer: self)conferenceViewController?.joinConference(conferenceId: "123456")}}extension EnterConferenceViewController: ConferenceObserver {func onConferenceJoined(conferenceId: String, error: ConferenceError) {if error == .success, let vc = conferenceViewController {navigationController?.pushViewController(vc, animated: true)}conferenceViewController = nil}}
// EnterConferenceViewController is your own ViewController.@interface EnterConferenceViewController ()<ConferenceObserver>@property(strong, nonatomic) ConferenceMainViewController * conferenceController;@end@implementation EnterConferenceViewController- (void)joinConferenceAction {_conferenceController = [[ConferenceMainViewController alloc]init];ConferenceParams * params = [[ConferenceParams alloc]init]; // The setting of params is optional, including microphone and camera status.params.isMuteMicrophone = false;params.isOpenCamera = false;[_conferenceController setConferenceParamsWithParams:params];[_conferenceController setConferenceObserverWithObserver:self];[_conferenceController joinConferenceWithConferenceId:@"123456"];}- (void) onConferenceJoinedWithConferenceId:(NSString *)conferenceId error:(enum ConferenceError)error {if (error == ConferenceErrorSuccess) {[self.navigationController pushViewController:_conferenceController animated:true];}_conferenceController = nil;}
#import <TUIRoomKit/TUIRoomKit-Swift.h>
Conference main interface | User list |
Was this page helpful?