@twilio/video-node-sdk - v1.0.0-rc.3
    Preparing search index...

    Function createLocalTracks

    • Create LocalAudioTracks and LocalVideoTracks. By default, returns both a LocalAudioTrack and a LocalVideoTrack. If either audio or video is provided, the unspecified kind is omitted. Each key accepts a boolean or a per-track options object.

      Parameters

      Returns Promise<(LocalAudioTrack | LocalVideoTrack)[]>

      A promise that resolves with the created local tracks, or rejects with a TypeError if a per-track option fails validation.

      // Create both audio and video tracks.
      const tracks = await createLocalTracks();
      // Create only an audio track and connect with it.
      const tracks = await createLocalTracks({ audio: true });
      const room = await connect(token, { audioTracks: tracks });
      // Create both with custom names.
      const tracks = await createLocalTracks({
      audio: { name: 'microphone' },
      video: { name: 'camera' },
      });