aws-samples / amazon-chime-react-native-demo

A React Native demo application for Android and iOS using the Amazon Chime SDK.
MIT No Attribution
100 stars 24 forks source link

Android - incorrect camera behavior #162

Closed alexbutovv closed 1 year ago

alexbutovv commented 1 year ago

Describe the bug There are several cases where the camera behaves strangely

User1 - connect from web User2 - connect from android mobile device

1) If the User1 has already connected and turned on the camera (the listener sees that there is a connection), then it will not be displayed on the User2 side until the camera on the User2 side is turned on 2) Only the User1 camera is displayed BUT the User2 camera has active status (steps described below) 3) Displays a black background when the User2 camera is enabled

To Reproduce

First bug:

  1. start a session with the camera turned on by the User1

    Second bug:

  2. start a session with the camera turned on by the User1
  3. enable User2 camera
  4. Turn off the camera on the User1 side
  5. Turn on the camera on the User1 side

    Third bug

  6. start a session without the camera turned on by the User1
  7. enable user User2

Expected behavior First bug - User1 video is displayed Second bug - App displays both enabled cameras (both User1 and User2) Third bug - All interface elements are displayed without blackout

Screenshots Our design: Screenshot 2022-10-13 at 16 05 22 Third bug: image-20220908-161415

Test environment Info:

ethanjanadrake commented 1 year ago

Hi @alexbutovv, We cannot reproduce this issue on our demo app. It looks possible that you may need to call meetingSession.audioVideo.startRemoteVideo(). Are you doing that already?

alexbutovv commented 1 year ago

Hey @ethanjanadrake, thanks for your answer!

Of course, this method was used in our application. If I'm not mistaken, this method must be used to start a video session, and without it, I would not have seen the video at all. But as the bugs are described above, there are only a few strange cases of the camera working, but at the same time I catch the video and show it on the screen of the mobile application.

I didn't change anything from demo app when I integrated code except UI and added a couple of new methods like switchCamera and chooseAudioDevice from guide.

ethanjanadrake commented 1 year ago

Hi @alexbutovv, It might be an issue with binding logic, then. How are you binding the tile? In particular, how are you using bindVideoView?

alexbutovv commented 1 year ago

Hi @ethanjanadrake

As I mentioned before I just reused logic from rn demo code

export class RNVideoRenderView extends React.Component {
  componentDidMount() {
    // we need to delay the bind video
    // Because "componentDidMount" will be called "immediately after the initial rendering occurs"
    // This is *before* RCTUIManager add this view to register (so that viewForReactTag() can return a view)
    // So we need to dispatch bindVideoView after this function complete
    setTimeout(() => {
      NativeFunction.bindVideoView(findNodeHandle(this), this.props.tileId)
    })
  }

  componentWillUnmount() {
    NativeFunction.unbindVideoView(this.props.tileId)
  }

  render() {
    return <RNVideoRenderViewNative {...this.props} />
  }
}

const RNVideoRenderViewNative = requireNativeComponent('RNVideoView', RNVideoRenderView)

And use it in our screen component

sessionState.videoTiles.map(tileId => (
          <RNVideoRenderView
            key={tileId}
            tileId={tileId}
            style={styles.getVideoStyle(tileId)}
          />
        ))

also should say that everything is the same on ios works perfectly

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

alexbutovv commented 1 year ago

any updates here? still have a problems with android

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

bedzhanyan commented 1 year ago

We still look forward to getting an update on this ticket. Please assist.