As seen here from Twilio's documentation, how does the following code work? We have a connection
class and an on
method. If I haven't previously defined what hasEarlyMedia
, showRingingIndicator
, or playOutgoingRinging
mean, then how does the on
method know what they mean and what to do with them? Thanks.
connection.on('ringing', function(hasEarlyMedia) {
showRingingIndicator();
if (hasEarlyMedia) { playOutgoingRinging(); }
});