Huddle Unity Webgl plugin
The Huddle Unity WebGL Plugin SDK provides a process and method for seamless integration of real-time audio and video in Unity
QuickStart
Installing the package
To get started with the Huddle01 Unity Webgl Plugin, you can download the latest unitypackage from here
(opens in a new tab)
Import the unitypackage file in your project include all the files mentioned in below image:
Initializing Huddle01
To initialize the Huddle01, you need to call Huddle01Core.Instance.Init method
.csharp
using UnityEngine;
using Huddle01;
public class AudioVideoMeet : MonoBehaviour
{
void Start()
{
Huddle01Core.Instance.Init("Your_project_id");
Debug.Log("Huddle01 Initiated");
}
}
Join Room
After initializing Huddle01 plugin, you can call join room function and subscribe to OnJoinRoom Event
.csharp
private void OnEnable()
{
Huddle01Core.OnJoinRoom += OnJoinRoom;
}
private void OnDisable()
{
Huddle01Core.OnJoinRoom -= OnJoinRoom;
}
public void JoinRoom(string roomId,string token)
{
Huddle01Core.Instance.JoinRoom(roomId, token);
}
private void OnJoinRoom()
{
Debug.Log("Room Joined");
}
Methods:
Room:
Methods:
Huddle01Core.Instance.JoinRoom(”Your_Room_ID”, “YOUR_ACCESS_TOKEN”)
Huddle01Core.Instance.LeaveRoom()
Events:
LocalPeer
Methods
Huddle01Core.Instance.UpdateLocalPeerMetaData(string metadataJson)
Huddle01Core.Instance.GetLocalPeerId()
MuteMic(shouldMute,PeerMetadata)
EnableVideo(enable,PeerMetadata)
Events
Remote Peer
Events
PeerAddedEventHandler(peerInfo)
PeerLeftEventHandler(peerId)
PeerMutedEventHandler(muted)
PeerMetadataUpdatedEventHandler(PeerMetadata)
ResumePeerVideoEventHandler(peerId)
// can be used for localpeer as wellStopPeerVideoEventHandler(peerId)
can be used for localpeer as well