Local Peer
UpdateMetadata(string metadataJson)
To update the local peer metadata, call the method HuddleClient.Instance.UpdateMetadata
, which takes a JSON string as a parameter.
Keep in mind that you must update HuddleWebglPlugin.jslib
to reflect any changes in the data structure of the JSON you pass.
private void UpdateMetadata(MetadataInfo metadataInfo)
{
_huddleClientInstance.UpdateMetadata(JsonConvert.SerializeObject(metadataInfo));
}
UpdatePeerMetaData : function(metadataVal)
{
var metadata = JSON.parse(UTF8ToString(metadataVal));
huddleClient.localPeer.updateMetadata({
name : metadata.name
});
},
string GetLocalPeerId()
To get local peerId, use HuddleClient.Instance.GetLocalPeerId
method
string _localPeerId = _huddleClientInstance.GetLocalPeerId();