livekit / client-sdk-android

LiveKit SDK for Android
https://docs.livekit.io
Apache License 2.0
160 stars 63 forks source link

Apply callback when camera switched from front to back or vice versa. #400

Open jinnyuri opened 3 months ago

jinnyuri commented 3 months ago

Is your feature request related to a problem? Please describe. For Android devices, I want to apply the mirror for the front camera, and in order to do that, I need to get a callback when the camera device is actually switched so there are no timing issues.

Describe the solution you'd like In the funtion switchCamera of LocalVideoTrack, could you please add something callback when onCameraSwitchDone is called, so that the app gets a callback when the camera is actually switched?

Describe alternatives you've considered N/A

Additional context N/A

jinnyuri commented 3 months ago

I can get LocalVideoTrack::options with flow. So, I don't know if this request is necessary.

davidliu commented 3 months ago

Ah yeah, the options will change when the first frame is received from the new camera.

This enhancement's probably a good idea anyways though so that it's more obvious which events are available, and not have to rely on this workaround.