twilio / twilio-video.js

Twilio’s Programmable Video JavaScript SDK
https://www.twilio.com/docs/video/javascript
Other
571 stars 217 forks source link

remote participants networkQualityLevel returns null #1679

Closed alejo9226 closed 1 year ago

alejo9226 commented 2 years ago

Trying to access room participants network quality for hosts debugging purposes but getting null even when room settings have been set as 2 for both local participants and remote participants

Code to reproduce the issue:

// export default function useConnectionOptions() {
  const { roomType, settings } = useAppState();

  // See: https://sdk.twilio.com/js/video/releases/2.0.0/docs/global.html#ConnectOptions
  // for available connection options.
  const connectionOptions: ConnectOptions = {
    // Bandwidth Profile, Dominant Speaker, and Network Quality
    // features are only available in Small Group or Group Rooms.
    // Please set "Room Type" to "Group" or "Small Group" in your
    // Twilio Console: https://www.twilio.com/console/video/configure
    // video: { height: 720, frameRate: 24, width: 1280 },
    bandwidthProfile: {
      video: {
        mode: settings.bandwidthProfileMode,
        dominantSpeakerPriority: settings.dominantSpeakerPriority,
        trackSwitchOffMode: settings.trackSwitchOffMode,
        contentPreferencesMode: settings.contentPreferencesMode,
        clientTrackSwitchOffControl: settings.clientTrackSwitchOffControl,
      },
    },
    dominantSpeaker: true,
    networkQuality: { local: 2, remote: 2 },

    // Comment this line if you are playing music.
    maxAudioBitrate: Number(settings.maxAudioBitrate),

    // VP8 simulcast enables the media server in a Small Group or Group Room
    // to adapt your encoded video quality for each RemoteParticipant based on
    // their individual bandwidth constraints. Simulcast should be disabled if
    // you are using Peer-to-Peer or 'Go' Rooms.
    preferredVideoCodecs: [{ codec: 'VP8', simulcast: roomType !== 'peer-to-peer' && roomType !== 'go' }],

    //@ts-ignore - Internal use only. This property is not exposed in type definitions.
    environment: process.env.REACT_APP_TWILIO_ENVIRONMENT,
  };

  // For mobile browsers, limit the maximum incoming video bitrate to 2.5 Mbps.
  if (isMobile && connectionOptions?.bandwidthProfile?.video) {
    connectionOptions!.bandwidthProfile!.video!.maxSubscriptionBitrate = 2500000;
  }

  if (process.env.REACT_APP_TWILIO_ENVIRONMENT === 'dev') {
    //@ts-ignore - Internal use only. This property is not exposed in type definitions.
    connectionOptions!.wsServer = 'wss://us2.vss.dev.twilio.com/signaling';
  }

  // Here we remove any 'undefined' values. The twilio-video SDK will only use defaults
  // when no value is passed for an option. It will throw an error when 'undefined' is passed.
  return removeUndefineds(connectionOptions);
}

Expected behavior:

Get the network quality level of the remote participants

Actual behavior:

Getting null for the networkQualityLevel and networkQualityStats on remote participants

Screen Shot 2022-01-14 at 4 36 25 PM

TODO

Software versions:

charliesantos commented 2 years ago

Hi @alejo9226 , thank you for the report. I created an internal ticket to investigate further.

charliesantos commented 2 years ago

Hi @alejo9226 can you please try on the latest release?

keminkasundra commented 2 years ago

@charliesantos I had tried using latest version @2.21.1 and connection settings were networkQuality: { local: 2, remote: 2 }, still getting null for networkQualityLevel. image

charliesantos commented 2 years ago

@keminkasundra can you please post your connect options here and provide me a room sid?

hitesh033 commented 2 years ago

I am facing the same problem. Remote participant always holds a null value for networkQualityLevel. I am using a latest release 2.21.1 Any solution for this yet?

LorenzoLopez200123 commented 1 year ago

any solution for this yet??

android717 commented 3 months ago

any Answer?