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

RtcStats "users" always null #10

Closed
a-leblond opened this issue May 22, 2019 · 9 comments
Closed

RtcStats "users" always null #10

a-leblond opened this issue May 22, 2019 · 9 comments
Assignees

Comments

@a-leblond
Copy link

Hi,

I'm trying to get the number of viewers of a Broadcast, is "users" from RtcStats the value that i need ?

If so, it seems to be always null, on the Broadcaster side as well as on the Audience side.

Here is the code i use :
void _addAgoraEventHandlers() { AgoraRtcEngine.onRtcStats = (RtcStats stats) { setState(() { viewers = stats.users; }); }; }

Then i display the viewers number in a Text widget.

Beside that, i encountered 0 problem using Agora it's a great platform !

@PRWrl
Copy link

PRWrl commented May 22, 2019

Thank you, a quick fix b4b832c, and submitted a new version 0.9.5 to pub to fix this issue.

@a-leblond
Copy link
Author

Great ! Thanks a lot for your quick fix !

@PRWrl
Copy link

PRWrl commented May 22, 2019

By the way, only broadcasters and self will count in 'users'.
A broadcaster can not know how many audience in this channel throw this rtc sdk. It needs a biz/signaling server.

@a-leblond
Copy link
Author

a-leblond commented May 22, 2019

So if there are a Broadcaster and 3 people in the audience, everyone will see "2" viewers ?

@PRWrl
Copy link

PRWrl commented May 22, 2019

Exactly, see the document about 'users' in RtcStats https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler_1_1_rtc_stats.html#aed1065e64c0b7e066776f14ca53c877e

@a-leblond
Copy link
Author

Thanks for the infos !

@wheel1992
Copy link

wheel1992 commented Nov 30, 2020

Hi @PRWrl, how do we get the total number of viewers?

@LichKing-2234
Copy link
Contributor

@github-actions
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 Apr 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants