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

[Android] ^6.3.1 Remote camera not working #1963

Closed
1 of 5 tasks
onedoc-kjh opened this issue Aug 19, 2024 · 3 comments
Closed
1 of 5 tasks

[Android] ^6.3.1 Remote camera not working #1963

onedoc-kjh opened this issue Aug 19, 2024 · 3 comments
Labels
triage agora support waiting for customer response waiting for customer response, or closed by no-reponse bot

Comments

@onedoc-kjh
Copy link

onedoc-kjh commented Aug 19, 2024

Version of the agora_rtc_engine

6.3.1

Platforms affected

  • Android
  • iOS
  • macOS
  • Windows
  • Web

Steps to reproduce

  1. Create a new Flutter app
  2. Import plugin agora_rtc_engine: ^6.3.1
  3. Use a Unique UID for joining the channel and assign the same UID for the local video view.
  4. Run the app
  5. Join the channel.

Expected results

Remote and local video calls must be seamless.

Actual results

When connecting to a remote channel, the remote screen randomly does not appear.

Code sample

Code sample
@riverpod
class AgoraCameraViewModel extends _$AgoraCameraViewModel {
  @override
  AgoraCameraState build(
      RtcEngine engine, String token, String channelName, int id) {
    Future.microtask(() async{
      state = AgoraCameraState(engine: engine);
      await _joinChannel(token: token, channelName: channelName, id: id);
    });

    _onDispose();
    return AgoraCameraState(engine: engine);
  }

  Future _joinChannel({
    required String token,
    required String channelName,
    required int id,
  }) async {

    state.engine.registerEventHandler(
      RtcEngineEventHandler(
        onJoinChannelSuccess: (connection, elapsed) {
          state = state.copyWith(isJoined: true, localUid: connection.localUid);
        },
        onUserJoined: (connection, remoteUid, elapsed) {
          state = state.copyWith(remoteUid: remoteUid);
        },
        onLeaveChannel: (connection, stats) {
          state =
              state.copyWith(isJoined: false, localUid: null, remoteUid: null);
        },
        onUserOffline: (connection, remoteUid, reason) {
          state = state.copyWith(userOffline: true);
        },
        onAudioVolumeIndication:
              (connection, speakers, speakerNumber, totalVolume) {
           //
          },
          onRemoteVideoStateChanged:
              (connection, remoteUid, _state, reason, elapsed) {
            if (reason ==
                RemoteVideoStateReason.remoteVideoStateReasonRemoteMuted) {
            state = state.copyWith(remoteVideoMuted: true);
          } else if (reason ==
              RemoteVideoStateReason.remoteVideoStateReasonRemoteUnmuted) {
            state = state.copyWith(remoteVideoMuted: false);
          }
        },
        ),
      );

    await state.engine.enableVideo();

    try {
      await state.engine.joinChannel(
        token: token,
        channelId: channelName,
          options: ChannelMediaOptions(),
          uid: id,
        );
      } on PlatformException {
      await state.engine.leaveChannel();
      await state.engine.joinChannel(
        token: token,
        channelId: channelName,
          options: ChannelMediaOptions(),
          uid: id,
        );
      }
      // state = AsyncData(value.copyWith(engine: engine));
  }

  void _onDispose() {
    ref.onDispose(() {
      state.engine.leaveChannel();
      state.engine.release();
    });
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
2024-08-19 13:13:55.831 12890-12904 MessageQueue            **.*****.******                     W  Handler (android.os.Handler) {4fa7e61} sending message to a Handler on a dead thread
                                                                                                    java.lang.IllegalStateException: Handler (android.os.Handler) {4fa7e61} sending message to a Handler on a dead thread
                                                                                                    	at android.os.MessageQueue.enqueueMessage(MessageQueue.java:560)
                                                                                                    	at android.os.Handler.enqueueMessage(Handler.java:786)
                                                                                                    	at android.os.Handler.sendMessageAtTime(Handler.java:735)
                                                                                                    	at android.os.Handler.sendMessageDelayed(Handler.java:705)
                                                                                                    	at android.os.Handler.post(Handler.java:435)
                                                                                                    	at android.hardware.camera2.impl.CameraDeviceImpl$CameraHandlerExecutor.execute(CameraDeviceImpl.java:2437)
                                                                                                    	at android.hardware.camera2.impl.CallbackProxies$SessionStateCallbackProxy.onClosed(CallbackProxies.java:104)
                                                                                                    	at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:588)
                                                                                                    	at android.hardware.camera2.impl.CameraCaptureSessionImpl.finalize(CameraCaptureSessionImpl.java:894)
                                                                                                    	at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:339)
                                                                                                    	at java.lang.Daemons$FinalizerDaemon.processReference(Daemons.java:324)
                                                                                                    	at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:300)
                                                                                                    	at java.lang.Daemons$Daemon.run(Daemons.java:145)
                                                                                                    	at java.lang.Thread.run(Thread.java:1012)

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.3, on macOS 14.1.1 23B81 darwin-arm64, locale ko-KR)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.3.5)
[✓] VS Code (version 1.91.1)
[✓] Connected device (5 available)
    ! Error: Browsing on the local area network for 김진형의 iPhone14 pro. Ensure the device is unlocked and attached with a cable or associated with the same
      local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

• No issues found!
@littleGnAl littleGnAl added triage agora support waiting for customer response waiting for customer response, or closed by no-reponse bot labels Aug 21, 2024
Copy link
Contributor

Please submit a ticket to Agora Support for further investigation of this issue. If you have any conclusions, you can share them here which may help other developers. Thanks!

Copy link
Contributor

github-actions bot commented Sep 4, 2024

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, what happens, logs and the output. All system setups can be slightly different so it's always better to open new issues and reference the related ones. Thanks for your contribution.

@github-actions github-actions bot closed this as completed Sep 4, 2024
Copy link
Contributor

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please raise a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
triage agora support waiting for customer response waiting for customer response, or closed by no-reponse bot
Projects
None yet
Development

No branches or pull requests

2 participants