# AmityVideoClient.newStreamRepository().getStreams() doesn't return live streams

**URL:** <https://forum.social.plus/t/amityvideoclient-newstreamrepository-getstreams-doesnt-return-live-streams/1473>\
**Category:** Flutter\
**Created:** [October 2, 2024, 6:31pm UTC](https://forum.social.plus/t/amityvideoclient-newstreamrepository-getstreams-doesnt-return-live-streams/1473 "2024-10-02T18:31:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yarshau](https://avatars.discourse-cdn.com/v4/letter/y/a183cd/32.png) [@Yarshau](https://forum.social.plus/u/Yarshau)\
**Post date:** [October 2, 2024, 6:31pm UTC](https://forum.social.plus/t/amityvideoclient-newstreamrepository-getstreams-doesnt-return-live-streams/1473/1 "2024-10-02T18:31:03Z")

</div>

AmityVideoClient.newStreamRepository().getStreams() doesn’t return live streams

I tried to retrieve streams by two different ways:

1. 

```
  streams =
   await AmityVideoClient.newStreamRepository().getStreams().query();

```

this is single API query which you call once and it returns all the streams (included live and recorded)

1. 

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/amity/original/1X/5060d288a947a8667de0048a45cff22d79c1cdac.png)

This is streamsubscription, and I see recorded and idle (created) streams… but **the problem is - once I start livestreaming for newly created livestream - this stream is disappeared from subscription events**

And after I finish streaming video - this event return back to livestreams list with status “Recorded”

Can you resolve this issue ?

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [October 3, 2024, 12:33pm UTC](https://forum.social.plus/t/amityvideoclient-newstreamrepository-getstreams-doesnt-return-live-streams/1473/2 "2024-10-03T12:33:45Z")

</div>

Hello @Yarshau, thank you for providing the information. May I know your current Flutter SDK version, pls?

---

<div class="post-metadata">

**Author:** ![Yarshau](https://avatars.discourse-cdn.com/v4/letter/y/a183cd/32.png) [@Yarshau](https://forum.social.plus/u/Yarshau)\
**Post date:** [October 3, 2024, 1:19pm UTC](https://forum.social.plus/t/amityvideoclient-newstreamrepository-getstreams-doesnt-return-live-streams/1473/3 "2024-10-03T13:19:36Z")

</div>

[✓] Flutter (Channel stable, 3.24.3, on macOS 15.0 darwin-arm64, locale en-GB)  
amity\_sdk: ^0.51.0  
amity\_video\_player: ^0.0.3

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [October 4, 2024, 3:44am UTC](https://forum.social.plus/t/amityvideoclient-newstreamrepository-getstreams-doesnt-return-live-streams/1473/4 "2024-10-04T03:44:58Z")

</div>

Thank you @Yarshau , for providing all the necessary information. We have forwarded it to the team for further investigation. We will keep you updated on the progress.

---

<div class="post-metadata">

**Author:** ![Yarshau](https://avatars.discourse-cdn.com/v4/letter/y/a183cd/32.png) [@Yarshau](https://forum.social.plus/u/Yarshau)\
**Post date:** [October 8, 2024, 7:00am UTC](https://forum.social.plus/t/amityvideoclient-newstreamrepository-getstreams-doesnt-return-live-streams/1473/5 "2024-10-08T07:00:39Z")

</div>

Hello @SocialPlus_Support, any updates on it ?

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [October 9, 2024, 5:50am UTC](https://forum.social.plus/t/amityvideoclient-newstreamrepository-getstreams-doesnt-return-live-streams/1473/6 "2024-10-09T05:50:48Z")

</div>

Hello @Yarshau , Our team is currently working on your issue. We will update you as soon as we have more information.

Thank you for your patience. Please let us know if you need further assistance.

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [October 9, 2024, 8:54am UTC](https://forum.social.plus/t/amityvideoclient-newstreamrepository-getstreams-doesnt-return-live-streams/1473/7 "2024-10-09T08:54:05Z")

</div>

Hello @Yarshau ,  
To resolve this issue, we suggest following the example code below and subscribing to the live collection again:

```auto
void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await AmityCoreClient.setup(
      option: AmityCoreClientOption(
          apiKey: "xxxxxxxx",
          httpEndpoint: AmityRegionalHttpEndpoint.SG,
          mqttEndpoint: AmityRegionalMqttEndpoint.SG,
          showLogs: true),
      sycInitialization: true);

  runApp(const MyApp());
}

```

This should help manage the stream subscription and address the issue where live streams disappear during streaming. Please try this approach and let us know if it resolves the problem.

---

<div class="post-metadata">

**Author:** ![Yarshau](https://avatars.discourse-cdn.com/v4/letter/y/a183cd/32.png) [@Yarshau](https://forum.social.plus/u/Yarshau)\
**Post date:** [October 10, 2024, 2:44pm UTC](https://forum.social.plus/t/amityvideoclient-newstreamrepository-getstreams-doesnt-return-live-streams/1473/9 "2024-10-10T14:44:36Z")

</div>

I use AmityUIkit for setup, and doing exactly same

```auto
await AmityUIKit().setup(
          apikey: 'xxxxxx',
          region: AmityEndpointRegion.us, );

```

that not helped  
[/quote]

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [October 11, 2024, 8:15am UTC](https://forum.social.plus/t/amityvideoclient-newstreamrepository-getstreams-doesnt-return-live-streams/1473/10 "2024-10-11T08:15:03Z")

</div>

Hello @Yarshau, could you please ensure that there’s a brief delay after the setup as well?

```auto
          await AmityCoreClient.login("AUTEST_CHAT_TODAY")
                        .submit()
                        .then((value) {
                      print("login success");
                      print(value);
                    }).onError((error, stackTrace) {
                      print(error);
                    });

```

and try to subscribe to livecollection again.

**subscribe to livestream:**

```auto
 late StreamLiveCollection streamLiveCollection;
  late StreamSubscription<List<AmityStream>> _subscription;
  final _amityStream = <AmityStream>[];
  Future queryLiveStream() async {
    print("queryLiveStream");
    streamLiveCollection =
        AmityVideoClient.newStreamRepository().getStreams().status([
      AmityStreamStatus.live,
      AmityStreamStatus.ended,
      AmityStreamStatus.idle,
      AmityStreamStatus.recorded
    ]).getLiveCollection();

    _subscription =
        streamLiveCollection.getStreamController().stream.listen((streams) {
      if (streamLiveCollection.isFetching == true && streams.isEmpty) {
        // Handle loading state
        print("Loading streams...");
      } else if (streams.isNotEmpty) {
        _amityStream.clear();
        _amityStream.addAll(streams);
        for (var stream in _amityStream) {
          print("${stream.streamId} : ${stream.title} : ${stream.status}");
        }
        print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>..");
        // Update widgets if necessary
      }
    });

    WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
      streamLiveCollection.loadNext();
    });
  }

```

If you’ve followed all the steps and are still experiencing the issue, please provide your current code and our team will help review.
