Giter Club home page Giter Club logo

Comments (9)

augus-zz avatar augus-zz commented on August 23, 2024 2

I could not reproduce it any more after changed the logic.

old logic

1. create client
2. join room
3. create local tracks and publish them
4. subscribe event

new logic

1. create client
2. subscribe event
3. join room
4. create local tracks and publish them

is it related to this?

or please update this doc

image

from agorawebsdk-ng.

plutoless avatar plutoless commented on August 23, 2024

looks like the 3rd people didn't subscribe 5f8e5206c9f1ff001a39e329's stream?

from agorawebsdk-ng.

augus-zz avatar augus-zz commented on August 23, 2024

@plutoless using the same logic to join room and event subscription.
not sure why it happened.

here is the rooom connect & event subscription logic

const connect = async (token: string, roomId: string, userId: string) => {
    let localTracks: {localAudioTrack?: ILocalAudioTrack; localVideoTrack?: ILocalVideoTrack } = {}      
    localTracks = await acquireLocalTracks()
    try {
      const newRoom = await AgoraRTC.createClient({
        mode: 'rtc', codec: 'vp8',
      })
      if (newRoom) {
        setRoom(newRoom)

        // Join a room
        await newRoom.join(getConfig().agoraAppId, roomId, token, userId)

        const participantJoined = async (participant: RemoteParticipant) => {
          if (!R.isEmpty(newRoom.remoteUsers)) {
            setParticipants(newRoom.remoteUsers)
          }
        }

        const participantLeft = (participant: RemoteParticipant) => {
          setParticipants(newRoom.remoteUsers)
        }

        const participantPublished = async (participant: RemoteParticipant, mediaType: 'audio' | 'video') => {
          // Subscribe to a remote user
          try {
            await newRoom.subscribe(participant, mediaType)
          } catch (error) {
          }
          if (!R.isEmpty(newRoom.remoteUsers)) {
            setParticipants(newRoom.remoteUsers)
          }
        }

        const participantUnpublished = (participant: RemoteParticipant, mediaType: string) => {
          setParticipants(newRoom.remoteUsers)
        }

        newRoom.on('user-joined', participantJoined)
        newRoom.on('user-left', participantLeft)

        // subscribe a remote user
        newRoom.on('user-published', participantPublished)
        newRoom.on('user-unpublished', participantUnpublished)
     }
}

from agorawebsdk-ng.

augus-zz avatar augus-zz commented on August 23, 2024

is there anyone help me check the log uploaded? @plutoless

from agorawebsdk-ng.

plutoless avatar plutoless commented on August 23, 2024

could you pls add some more logs before you call subscribe and after you call subscribe, + where you caught the error?

from agorawebsdk-ng.

augus-zz avatar augus-zz commented on August 23, 2024

@plutoless I did not occurred any errors.
I just did not receive user-published event sometimes.

enabled log upload. you can check the log in your server I think.
or any other way I can check it myself?

from agorawebsdk-ng.

plutoless avatar plutoless commented on August 23, 2024

if you can put console log in a txt file and upload here i can directly take a look

from agorawebsdk-ng.

augus-zz avatar augus-zz commented on August 23, 2024

@plutoless I have pasted my console log in this issue.

from agorawebsdk-ng.

plutoless avatar plutoless commented on August 23, 2024

@auguszou i mean the new logs after you add log print before/after subscribe call

from agorawebsdk-ng.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.