You can publish a stream that uses a video view of your screen (instead of a camera) as the source. A client connected to the session can subscribe to the stream (and view it), just as they would subscribe to a stream that uses a camera as the source.
This topic includes the following sections:
To use the device's screen, instead of a camera, as the video source, use the PublisherKit class to use a custom video capturer. For a code sample, see the Screen-Sharing project in the samples directory of the SDK.
OTPublisherKit.videoType property to
(defined in OTPublisherKitVideoType). This flags the published stream as having a screen-sharing video source
(instead of a camera).
Before you publish a screen-sharing stream that uses the screen video type in a session that uses
the OpenTok Media Server, you should set the
property to NO. This disables the audio-only fallback feature, so that the video does not drop out
in subscribers. See The OpenTok Media Router
and media modes.
The Stream object contains a
videoType property. This can be set to one of the following values, defined in the OTStreamVideoType enum:
OTStreamVideoTypeCamera— For a standard video stream that uses a camera as the video source.
OTStreamVideoTypeScreen— a screen sharing video stream
You can subscribe to a stream that uses a screen-sharing video source in the same way that you subscribe to a stream that uses a camera as the source. See Subscribing to streams.