React Api Reference
    Preparing search index...

    Function createScreenShareVideoTrack

      • This method can be used to create screen share track using different encoding parameters and optimization mode.

      Parameters

      • Optionaloptions: {
            encoderConfig?:
                | "h360p_30fps"
                | "h480p_15fps"
                | "h480p_30fps"
                | "h720p_5fps"
                | "h720p_15fps"
                | "h720p_30fps"
                | "h1080p_15fps"
                | "h1080p_30fps";
            multiStream?: boolean;
            optimizationMode?: "text"
            | "motion"
            | "detail";
            withAudio?: "enable" | "disable";
        }
        • OptionalencoderConfig?:
              | "h360p_30fps"
              | "h480p_15fps"
              | "h480p_30fps"
              | "h720p_5fps"
              | "h720p_15fps"
              | "h720p_30fps"
              | "h1080p_15fps"
              | "h1080p_30fps"

          You can choose from the below mentioned list of values for the encoder config.

          Encoder Config Resolution Frame Rate Bitrate
          h360p_30fps 640x360 30 fps 400 kbps
          h480p_15fps 854x480 15 fps 300 kbps
          h480p_30fps 854x480 30 fps 500 kbps
          h720p_5fps 1280x720 5 fps 400 kbps
          h720p_15fps 1280x720 15 fps 1000 kbps
          h720p_30fps 1280x720 30 fps 1500 kbps
          h1080p_15fps 1920x1080 15 fps 1500 kbps
          h1080p_30fps 1920x1080 30 fps 2000 kbps

          Note

          Above mentioned encoder configurations are valid for both, landscape as well as portrait mode.

          "h720p_15fps"
          
        • OptionalmultiStream?: boolean

          It will specify if the stream should send multiple resolution layers or single resolution layer.

          false
          
        • OptionaloptimizationMode?: "text" | "motion" | "detail"

          Optimization strategy for screen sharing.

        • OptionalwithAudio?: "enable" | "disable"

          Enables or disables audio during screen sharing.

          "enable"
          

      Returns Promise<MediaStream>

      import { createScreenShareVideoTrack } from "@videosdk.live/react-sdk";

      let customTrack = await createScreenShareVideoTrack({
      optimizationMode: "motion",
      encoderConfig: "h720p_15fps",
      });