I'm building a video calling feature using PeeJS and I am able to send metadata to a user I'm calling using the code below:
const call = peer.call(user_id, stream, { metadata: { username: userInfo.username } });
This can be received by the receiver using the code shown below:
peer.on('call', call => {
let callerUsername = call.metadata.username;
})
My question is how do I return the information of the receiver back to the caller when I answer the call using call.answer? I'd like to show the username of both the caller and receiver on top of the video but currently, the metadata can only be sent from the caller to the receiver.