GetStream / stream-video-android

📲 Android Video SDK. Stream's versatile Core + Compose UI component libraries that allow you to build video calling, audio room, and, live streaming apps based on Webrtc running on Stream's global edge network.
https://getstream.io/video/docs/android
Other
380 stars 39 forks source link

Android - Unable to get created by name & image info in QueriedCalls #1131

Open vinodkumarsagitla opened 4 months ago

vinodkumarsagitla commented 4 months ago

Discussed in https://github.com/GetStream/stream-video-android/discussions/1130

Originally posted by **vinodkumarsagitla** July 4, 2024 Hello, I am using latest version "io.getstream:stream-video-android-ui-compose:1.0.9" When we call below query for ongoing stream video ``` val filters = mutableMapOf("ongoing" to true) val result = cloudClientStreamVideo?.queryCalls(filters=filters, limit=25, watch=true)?.getOrNull() ``` then i got below response in result so we are unable to get/find createdBy user name, image in this response `QueriedCalls(calls=[CallData(blockedUsersIds=[], call=CallInfo(cid=livestream:056cb8e9-2863-417e-acd8-8aa5c98c21ed, type=livestream, id=056cb8e9-2863-417e-acd8-8aa5c98c21ed, createdByUserId=vQkCQ72k57PLaWTL54Q3BUfHL9Z2, broadcastingEnabled=true, recordingEnabled=false, createdAt=Thu Jul 04 18:20:06 GMT+05:30 2024, updatedAt=Thu Jul 04 18:20:06 GMT+05:30 2024, custom={}), members=[], ownMembership=null)], next=null, prev=null)` So please can you help
aleksandar-apostolov commented 3 months ago

If you have cached users you can use the ID of the createdByUserId to find it in the DB. If not, you need to load the data for the call and extract the createdBy from there.

Something in the line of this:

val imageNamePair = StreamVideo.instance().call("livestream", "056cb8e9-2863-417e-acd8-8aa5c98c21ed")
                    .get()
                    .map {
                        it.call.createdBy
                    }.map {
                        val name = it.name
                        val image = it.image
                        Pair(name, image)
                    }.getOrNull()

Let me know if it works for you or if there is any way we can help you further.

vinodkumarsagitla commented 3 months ago

@aleksandar-apostolov Thanks for your suggestions.

But this is not a best solution for me because we have list of calls (for e.g 25 records) ( QueriedCalls(calls=[...], next=null, prev=null) ) then we need to make request multiple times(e.g. 25 times) for get values for each calls in list.

So please can you have any other way to get this data for multiple calls at single request

vinodkumarsagitla commented 3 months ago

@aleksandar-apostolov Any update?

aleksandar-apostolov commented 2 months ago

Hey @vinodkumarsagitla Sorry for the delay in response, currently I see no other way to do it. We will pick it up as a feature request, but this is low on our priority list.

Will keep you posted.

Regards, Alex