TUIRoom
is an open-source UI component for audio/video communication. With just a few lines of code changes, you can integrate it into your project to implement screen sharing, beauty filters, low-latency video calls, and other features. In addition to the iOS component, we also offer components for Android, Windows, macOS, and more. |
TUIRoom
componentTUIRoom
folder in the same directory as Podfile
in your project.Source
, Resources
, TUIBeauty
, and TXAppBasic
folders and the TUIRoom.podspec
file in TUIRoom/iOS/ to the TUIRoom
folder in your project.Podfile
and run pod install
to import the component.# :path => "The relative path of `TUIRoom.podspec`"pod 'TUIRoom', :path => "./TUIRoom/TUIRoom.podspec", :subspecs => ["TRTC"]# :path => "The relative path of `TXAppBasic.podspec`"pod 'TXAppBasic', :path => "./TUIRoom/TXAppBasic/"# :path => "The relative path of `TUIBeauty.podspec`"pod 'TUIBeauty', :path => "./TUIRoom/TUIBeauty/"
Source
and Resources
folders and the TUIRoom.podspec
file must be in the same directory.TXAppBasic.podspec
is in the TXAppBasic
folder.TUIBeauty.podspec
is in the TCBeautyKit
folder.Info.plist
of your app. Their content is what users see in the mic and camera access pop-up windows.<key>NSCameraUsageDescription</key><string>RoomApp needs to access your camera to capture video.</string><key>NSMicrophoneUsageDescription</key><string>RoomApp needs to access your mic to capture audio.</string>
@import TUIRoom;@import TUICore;// 1. Log in to the component[TUILogin login:@"Your SDKAppID" userID:@"Your UserID" userSig:@"Your UserSig" succ:^{} fail:^(int code, NSString *msg) {}];// 2. Initialize the `TUIRoom` instanceTUIRoom *tuiRoom = [TUIRoom sharedInstance];```
import TUIRoomimport TUICore// 1. Log in to the componentTUILogin.login("Your SDKAppID", userID: "Your UserID", userSig: "Your UserSig") {} fail: { code, msg in}// 2. Initialize the `TUIRoom` instancelet tuiRoom = TUIRoom.sharedInstance```
SDKAppID
.
SDKAppID
. You can view your application’s secret key on the Application Management page of the TRTC console.SDKAppID
, userId
, and Secretkey
. You can click here to quickly generate a UserSig
for testing or calculate it on your own by referring to our TUIRoom demo project. For more information, see UserSig.@import TUIRoom;[tuiRoom createRoomWithRoomId:12345 speechMode:TUIRoomFreeSpeech isOpenCamera:YES isOpenMicrophone:YES];
import TUIRoomtuiRoom.createRoom(roomId: 12345, speechMode: .freeSpeech, isOpenCamera: true, isOpenMicrophone: true)```
@import TUIRoom;[tuiRoom enterRoomWithRoomId:12345 isOpenCamera:YES isOpenMicrophone:YES]
import TUIRoomtuiRoom.enterRoom(roomId: 12345, isOpenCamera: true, isOpenMicrophone: true)```
@import TUIRoom;[[TUIRoomCore shareInstance] destroyRoom:^(NSInteger code, NSString * _Nonnull message) {}];```
import TUIRoomTUIRoomCore.shareInstance().destroyRoom { [weak self] _, _ inguard let self = self else { return }self.navigationController?.popViewController(animated: true)}```
@import TUIRoom;[[TUIRoomCore shareInstance] leaveRoom:^(NSInteger code, NSString * _Nonnull message) {}];```
import TUIRoomTUIRoomCore.shareInstance().leaveRoom { [weak self] _, _ inguard let self = self else { return }self.navigationController?.popViewController(animated: true)}```
@import TUIRoom;@import TXLiteAVSDK_Professional;TRTCVideoEncParam *params = [[TRTCVideoEncParam alloc] init];params.videoResolution = TRTCVideoResolution_1280_720;params.resMode = TRTCVideoResolutionModePortrait;params.videoFps = 10;params.enableAdjustRes = NO;params.videoBitrate = 1500;[[TUIRoomCore shareInstance] startScreenCapture:param];```
import TUIRoom// Start screen sharinglet params = TRTCVideoEncParam()params.videoResolution = TRTCVideoResolution._1280_720params.resMode = TRTCVideoResolutionMode.portraitparams.videoFps = 10params.enableAdjustRes = falseparams.videoBitrate = 1500TUIRoomCore.shareInstance().startScreenCapture(params)```
sudo gem install cocoapods
Was this page helpful?