Hi, finally here. So difficult to find dev support.
My team are trying to implement Huddle01 audio and video using the @huddle01/web-core SDK but repeatedly get error:
Some snippet from the implementation:
async joinRoom(roomId: string, token: string): Promise<Room> {
await this.huddleClient.socket.connect({ token: token });
this.room = Room.create();
this.room.roomId = roomId
return this.room
}
async joinCall() {
console.log(`huddle: joining call`, { user: this.user })
try {
if (!this.activeSession) {
throw new Error("no session")
}
this.room = await this.joinRoom(this.activeSession.roomId, this.activeSession.accessToken)
this.invokeRoomHandlers(this.room)
return true
} catch (e) {
throw new Error(e as string)
}
}
private invokeRoomHandlers(room: Room) {
this.huddleClient.socket.on("connected", () => {
console.log('huddle: socket connect', this.room)
if (this.room) {
console.log('huddle: joining room')
this.room.connect()
}
})
room.on("room-joined", async () => {
console.log('HC: Joined Room')
await this.huddleClient.localPeer.enableAudio();
})
room.on("new-peer-joined", ({ peer }) => {
console.log('new participant joined')
this.peer = { peerId: peer.peerId, stream: undefined, status: "not-ready" }
this.eventEmitter.emit("participant-joined", this.peer)
peer.on("stream-playable", (stream) => {
if (this.peer) {
this.peer.stream = stream
this.eventEmitter.emit("participant-ready", this.peer)
}
})
})
}
Who can help me solve this ?
Tell me if I need to provide with something for solving this