This guide explains how to share audio and video content such as screen capture or
media files in a meeting. This guide assumes you have already created a meeting and
added attendees to the meeting (see Setup section in our README for more information).
Content share methods are accessed from the
audio-video facade
belonging to the meeting session.
Content share is not supported on mobile OS like iOS and Android. Please refer to the system requirements table for more information:
Amazon Chime SDK system requirements
When calling from a browser, leave sourceId empty. This will launch the
browser's native screen capture picker.
constmeetingSession = // reference to MeetingSessionawaitmeetingSession.audioVideo.startContentShareFromScreenCapture();
When calling from Electron, build a screen capture picker into your application and
pass the sourceId of the chosen screen capture to the method. See the
desktop-capture
sample application for more information.
constmeetingSession = // reference to MeetingSessionconstsourceId = // get this from your custom Electron screen capture pickerawaitmeetingSession. audioVideo.startContentShareFromScreenCapture(sourceId);
Content shares are treated as regular audio-video attendees. The attendee ID of a
content share has a suffix of
#content.
You receive real-time attendee presence and volume indicator callbacks
for content audio and video tile updates for content video.
Add the observer with addObserver method to receive events.
In videoTileDidUpdate, bind the video tile to a video element in your app:
constmeetingSession = // reference to MeetingSessionconsttileState = // reference to tileState parameter in videoTileDidUpdateconstvideoElement = document.getElementById('video-element-id');meetingSession.audioVideo.bindVideoElement(tileState.tileId , videoElement);
Use the
isContent
property of the
TileState
to check if the video tile is a content share, and any add special logic you need
to handle the content share.
You can also use the Modality
class to determine that an attendee ID is a content share:
if (newDefaultModality(attendeeId).hasModality(DefaultModality.MODALITY_CONTENT)) {// ...special handling for content share...}
Content Share
This guide explains how to share audio and video content such as screen capture or media files in a meeting. This guide assumes you have already created a meeting and added attendees to the meeting (see Setup section in our README for more information).
Content share methods are accessed from the audio-video facade belonging to the meeting session.
Content share is not supported on mobile OS like iOS and Android. Please refer to the system requirements table for more information: Amazon Chime SDK system requirements
Share content
Using the audio-video facade, start sharing content by calling startContentShare and provide a MediaStream:
To start a screen capture, call the convenience method startContentShareFromScreenCapture.
When calling from a browser, leave
sourceId
empty. This will launch the browser's native screen capture picker.When calling from Electron, build a screen capture picker into your application and pass the
sourceId
of the chosen screen capture to the method. See the desktop-capture sample application for more information.View the content share
Content shares are treated as regular audio-video attendees. The attendee ID of a content share has a suffix of #content. You receive real-time attendee presence and volume indicator callbacks for content audio and video tile updates for content video.
To view the content share:
videoTileDidUpdate
, bind the video tile to a video element in your app:Use the isContent property of the TileState to check if the video tile is a content share, and any add special logic you need to handle the content share.
You can also use the Modality class to determine that an attendee ID is a content share:
Pause and unpause the content share
To pause and unpause the content share, call pauseContentShare and unpauseContentShare.
Stop the content share
To stop the content share, call stopContentShare.
Receive content share events
Implement methods from ContentShareObserver and add an instance of the observer using addContentShareObserver to receive events.
Apply video processing to content share
See this section in the Video Processing guide for more information.
Give feedback on this guide