1

I used the backend to obtain the Access Token, and connect (auto-create) to a room like this -

room = await Video.connect(accessToken, {
    video: true,
    audio: true,
    name: "Room1",
});

I looked at ConnectOptions and I don't see anywhere that I can set the maxParticipantDuration for the room. Does anyone know where to set this? I know this can be set if the room is created using Rest API. Is this option not available if using the JavaScript SDK?

Rest API to Set maxParticipantDuration

Joe
  • 86
  • 6

1 Answers1

1

No option in JavaScript SDK for the maximum Participant duration

From the manual

If you wish to configure the maximum Participant duration for you Video Rooms, you can do so in two ways: via the Twilio REST API, or via the Twilio Console.

BY API

// Download the helper library from https://www.twilio.com/docs/node/install
// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = require('twilio')(accountSid, authToken);

client.video.v1.rooms
               .create({
                  maxParticipantDuration: 86400,
                  uniqueName: 'My Video Room'
                })
               .then(room => console.log(room.sid));

enter image description here

By Twilio Console enter image description here

So no option for maximum Participant duration in ConnectOptions here from JavaScript SDK

export interface ConnectOptions {
  audio?: boolean | CreateLocalTrackOptions| CreateLocalAudioTrackOptions;
  automaticSubscription?: boolean;
  bandwidthProfile?: BandwidthProfileOptions;
  dominantSpeaker?: boolean;

  /**
   * @deprecated use enableDscp
   */
  dscpTagging?: boolean;
  enableDscp?: boolean;

  /**
   * @deprecated use Video.Logger
   */
  loggerName?: string;
  eventListener?: EventListener;
  iceServers?: Array<RTCIceServer>;
  iceTransportPolicy?: RTCIceTransportPolicy;
  insights?: boolean;
  maxAudioBitrate?: number | null;
  maxVideoBitrate?: number | null;
  name?: string | null;
  networkQuality?: boolean | NetworkQualityConfiguration;
  notifyWarnings?: Array<NotifyWarning>;
  region?: string;
  preferredAudioCodecs?: Array<AudioCodec | AudioCodecSettings | OpusCodecSettings>;
  preferredVideoCodecs?: Array<VideoCodec | VideoCodecSettings | VP8CodecSettings> | VideoEncodingMode;

  /**
   * @deprecated use Video.Logger.
   */
  logLevel?: LogLevel | LogLevels;

  tracks?: Array<LocalTrack | MediaStreamTrack>;
  video?: boolean | CreateLocalTrackOptions;
}
Bench Vue
  • 5,257
  • 2
  • 10
  • 14
  • Thank you. I was able to come up with a solution over the weekend by first creating the Room using Rest API, and passing the Room name to the client. It is a bit tricky because I have to check if the Room already exists by calling another API, but I got it working. – Joe Dec 12 '22 at 06:13
  • I glad to hear to address by REST API your problem. – Bench Vue Dec 12 '22 at 10:38