mootez Nabli
mootez Nabli

Reputation: 11

could not find published track : livekit in nextjs

i hope you're having a good day. I'm new to livekit and currently using it in my nextjs project and I'm facing a problem where a user connects, disconnects and then reconnects his track becomes undefined and I get this error:

enter image description here

the weired thing is if I make any change in my code and save it even if it's a console.log then the track appears. Any help is appreciated. Thanks!

Upvotes: 1

Views: 683

Answers (1)

lukasio
lukasio

Reputation: 121

Unfortunately track publications cannot persist across full reconnects. In order to make this easier to handle, the livekit client SDKs automatically republish the track for you, but the track publication will be a new publication. You'll have to query again on the participant with e.g. participant.getTrack(Track.Source.Camera)

Upvotes: 1

Related Questions