Skip to content

Switching between front and rear cameras requires stopping current track in some scenarios #2021

Open
@loganathanav

Description

@loganathanav

I'm using 2.27.0, still the issue exist. Is there any work arounds to overcome this issue.
I'm trying to catch and trying createLocalVideoTrak to have new track. That also not working.

if (isApplePhone) {
room?.localParticipant?.videoTracks.forEach(
(publication) => {
publication.track.stop();
publication.track.restart({ facingMode: 'environment' });
}
);
} else if (isAndroidPhone) {
room?.localParticipant?.videoTracks.forEach(
async (publication) => {
publication.track.stop();
await publication.track.restart({
facingMode: 'environment',
});
}
);
}

Team, please confirm whether we need to use async/await or not inside forEach loop here?
also, do we need to use stop() function in iPhone as well or not required?

Getting error in browser. Provide your suggestions, I'm struck here.

Metadata

Metadata

Labels

AndroidIssues related to Android or Twilio's Android Video SDKiOSIssues related to iOS or Twilio's iOS Video SDK

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions