🐛(frontend) reset video ref on track stop for state transitions
Reset video element reference when track stops to ensure "camera starting" to "camera started" message transitions work correctly on repeated camera toggles. Previously only worked on initial video element load. Now properly handles state transitions for multiple camera enable/disable cycles.
This commit is contained in:
committed by
aleb_the_flash
parent
56ec2dd8cb
commit
2d47e90a1a
@@ -161,7 +161,11 @@ export const Join = ({
|
||||
|
||||
return () => {
|
||||
videoTrack?.detach()
|
||||
videoElement?.removeEventListener('loadedmetadata', handleVideoLoaded)
|
||||
if (videoElement) {
|
||||
videoElement.removeEventListener('loadedmetadata', handleVideoLoaded)
|
||||
videoElement.style.opacity = '0'
|
||||
}
|
||||
isVideoInitiated.current = false
|
||||
}
|
||||
}, [videoTrack, videoEnabled])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user