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

[BUG] How Can I Properly end a call? #180

Open
GxnxrxlMasri opened this issue Mar 6, 2024 · 1 comment
Open

[BUG] How Can I Properly end a call? #180

GxnxrxlMasri opened this issue Mar 6, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@GxnxrxlMasri
Copy link

I'm trying to implement what happens after I click the disconnect button but it never seems to work, I want to pop the widget, Here's my code:

...appid, token, uid
class VideoCall extends StatefulWidget {
final String channelName; //channel name gets passed from other widget

const VideoCall({Key? key, required this.channelName}) : super(key: key);

@OverRide
State createState() => _VideoCallState();
}

class _VideoCallState extends State {
late AgoraClient client;

@OverRide
void initState() {
super.initState();
client = AgoraClient(
agoraConnectionData: AgoraConnectionData(
appId: appId,
channelName: widget.channelName,
tempToken: token,
uid: uid,
),
agoraEventHandlers: AgoraRtcEventHandlers(
onLeaveChannel: (uid, elapsed) {
(state) => Navigator.pop(context); // <--- I want to go to previous widget or a specified widget
},
),
);
_initAgora();
}

void _initAgora() async {
await client.initialize();
}

@OverRide
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Agora UI Kit'),
centerTitle: true,
),
body: SafeArea(
child: Stack(
children: [
AgoraVideoViewer(
client: client,
layoutType: Layout.oneToOne,
enableHostControls: false,
),
AgoraVideoButtons(
client: client,
),
],
),
),
),
);
}
}

What is happening is that after clicking the disconnect button the screen goes black and nothing else happens (I sometimes see the previous widget for one frame before going to black again) and I get this error:

W/libEGL (10966): EGLNativeWindowType 0x751c99f010 disconnect failed
W/libEGL (10966): EGLNativeWindowType 0x752c5bd010 disconnect failed
I/spdlog (10966): [2024-03-06 18:53:57.621] [10966] [info] [iris_rtc_api_engine.cc:343] api name RtcEngine_setupLocalVideo_acc9c38 params "{"canvas":{"uid":0,"view":0,"renderMode":1}}"
I/spdlog (10966): [2024-03-06 18:53:57.622] [10966] [info] [iris_rtc_api_engine.cc:407] api name RtcEngine_setupLocalVideo_acc9c38 result 0 outdata {"result":0}
2
I/CameraManagerGlobal(10966): do not need hide aux camera, device number: 2
I/CameraDevice-JV-1(10966): Camera now idle
I/TRuntime.CctTransportBackend(10966): Making request to: https://crashlyticsreports-pa.googleapis.com/v1/firelog/legacy/batchlog

and Then I keep getting this on repeat forever:

W/aosl_main(10966): type=1400 audit(0.0:326462): avc: denied { read } for name="stat" dev="proc" ino=4026532094 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc_stat:s0 tclass=file permissive=0

**and in Debug mode I get multiple exceptions. I haven't found in the agora guide on the website how to do this properly

I am testing this on an android device.**

@GxnxrxlMasri GxnxrxlMasri added the bug Something isn't working label Mar 6, 2024
@tadaspetra
Copy link
Contributor

tadaspetra commented Mar 6, 2024

This is because your navigation stack is only one layer.

The reason you are getting a black screen is because you are popping off the initial screen that you have. Before you can pop you need to push something on top of it.

If you did push this screen, then you shouldn't need a MaterialApp in there, as the MaterialApp widget handles the routing. So you are setting up a new navigation stack by having it in there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants