Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix not diplaying video when audio is present #5

Closed
wants to merge 2 commits into from

Conversation

domneedham
Copy link
Collaborator

Fixes an issue where video stream was not loaded when audio was present, as the video stream was overwritten.

Also fixes an issue whereby the audio stream was not cancelled correctly when changing view of cameras.

@billyjacoby billyjacoby self-requested a review September 12, 2023 11:20
billyjacoby
billyjacoby previously approved these changes Sep 12, 2023
@@ -35,8 +35,8 @@ export const WebRTCView = ({cameraName}: WebRTCViewProps) => {
const [isConnected, setIsConnected] = React.useState<boolean>(false);
const [retryAttempts, setRetryAttempts] = React.useState(0);
const [shouldRetry, setShouldRetry] = React.useState(false);
const [remoteStream, setRemoteStream] = React.useState<MediaStream | null>(
null,
const [remoteStream, setRemoteStream] = React.useState<MediaStream>(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't need to actually use the setRemoteStream function you can just prefix it with an underscore (_setRemoteStream) to prevent that linting error.

But the way this is working now looks like it should be fine. Will test in a bit, having some weird device issues at the moment lol

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh good to know! No worries, hopefully all works okay.

@billyjacoby
Copy link
Owner

Completed in 19d1e27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants