Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LocalVideoTrack and LocalAudio track not publishing #209

Open
Snehasish7080 opened this issue Oct 10, 2024 · 6 comments
Open

LocalVideoTrack and LocalAudio track not publishing #209

Snehasish7080 opened this issue Oct 10, 2024 · 6 comments
Labels
help wanted Extra attention is needed

Comments

@Snehasish7080
Copy link

What kind of problem do you need help?

LocalVideoTrack and LocalAudio track not publishing if user leave the channel and rejoin the same channel in next js chrome browser but it's working fine if I am using in private window of browser

@Snehasish7080 Snehasish7080 added the help wanted Extra attention is needed label Oct 10, 2024
@guoxianzhe
Copy link
Collaborator

@Snehasish7080 pls give me some error logs when you are encounter issues in next js chrome browser

@Snehasish7080
Copy link
Author

@guoxianzhe it is not showing any kind of error but when joining in first time the publis successful message can be shown in console but when we try to rejoin the same session there no message regarding publish. And these are the current scenario logs.

10:59:07:714 Agora-SDK [INFO]: [client-7f128] Joining channel success: channel: 669dfd4209f23fa94c0413926708b739321849e54ebad740,uid: 3641061825
4b7a68ae.f4cf781d1ea02768.js:1 10:59:07:726 Agora-SDK [INFO]: [client-7f128] [p2pId: 1]: P2PConnection.onICEConnectionStateChange(checking)
4b7a68ae.f4cf781d1ea02768.js:1 10:59:07:727 Agora-SDK [DEBUG]: [lock-P2PConnection-mutex-23] is not locked, current queue 0. From P2PConnection.connect
4b7a68ae.f4cf781d1ea02768.js:1 10:59:07:727 Agora-SDK [DEBUG]: [lock-P2PChannel-mutex-15] is not locked, current queue 0. From P2PChannel.connect
4b7a68ae.f4cf781d1ea02768.js:1 10:59:07:727 Agora-SDK [INFO]: [client-7f128] [p2pId: 1]: P2PConnection.onConnectionStateChange(connecting)
4b7a68ae.f4cf781d1ea02768.js:1 10:59:07:747 Agora-SDK [INFO]: [client-7f128] [pc-1] selectedcandidatepairchange: local {"candidateType":"prflx","protocol":"udp"}, remote {"candidateType":"host","protocol":"udp","address":"129.227.205.66","port":4715} )
4b7a68ae.f4cf781d1ea02768.js:1 10:59:07:747 Agora-SDK [INFO]: [client-7f128] [p2pId: 1]: P2PConnection.onDTLSTransportStateChange(connecting)
4b7a68ae.f4cf781d1ea02768.js:1 10:59:07:748 Agora-SDK [INFO]: [client-7f128] [p2pId: 1]: P2PConnection.onICEConnectionStateChange(connected)
4b7a68ae.f4cf781d1ea02768.js:1 10:59:07:748 Agora-SDK [INFO]: [client-7f128] [p2pId: 1]: P2PConnection.onICETransportStateChange(connected)
4b7a68ae.f4cf781d1ea02768.js:1 10:59:07:749 Agora-SDK [DEBUG]: [client-7f128] [pc-1] local candidate count 1
4b7a68ae.f4cf781d1ea02768.js:1 10:59:07:780 Agora-SDK [INFO]: [client-7f128] [p2pId: 1]: P2PConnection.onDTLSTransportStateChange(connected)
4b7a68ae.f4cf781d1ea02768.js:1 10:59:07:782 Agora-SDK [INFO]: [client-7f128] [p2pId: 1]: P2PConnection.onConnectionStateChange(connected)
4b7a68ae.f4cf781d1ea02768.js:1 10:59:07:921 Agora-SDK [INFO]: [client-7f128] [p2pId: 1]: P2PConnection.SelectedLocalCandidateChanged({"candidateType":"unknown","address":"unknown","port":0,"protocol":"unknown"} -> {"candidateType":"prflx","protocol":"udp"})
4b7a68ae.f4cf781d1ea02768.js:1 10:59:07:921 Agora-SDK [INFO]: [client-7f128] [p2pId: 1]: P2PConnection.SelectedRemoteCandidateChanged({"candidateType":"unknown","address":"unknown","port":0,"protocol":"unknown"} -> {"candidateType":"host","address":"129.227.205.66","port":4715,"protocol":"udp"})
4b7a68ae.f4cf781d1ea02768.js:1 10:59:08:140 Agora-SDK [DEBUG]: [lock-P2PChannel-mutex-15] is locked, current queue 1. From P2PChannel.updateRemoteRTPCapabilities
4b7a68ae.f4cf781d1ea02768.js:1 10:59:08:141 Agora-SDK [DEBUG]: [lock-P2PConnection-mutex-23] is locked, current queue 1. From P2PConnection.updateRemoteRTPCapabilities
4b7a68ae.f4cf781d1ea02768.js:1 10:59:08:141 Agora-SDK [DEBUG]: [lock-P2PChannel-mutex-15] is not locked, current queue 0. From P2PChannel.updateRemoteRTPCapabilities
4b7a68ae.f4cf781d1ea02768.js:1 10:59:08:141 Agora-SDK [DEBUG]: updateRemoteCodec, from vp9,av1,vp8,h264 to vp8,h264
4b7a68ae.f4cf781d1ea02768.js:1 10:59:08:147 Agora-SDK [DEBUG]: [lock-P2PConnection-mutex-23] is not locked, current queue 0. From P2PConnection.updateRemoteRTPCapabilities
4b7a68ae.f4cf781d1ea02768.js:1 11:01:07:715 Agora-SDK [DEBUG]: preload channel 669dfd4209f23fa94c0413926708b739321849e54ebad740, uid is 3641061825

@guoxianzhe
Copy link
Collaborator

@Snehasish7080 Yes, I didn't see any publish action being triggered in the logs after you joined the channel. How does your code handle rejoining the channel? Are you triggering publish again?

@Snehasish7080
Copy link
Author

Snehasish7080 commented Oct 11, 2024

@guoxianzhe I am using

usePublish([
    localMicrophoneTrack,
    localCameraTrack,
    screenVideoTrack,
    screenAudioTrack,
  ]);

hook for this currently. In this I am closing the tab on leaving the channel and when user rejoin the channel on page load it should be triggered automatically.

@guoxianzhe
Copy link
Collaborator

@Snehasish7080

you can only publish 1 video track in one RTCProvider, you sholud publish localCameraTrack in AgoraRTCProvider and publish screenVideoTrack in AgoraRTCScreenShareProvider

@Snehasish7080
Copy link
Author

@guoxianzhe there is only one RTCProvider and I am publishing one video track as on page load it will re initiate everything.
Currently I am doing like this.
const AgoraComponent = () => { const client = AgoraRTC.createClient({ mode: "rtc", codec: "vp8" }); client.enableAudioVolumeIndicator(); return ( <StrictMode> <AgoraRTCProvider client={client}> <AgoraRTCScreenShareProvider client={client}> <VideoComponent client={client} /> </AgoraRTCScreenShareProvider> </AgoraRTCProvider> </StrictMode> ); };

<VideoComponent client={client} /> is containing all the necessary code for the video track and other things. And I am in next js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants