Search code examples
twilio-video

Where is the option to set maxParticipantDuration in JavaScript SDK?


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


Solution

  • 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;
    }