client-sdk-android
                                
                                 client-sdk-android copied to clipboard
                                
                                    client-sdk-android copied to clipboard
                            
                            
                            
                        Use immutables for flows
State flows won't refire for internal changes within objects. Need to create immutable versions for flows.
Definitely +1
Tried this, expecting it to fire when camera flips between front/back but it didn't — the track instance is the same.
room.localParticipant::videoTracks.flow
    .map { (it.firstOrNull()?.second as? LocalVideoTrack) }
    .collect { /* set renderer mirror */ }
Unfortunately I see no room.events that gets triggered when I flip camera (by changing options and restarting the track).
@AchrafAmil note that the track isn't replaced when camera is flipped; the LocalVideoTrack instance remains the same.
Yes! Until it's made immutable and would therefore inevitably be a new instance.