userJoined property
Occurs when a remote user (ChannelProfile.Communication)/host (ChannelProfile.LiveBroadcasting) joins the channel.
- ChannelProfile.Communication profile: This callback notifies the app when another user joins the channel. If other users are already in the channel, the SDK also reports to the app on the existing users.
- ChannelProfile.LiveBroadcasting profile: This callback notifies the app when the host joins the channel. If other hosts are already in the channel, the SDK also reports to the app on the existing hosts. We recommend having at most 17 hosts in a channel.
The SDK triggers this callback under one of the following circumstances:
- A remote user/host joins the channel by calling the RtcEngine.joinChannel method.
- A remote user switches the user role to the host by calling the RtcEngine.setClientRole method after joining the channel.
- A remote user/host rejoins the channel after a network interruption.
- The host injects an online media stream into the channel by calling the RtcEngine.addInjectStreamUrl method.
Note
- In the ChannelProfile.LiveBroadcasting profile:
-- The host receives the
userJoined
callback when another host joins the channel. -- The audience in the channel receives theuserJoined
callback when a new host joins the channel. -- When a web application joins the channel, theuserJoined
callback is triggered as long as the web application publishes streams.
The UidWithElapsedCallback
typedef includes the following parameters:
- int
uid
: This parameter has the following definitions in different events:- userJoined: ID of the user or host who joins the channel.
firsRemoteAudioFrame
: User ID of the remote user.- firstRemoteAudioDecoded: User ID of the remote user sending the audio stream.
- joinChannelSuccess: User ID.
- rejoinChannelSuccess: User ID.
- int
elapsed
:- userJoined: Time delay (ms) from the local user calling RtcEngine.joinChannel or RtcEngine.setClientRole until this callback is triggered.
firsRemoteAudioFrame
: Time elapsed (ms) from the local user calling RtcEngine.joinChannel until this callback is triggered.- firstRemoteAudioDecoded: Time elapsed (ms) from the local user calling RtcEngine.joinChannel until the SDK triggers this callback.
- joinChannelSuccess: Time elapsed (ms) from the local user calling RtcChannel.joinChannel until this callback is triggered.
- rejoinChannelSuccess: Time elapsed (ms) from the local user starting to reconnect until this callback is triggered.
Implementation
UidWithElapsedCallback? userJoined;