Skip to content

Instantly share code, notes, and snippets.

@digitallysavvy
Created October 8, 2020 19:50
Show Gist options
  • Save digitallysavvy/bfe60a6cbb5372ee55fe33401c2be634 to your computer and use it in GitHub Desktop.
Save digitallysavvy/bfe60a6cbb5372ee55fe33401c2be634 to your computer and use it in GitHub Desktop.
A snippet for extracting the value from modal inputs and passing them to functions to initialize the Agora and PubNub clients.
// init the session when user clicks join
$( "#join-channel" ).click(function( event ) {
var agoraAppId = $('#form-appid').val();
var token = $('#form-token').val();
var channelName = $('#form-channel').val();
var pubKey = $('#form-publishKey').val();
var subKey = $('#form-subscribeKey').val();
var uid = $("#form-uid").val();
$("#modalForm").modal("hide");
initClientAndJoinChannel(agoraAppId, token, channelName, uid);
initPubNub(pubKey, subKey, uid, channelName);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment