Search code examples
agora.ioagora-web-sdk-ng

restrict video call access for only host and guest


i want to integrate agora on my website with angular. I need to have several active video calls, how do i make sure that the host and the guest are the only ones joining the session? And that the rest (host and owner) enter their respective unique rooms? Is there a unique id of temporary channel so that both enter through that or something like that?


Solution

  • You can decide a pre-defined unique channel name which won't be shared with anyone by the host other than the guest.

    Check the Agora Documentation for Video Calls here.

    <label for="form-channel">Meeting ID</label>
    <input type="text" id="form-channel" class="form-control" placeholder="Meeting ID" required>
    
    <script>
    // Join Channel Modal
    $("#join-channel").click(function (event) {
        var agoraAppId = "<APP-ID>";
        var channelName = $('#form-channel').val();
        initClientAndJoinChannel(agoraAppId, channelName);
        $("#modalForm").modal("hide");
    });
    </script>

    Using the above code snippet you can make dynamic channels on the go. You can also have predefined channel names coming from a server if you need by giving a variable instead of $('#form-channel').val();.

    If you still have doubts you can check my sample app at: https://github.com/akshatvg/speakOut. Even though the app isn't on Angular, you will understand how you need to make the channels work.