added force end transmition for dispatchers
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { useAudioStore } from "_store/audioStore";
|
||||
import {
|
||||
LocalParticipant,
|
||||
LocalTrackPublication,
|
||||
@@ -13,6 +14,20 @@ export const handleTrackSubscribed = (
|
||||
publication: RemoteTrackPublication,
|
||||
participant: RemoteParticipant,
|
||||
) => {
|
||||
console.log("Track subscribed:", track, publication, participant);
|
||||
if (!track.isMuted) {
|
||||
useAudioStore.getState().addSpeakingParticipant(participant);
|
||||
}
|
||||
track.on("unmuted", () => {
|
||||
useAudioStore.getState().addSpeakingParticipant(participant);
|
||||
|
||||
console.log("Track unmuted:", track);
|
||||
});
|
||||
track.on("muted", () => {
|
||||
useAudioStore.getState().removeSpeakingParticipant(participant);
|
||||
|
||||
console.log("Track muted:", track);
|
||||
});
|
||||
if (track.kind === Track.Kind.Video || track.kind === Track.Kind.Audio) {
|
||||
// attach it to a new HTMLVideoElement or HTMLAudioElement
|
||||
const element = track.attach();
|
||||
@@ -37,10 +52,6 @@ export const handleLocalTrackUnpublished = (
|
||||
publication.track?.detach();
|
||||
};
|
||||
|
||||
export const handleActiveSpeakerChange = (speakers: Participant[]) => {
|
||||
// show UI indicators when participant is speaking
|
||||
};
|
||||
|
||||
export const handleDisconnect = () => {
|
||||
console.log("disconnected from room");
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user