Skip to content

getting "TypeError: undefined is not an object" when I create a videoConferenceChat #326

Open

Description

@Dun-sin

full error: TypeError: undefined is not an object (evaluating 'this.Transport.prototype'

Activity

  1. changed the title [-]getting "TypeError: undefined is not an object" when I create a videoConferenceChat of close one[/-] [+]getting "TypeError: undefined is not an object" when I create a videoConferenceChat[/+] on Jan 9, 2025
  2. DaveLomber commented on Jan 10, 2025

    @DaveLomber
    Collaborator

    Hey @Dun-sin
    could you specify what exact APIs causes this error

  3. Dun-sin commented on Jan 10, 2025

    @Dun-sin
    Author

    Hey @Dun-sin could you specify what exact APIs causes this error

    i'm running the react native sample file and changed a few things to integrate guest logining in to connectytube, when i click on calling i get that error.

    From debugging it seems to come from this line:
    this._session = ConnectyCube.videochatconference.createNewSession();

    in this function:

    joinConf(retry) {
        this._session = ConnectyCube.videochatconference.createNewSession();
        return this.getUserMedia().then(
          (stream) => {
            this._session.join(
              this.janusRoomId,
              CallService.CURRENT_USER.id,
              CallService.CURRENT_USER.full_name,
            );
    
            return stream;
          },
          (error) => {
            console.log('[Get user media error]', error, this.mediaParam);
            if (!retry) {
              this.mediaParams.video = false;
              return this.joinConf(this.janusRoomId, true);
            }
          },
        );
      }
    

    the error also happens when the stop call button is clicked, which runs this code:
    ConnectyCube.videochatconference.clearSession(this._session.id);

  4. DaveLomber commented on Jan 13, 2025

    @DaveLomber
    Collaborator

    @Dun-sin it seems you missed the logic to connect to chat after your modifications

    Make sure you still have this code to connect to chat, it could be called right after you created a guest session

    ConnectyCube.chat.connect({
       userId: user.id,
      password: user.password,
    });
    
  5. Dun-sin commented on Jan 13, 2025

    @Dun-sin
    Author

    @Dun-sin it seems you missed the logic to connect to chat after your modifications

    Make sure you still have this code to connect to chat, it could be called right after you created a guest session

    ConnectyCube.chat.connect({
       userId: user.id,
      password: user.password,
    });
    

    I thought the guest session meant I didn't need a user to be logged in?

  6. DaveLomber commented on Jan 13, 2025

    @DaveLomber
    Collaborator

    Guest session means a session will be created with temporary guest user:

    • user will be automatically created
    • session with guest user valid for 1 day after user will be automatically deleted.

    So it still provides a meaning of user, hence you need to still connect to chat

  7. Dun-sin commented on Jan 13, 2025

    @Dun-sin
    Author

    Guest session means a session will be created with temporary guest user:

    • user will be automatically created
    • session with guest user valid for 1 day after user will be automatically deleted.

    So it still provides a meaning of user, hence you need to still connect to chat

    So the guest user still needs to provide a username and password

  8. DaveLomber commented on Jan 13, 2025

    @DaveLomber
    Collaborator

    @Dun-sin password not required in this case when connect to chat, a session token should be used for password, e.g.

    const session = await ConnectyCube.createSession({
      guest: "1",
      full_name: "Sam",
    });
        
    const sessionToken = session.token;
    const currentUserId = session.user_id;
    
    await ConnectyCube.chat.connect({
      userId: currentUserId,
      password: sessionToken,
    });
    
  9. Dun-sin commented on Jan 13, 2025

    @Dun-sin
    Author

    @Dun-sin password not required in this case when connect to chat, a session token should be used for password, e.g.

    const session = await ConnectyCube.createSession({
      guest: "1",
      full_name: "Sam",
    });
        
    const sessionToken = session.token;
    const currentUserId = session.user_id;
    
    await ConnectyCube.chat.connect({
      userId: currentUserId,
      password: sessionToken,
    });
    

    Thank you🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions