@startuml

!include agora_skin.iuml

box "App: Host"
participant "<size:40><&tablet>" as HST
end box

box "RTC SDK"
participant "<size:40><&layers>" as SDK
end box

box "App: Audience"
participant "<size:40><&tablet>" as AUD
end box

group Initialize AgoraRtcEngineKit
HST -> SDK: sharedEngineWithAppId
AUD -> SDK: sharedEngineWithAppId
end

group Set local view
HST -> SDK: enableVideo
HST -> SDK: startPreview
HST -> SDK: setupLocalVideo
end

group Configure ChannelMediaOptions
HST -> SDK: channelProfile(AgoraChannelProfileLiveBroadcasting)
AUD -> SDK: channelProfile(AgoraChannelProfileLiveBroadcasting)
HST -> SDK: clientRoleType(AgoraClientRoleBroadcaster)
AUD -> SDK: clientRoleType(AgoraClientRoleAudience)
end

group Join a channel
HST -> SDK: joinChannel(demoChannel)
SDK --> AUD: didJoinChannel(host)
AUD -> SDK: joinChannel(demoChannel)
SDK --> HST: didJoinChannel(audience)
end

group Set up remote view
AUD -> SDK: setupRemoteVideo
end

group Start audio and video interaction
AUD <-- SDK: Receive audio and video
HST --> SDK: Send audio and video
end

@enduml

