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

Getting total count of current streams is not possible? #1480

Open
1 of 3 tasks
ugurkellecioglu opened this issue Sep 8, 2024 · 4 comments
Open
1 of 3 tasks

Getting total count of current streams is not possible? #1480

ugurkellecioglu opened this issue Sep 8, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@ugurkellecioglu
Copy link

Which package/packages do you use?

  • @stream-io/video-react-sdk
  • @stream-io/video-react-native-sdk
  • @stream-io/video-client

Is your feature request related to a problem? Please describe.
I want to show a list of the live audio streams where I am able to get the list of current streams with queryCall, great. But I was expecting to have a "meta" field in the response that shows how many streams are there so that I can inform my users there are more streams and show a button to them, like "See all streams".

Describe the solution you'd like
When limit parameter has passed into queryCall function, we should get a totalCount or "meta" field that has totalCount etc.

Describe alternatives you've considered
There is no clear information regarding this use case. I looked at how can I get the total count of streams, it seems there is no such functionality. Or maybe I just couldn't find it.

Also I tried to fetch the next page using "next" field package provide, but it seems I get an error because I try to fetch two page at the same time. (current and next page)

@ugurkellecioglu ugurkellecioglu added the enhancement New feature or request label Sep 8, 2024
@oliverlaz
Copy link
Member

hi @ugurkellecioglu, can you please help me understand the question better?
If I'm understanding correctly, you are asking how to get the total number of ongoing live streams, right?

For querying ongoing live streams, please take a look at the following docs:

@ugurkellecioglu
Copy link
Author

Hi @oliverlaz, thanks.

If I'm understanding correctly, you are asking how to get the total number of ongoing live streams, right?

That's correct. Currently there is no way to get that piece of information without querying for all ongoing streams.

To make it even more clear, here is a psuode code

await client.queryCalls({
 filter_conditions: {
    ongoing: true
  },
  limit: 3
})

returns 3 stream data and a "next" field. (let's say we have 6 ongoing streams. )

What I'd like to see as response

calls: [3 stream data],
meta:{
     next: nextPageCursor,
     total: 6 // total number of counts
}

or since "next" field is already in same level with "calls", response might look like this so that current api is not going to be broken with this update:

calls: [3 stream data],
next: nextPageCursor,
total: 6

@ugurkellecioglu
Copy link
Author

Hi @oliverlaz , do you think you can take a look at this one? I'm also OK to contribute to the project if you can give a direction to me, thx!

@oliverlaz
Copy link
Member

Hi @ugurkellecioglu, I have already forwarded this feedback to our backend team. Without them extending the API first, I'm afraid I can't do much here.
I'll get back to you once I know more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants