fix: local stream video visibility and audio double-playback
Show local user's own screen share in their stream tile by bypassing the isSubscribed check for local participants and auto-watching/unwatching local streams on publish/unpublish. Eliminate audio double-playback by detaching LiveKit's auto-attached audio elements so GlobalAudioRenderer is the sole playback path, making attenuation and volume controls effective. Fix GainNode leak in useAudioTrackPlayer cleanup paths.
This commit is contained in:
@@ -71,10 +71,13 @@ export function useAudioTrackPlayer(opts) {
|
||||
else {
|
||||
// --- STANDARD MODE (0% - 100%) ---
|
||||
// Clean up boost pipeline if it exists
|
||||
if (boostGainRef.current) {
|
||||
boostGainRef.current.disconnect();
|
||||
boostGainRef.current = null;
|
||||
}
|
||||
if (boostSourceRef.current) {
|
||||
boostSourceRef.current.disconnect();
|
||||
boostSourceRef.current = null;
|
||||
boostGainRef.current = null;
|
||||
}
|
||||
audioEl.muted = false;
|
||||
audioEl.volume = Math.min(volume, 1.0);
|
||||
@@ -84,10 +87,13 @@ export function useAudioTrackPlayer(opts) {
|
||||
}
|
||||
}
|
||||
return () => {
|
||||
if (boostGainRef.current) {
|
||||
boostGainRef.current.disconnect();
|
||||
boostGainRef.current = null;
|
||||
}
|
||||
if (boostSourceRef.current) {
|
||||
boostSourceRef.current.disconnect();
|
||||
boostSourceRef.current = null;
|
||||
boostGainRef.current = null;
|
||||
}
|
||||
};
|
||||
}, [volume, muted, track]);
|
||||
|
||||
Reference in New Issue
Block a user