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] I am not able to find the duration of the call #81

Closed
GitAnubhav1 opened this issue May 9, 2022 · 4 comments
Closed

[BUG] I am not able to find the duration of the call #81

GitAnubhav1 opened this issue May 9, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@GitAnubhav1
Copy link

Once any user ends the call or decided to opt out of the video call, is there a way we can find the duration of the call?

@GitAnubhav1 GitAnubhav1 added the bug Something isn't working label May 9, 2022
@maxxfrazer
Copy link
Contributor

maxxfrazer commented May 9, 2022

@GitAnubhav1
Copy link
Author

Hi Max,

Thank you for your response. I am really struggling to use rtcstats in my code. I am using the Code as suggested in the package:

// Instantiate the client
final AgoraClient client = AgoraClient(
agoraConnectionData: AgoraConnectionData(
appId: "<--App Id Here-->",
channelName: "test",
),
agoraEventHandlers: AgoraEventHandlers(
userJoined: (uid, elapsed){},
userOffline: (uid, reason) async{},
leaveChannel: (RtcStats stats) => ()),
enabledPermission: [
Permission.camera,
Permission.microphone,
],
);

// Initialize the Agora Engine
@OverRide
void initState() {
super.initState();
initAgora();
}

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

// Build your layout
@OverRide
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SafeArea(
child: Stack(
children: [
AgoraVideoViewer(client: client),
AgoraVideoButtons(client: client),
],
),
),
),
);
}

Could you please help me find out where and how, I can get the duration of the call if a user leaves the meeting?

@Meherdeep
Copy link
Contributor

@GitAnubhav1 You can find the duration of the local user by using leave channel, something like this:

agoraEventHandlers: AgoraRtcEventHandlers(
      leaveChannel: (stats) => print(stats.duration),
    )

If you want to find the duration of a remote user then you can use the remoteAudioStats callback something like:

agoraEventHandlers: AgoraRtcEventHandlers(
      remoteAudioStats: (stats) => print(stats.publishDuration),
    )

@maxxfrazer
Copy link
Contributor

Looks like @Meherdeep's comment fixes the solution, no response in 7 days so closing. Feel free to open again if this solution did not work for you.

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