AgoraIO-Community / VideoUIKit-Web-React

A Web library to simply integrate Agora Video Calling or Live Video Streaming to your website with just a few lines of code.
MIT License
50 stars 40 forks source link

[client-90051] publish error AgoraRTCException: AgoraRTCError INVALID_OPERATION: Can't publish stream, haven't joined yet! #28

Closed elenitaex5 closed 1 year ago

elenitaex5 commented 1 year ago

Hi everyone! A Bug is happening to me really suddenly. Everything worked perfectly but, in one of our test this error has to start appearing. Token and channel are well formed and created, nothing has change in our back neither in front.

When i start the call I can see my video stream for nearly 0,5 seconds and suddenly turn to black.

image

Does anybody know what is happening??

EkaanshArora commented 1 year ago

From a first glance it looks like an error because of the token. Are you updating the token? what's the validity of the token set?

elenitaex5 commented 1 year ago

We generate a new token each different call. It happens with new tokens, but in our other app we still see video stream right. We have two different frontends with same backend. Call is created exactly with same code in both. But before this error we could see two video streams with no problem and now we have this error in one of them only, no code has been changed.

This is our function to generate tokens

return RtcTokenBuilder.buildTokenWithUid(
        AGORA_APP_ID,
        AGORA_APP_CERTIFICATE,
        room,
        roomId,
        RtcRole.PUBLISHER,
        currentTime + 5184000 /* + ONE DAY */
      );

And tokens are new each call.

In other test we had expired token error but not this time.

elenitaex5 commented 1 year ago

Sorry bother you... it only happens in my pc. I try same code in my mobile device and other pc and works right. I close this issue having it in mind in case happening again.