Class ConnectSendTransportScreen

Sets up and connects a screen sharing transport for sending video streams.

This function supports both a primary and a local screen producer, delegating local handling to a separate function.

The configuration options for setting up the screen transport.

The target option for connecting the transport.

The screen stream to be shared.

The parameters required for setting up the screen transport.

The screen producer object to be updated.

The device object for media capabilities.

The parameters for the screen producer.

The producer transport object.

The parameters for the producer.

The function to update the screen producer object.

The function to update the producer transport object.

The function to update the local screen producer object.

The function to update the local producer transport object.

The function to get updated parameters.

Additional parameters for future use.

  • A promise that resolves once the screen transport is successfully connected and set up.

Will throw an error if there is an issue with the connection or setup process.

await connectSendTransportScreen({
stream: screenStream,
targetOption: "all",
parameters: {
screenProducer: null,
localScreenProducer: null,
device: mediaDevice,
screenParams: { encodings: [{ maxBitrate: 1500000 }] },
producerTransport: sendTransport,
localProducerTransport: localSendTransport,
params: { track: screenStream.getVideoTracks()[0] },
updateScreenProducer: setScreenProducer,
updateLocalScreenProducer: setLocalScreenProducer,
updateProducerTransport: setProducerTransport,
updateLocalProducerTransport: setLocalProducerTransport,
getUpdatedAllParams: getParams,
},
});

Constructors

Methods

  • Sets up and connects a screen sharing transport for sending video streams.

    This function supports both a primary and a local screen producer, delegating local handling to a separate function.

    Parameters

    Returns Promise<void>

    • A promise that resolves once the screen transport is successfully connected and set up.

    Will throw an error if there is an issue with the connection or setup process.

    await connectSendTransportScreen({
    stream: screenStream,
    targetOption: "all",
    parameters: {
    screenProducer: null,
    localScreenProducer: null,
    device: mediaDevice,
    screenParams: { encodings: [{ maxBitrate: 1500000 }] },
    producerTransport: sendTransport,
    localProducerTransport: localSendTransport,
    params: { track: screenStream.getVideoTracks()[0] },
    updateScreenProducer: setScreenProducer,
    updateLocalScreenProducer: setLocalScreenProducer,
    updateProducerTransport: setProducerTransport,
    updateLocalProducerTransport: setLocalProducerTransport,
    getUpdatedAllParams: getParams,
    },
    });