AgoraIO / Video-Call-for-Mobile-Gaming

33 stars 14 forks source link

Video Chat in Game with two, three, four players #26

Closed tejas4687 closed 2 years ago

tejas4687 commented 4 years ago

Sir I want to implement video chat with following requirements, 1.Auto start video chat on user login. 2.Number of user restriction for chat (Per room) =Minimum-2 Maximum-4 per game. 3.Pause/Play audio & video options Please guide or provide the source for the same

zhangtao1104 commented 4 years ago

1: Start Video when you call api named joinChannel, it is easy. mRtcEngine.OnJoinChannelSuccess = onJoinChannelSuccess; mRtcEngine.OnUserJoined = onUserJoined; mRtcEngine.OnUserOffline = onUserOffline;

    // enable video
    mRtcEngine.EnableVideo();
    // allow camera output callback
    mRtcEngine.EnableVideoObserver();

    // join channel
    mRtcEngine.JoinChannel(channel, null, 0);

2: Number of user restriction, you need to control it by your server.

3: Pause/Play audio & video api: video: EnableVideo/DisableVideo EnableAudio/DisableAudio