이 페이지는 현재 영어로만 제공되며 한국어 버전은 곧 제공될 예정입니다. 기다려 주셔서 감사드립니다.

Audience Connection

Description of the Feature

The 'audience mic link' feature is a real-time interactive communication method. By using the audience mic link feature, hosts can interact in real time with up to 9 audience members, whether it's answering questions, sharing experiences, or engaging in entertainment interactions, all of which significantly enhance the audience's engagement and satisfaction. This direct interaction and communication provide a more convenient and efficient channel for commercial operations and also offer the audience a more personalized and customized shopping experience. The audience mic link feature is suitable for multiple scenarios, including e-commerce live streaming, entertainment live streaming, and online teaching.
Dual-person Mic Connection
Group Mic Connection







Access Process

Audience mic connection process

The TUILiveKit audience mic connection feature is mainly implemented through LiveCoreView. You can call the following API functions to implement the audience mic connection feature. As an example, Audience B requests to connect with Anchor A as follows.
Note:
The following are active call methods provided by LiveCoreView.
All callback methods refer to the callback methods in the ConnectionObserver object set by LiveCoreView.

Audience sends a mic connection request

Audience B sends a mic connection request to Anchor A. Anchor A will receive the mic connection request from Audience B in the onUserConnectionRequest callback.
swift
let timeout = 60
// When initiating a mic connection request, the userId can be an empty string
liveCoreView.requestIntraRoomConnection(userId: "", timeOut: timeOut, openCamera: true) {
} onError: { code, message in
}

The anchor receives the mic connection request

Anchor A will receive Audience B's mic connection request in the onUserConnectionRequest callback method.
swift
func onUserConnectionRequest(inviterUser: TUIUserInfo) {
print("Received audience connection request:\(inviterUser.userId)")
}

Anchor responds to the mic connection request

After Anchor A receives Audience B's mic connection request, they can call respondIntraRoomConnection to respond to Audience B on whether the mic connection is accepted.
swift
// Anchor agrees to mic connection
liveCoreView.respondIntraRoomConnection(userId: audienceBUserId, isAccepted: true) {
} onError: { code, message in
}

The audience receives the anchor's response callback

After Anchor A agrees to the co-broadcast request from Audience B, Audience B will receive Anchor A's agreement to co-broadcast through the onUserConnectionAccepted callback.
swift
func onUserConnectionAccepted(userId: String) {
print("Audience agrees to connect:\(inviterUser.userId)")
}

Callback for changes in the list of co-broadcasting users

After Host A agrees to the co-broadcast request from Audience B, LiveCoreView will send notifications to both Host A and Audience B about the changes in co-broadcasting users.
swift
func onConnectedUsersUpdated(userList: [TUIUserInfo], joinList: [TUIUserInfo], leaveList: [TUIUserInfo]) {
print("Callback for changes in the list of co-broadcasting user")
}

Process of disconnecting audio connection

After the audience successfully connects, the host hangs up the mic connection

After Audience B and Host A successfully connect, Host A disconnects the mic connection with Audience.
swift
let userId = "audienceBUserId"
liveCoreView.disconnectUser(userId: userId) {
} onError: { code, message in
}

The audience receives a callback when the host disconnects the interactive connection.

After Host A disconnects the mic connection with Audience B, Audience B will receive the onUserConnectionTerminated callback.
swift
func onUserConnectionTerminated() {
print("Anchor closes connection")
}

After the audience successfully connects, the audience ends the mic connection

After Audience B successfully connects with Anchor A, Audience B can actively disconnect by calling terminateIntraRoomConnection.
swift
liveCoreView.terminateIntraRoomConnection()

The host receives a callback when an audience member disconnects.

When Audience B actively disconnects the mic, the anchor will receive the onUserConnectionExited callback.
swift
func onUserConnectionExited(userInfo: TUIUserInfo) {
print("Audience exits the connection")
}
Note:
The connection feature is implemented based on LiveCoreView. If you need to extend the connection feature, please refer to the LiveCoreView documentation.

Mic Connection Sequence Diagram