Git Product home page Git Product logo

Comments (4)

maxxfrazer avatar maxxfrazer commented on June 5, 2024

@GitAnubhav1, you can get the duration for the local user:
https://docs.agora.io/en/Video/API%20Reference/flutter/API/rtc_api_data_type.html?platform=Flutter#class_rtcstats

from videouikit-flutter.

GitAnubhav1 avatar GitAnubhav1 commented on June 5, 2024

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?

from videouikit-flutter.

Meherdeep avatar Meherdeep commented on June 5, 2024

@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),
    )

from videouikit-flutter.

maxxfrazer avatar maxxfrazer commented on June 5, 2024

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.

from videouikit-flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.