# Call initialize before setting the stream

**URL:** https://community.livekit.io/t/call-initialize-before-setting-the-stream/1526
**Category:** Client SDKs
**Tags:** flutter
**Created:** [June 29, 2026, 1:41pm UTC](https://community.livekit.io/t/call-initialize-before-setting-the-stream/1526 "2026-06-29T13:41:05Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Marcus\_Hellkvist](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/marcus_hellkvist/32/497_2.png) [@Marcus\_Hellkvist](https://community.livekit.io/u/Marcus_Hellkvist)
#### Post date: [June 29, 2026, 1:41pm UTC](https://community.livekit.io/t/call-initialize-before-setting-the-stream/1526/1 "2026-06-29T13:41:05Z")

</div>

I am getting this error “Call initialize before setting the stream” almost every single time when i try to connect to a call. I use the example code from Github to init/show the video track. I use “livekit\_client: ^2.8.1” any ideas?

Container(

```
              alignment: Alignment.center,

              color: Colors.black,

              child: activeVideoTrack != null && !activeVideoTrack!.muted

                  ? VideoTrackRenderer(

                      fit: fit,

                      renderMode: VideoRenderMode.auto,

                      activeVideoTrack!,

                    )

                  : NoVideoWidget(name: widget.participant.name),

            ),

```

---

<div class="post-metadata">

### Author: ![CWilson](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/cwilson/32/135_2.png) [@CWilson](https://community.livekit.io/u/CWilson)
#### Post date: [June 29, 2026, 9:55pm UTC](https://community.livekit.io/t/call-initialize-before-setting-the-stream/1526/2 "2026-06-29T21:55:02Z")

</div>

I am not sure what the issue may be. Have you looked at this yet?

> <https://github.com/flutter-webrtc/dart-sip-ua/issues/413>
>
> \*\*Describe the bug\*\*
> When I make a call, I get the error "Call initialize befor…e setting the stream". I am using the asterisk test server.
> 
> \*\*To Reproduce\*\*
> Steps to reproduce the behaviour:
> 1. Make a call
> 
> \*\*Expected behaviour\*\*
> A call must be created and a connection must be established.
> 
> \*\*System Infomation()\*\*
> Flutter SDK Version: 3.16.3
> sip\_ua Version: 0.5.8

---

<div class="post-metadata">

### Author: ![darryncampbell](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/darryncampbell/32/20_2.png) [@darryncampbell](https://community.livekit.io/u/darryncampbell)
#### Post date: [June 30, 2026, 9:02am UTC](https://community.livekit.io/t/call-initialize-before-setting-the-stream/1526/3 "2026-06-30T09:02:20Z")

</div>

> [@Marcus\_Hellkvist](#):
>
> I use the example code from Github to init/show the video track.

Which code example are you referring to?

---

<div class="post-metadata">

### Author: ![Marcus\_Hellkvist](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/marcus_hellkvist/32/497_2.png) [@Marcus\_Hellkvist](https://community.livekit.io/u/Marcus_Hellkvist)
#### Post date: [June 30, 2026, 9:19am UTC](https://community.livekit.io/t/call-initialize-before-setting-the-stream/1526/4 "2026-06-30T09:19:02Z")

</div>

sorta the whole thing from their livekit flutter sdk github with connecting to rooms and widget to show video tracks.

---

<div class="post-metadata">

### Author: ![Marcus\_Hellkvist](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/marcus_hellkvist/32/497_2.png) [@Marcus\_Hellkvist](https://community.livekit.io/u/Marcus_Hellkvist)
#### Post date: [June 30, 2026, 12:17pm UTC](https://community.livekit.io/t/call-initialize-before-setting-the-stream/1526/5 "2026-06-30T12:17:27Z")

</div>

to make this work i also need to import flutter webrtc package to get ahold of that class? I mean, why do i have this issue when i only used the code example from the sdk?

---

<div class="post-metadata">

### Author: ![darryncampbell](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/darryncampbell/32/20_2.png) [@darryncampbell](https://community.livekit.io/u/darryncampbell)
#### Post date: [June 30, 2026, 12:39pm UTC](https://community.livekit.io/t/call-initialize-before-setting-the-stream/1526/6 "2026-06-30T12:39:20Z")

</div>

Do you mean this example?

> **[components-flutter/example at main · livekit/components-flutter](https://github.com/livekit/components-flutter/tree/main/example)**
>
> main/example

If so, are you modifying the example in any way?

It should just work with:

1. `flutter pub get`
2. `flutter pub run`
3. Generate room token for each user `lk token create -r test-room`

---

<div class="post-metadata">

### Author: ![Marcus\_Hellkvist](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/marcus_hellkvist/32/497_2.png) [@Marcus\_Hellkvist](https://community.livekit.io/u/Marcus_Hellkvist)
#### Post date: [July 1, 2026, 5:07pm UTC](https://community.livekit.io/t/call-initialize-before-setting-the-stream/1526/7 "2026-07-01T17:07:50Z")

</div>

no i use “[client-sdk-flutter/example at main · livekit/client-sdk-flutter · GitHub](https://github.com/livekit/client-sdk-flutter/tree/main/example)” this where i’ve copied and used this widget " [client-sdk-flutter/example/lib/widgets/participant.dart at main · livekit/client-sdk-flutter · GitHub](https://github.com/livekit/client-sdk-flutter/blob/main/example/lib/widgets/participant.dart) " I didnt know that livekit had its own repo with custom widgets other that the once found in the cliend sdk example… Which one are we suppose to use?!

I see that in the end the, the difference between the repo and video widget is a ValueKey

---

<div class="post-metadata">

### Author: ![darryncampbell](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/darryncampbell/32/20_2.png) [@darryncampbell](https://community.livekit.io/u/darryncampbell)
#### Post date: [July 2, 2026, 8:59am UTC](https://community.livekit.io/t/call-initialize-before-setting-the-stream/1526/8 "2026-07-02T08:59:57Z")

</div>

The example you are using is more foundational, to show use of the Flutter SDK itself. The components demo I shared is a bit richer and makes use of our Flutter components library which builds on top of the SDK.

If you are building a live streaming app, I would probably start with the components example. If you were building a front-end for an AI agent, I would suggest starting with [GitHub - livekit-examples/agent-starter-flutter: AI voice assistant starter app for Flutter built with LiveKit · GitHub](https://github.com/livekit-examples/agent-starter-flutter).

For your specific issue, running against [client-sdk-flutter/example at main · livekit/client-sdk-flutter · GitHub](https://github.com/livekit/client-sdk-flutter/tree/main/example) , I don’t see this issue if I do the following:

- clone repo
- `flutter pub get`
- generate two tokens using `lk token create -r test-room`
- `flutter run` (I chose Chrome)
- Open two windows
- Provide wss URL for my LiveKit cloud project and the tokens
- Enable webcam

This was just testing on my own, but I see two webcams in each Chrome tab.

---

<div class="post-metadata">

### Author: ![Marcus\_Hellkvist](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/marcus_hellkvist/32/497_2.png) [@Marcus\_Hellkvist](https://community.livekit.io/u/Marcus_Hellkvist)
#### Post date: [July 2, 2026, 9:28am UTC](https://community.livekit.io/t/call-initialize-before-setting-the-stream/1526/9 "2026-07-02T09:28:27Z")

</div>

We are just using livekit for video calls, nothing fancy, the first version we added was livekit\_client: ^1.3.0 so we have been using it for a long time and also been apart of a lot of problems and issues (which all have been solved \<3). We are doing a big migration work which also means that we are using the latest version of everything possible. I am just curious if other people are seeing the same issues as we are, because if they dont, it means that we might have other problems than the SDK itselves?

to me, it feels like a race-condition where we try to show the video track before its ready

---

<div class="post-metadata">

### Author: ![system](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/system/32/26_2.png) [@system](https://community.livekit.io/u/system)
#### Post date: [July 17, 2026, 9:29am UTC](https://community.livekit.io/t/call-initialize-before-setting-the-stream/1526/10 "2026-07-17T09:29:20Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
