meeting module

Interact with meetings, including retrieving meeting details, getting mic status, and sharing app content. This namespace is used to handle meeting related functionality like get meeting details, get/update state of mic, sharing app content and more.

To learn more, visit https://aka.ms/teamsmeetingapps

Interfaces

IAppContentStageSharingCapabilities

Represents app permission to share contents to meeting.

IAppContentStageSharingState

Represents app being shared to stage.

IShareAppContentToStageOptions

Defines additional sharing options which can be provided to the shareAppContentToStage API.

ISpeakingState

Property bag for the speakingState changed event

JoinMeetingParams

Contains information associated with parameters required for joining the Microsoft Teams meetings. More details regarding parameters can be found at: Online Meeting Base - Microsoft Graph v1.0

LiveStreamState

Represents the current Real-Time Messaging Protocol (RTMP) live streaming state of a meeting.

Type Aliases

errorCallbackFunctionType

Error callback function type

getAppContentCallbackFunctionType

Get app content stage sharing capabilities callback function type

getAppContentStageCallbackFunctionType

Get app content stage sharing state callback function type

getLiveStreamStateCallbackFunctionType

Get live stream state callback function type

liveStreamErrorCallbackFunctionType

Live stream error callback function type

registerLiveStreamChangedHandlerFunctionType

Register live stream changed handler function type

registerSpeakingStateChangeHandlerFunctionType

Register speaking state change handler function type

Enums

EventActionSource

The source of the join button click.

SharingProtocol

Represents the protocol option for sharing app content to the meeting stage.

Functions

getAppContentStageSharingCapabilities(getAppContentCallbackFunctionType)

Allows an app to request whether the local user's app version has the required app manifest permissions to share content to meeting stage. To learn more, visit https://aka.ms/teamsjs/getAppContentStageSharingCapabilities

getAppContentStageSharingState(getAppContentStageCallbackFunctionType)

Provides information related to current stage sharing state for your app. To learn more, visit https://aka.ms/teamsjs/getAppContentStageSharingState

getIncomingClientAudioState(errorCallbackFunctionType)

Allows an app to get the incoming audio speaker setting for the meeting user. To learn more, visit https://aka.ms/teamsjs/getIncomingClientAudioState

getLiveStreamState(getLiveStreamStateCallbackFunctionType)

Allows an app to get the state of the outgoing live stream in the current meeting.

joinMeeting(JoinMeetingParams)

This function is used to join a meeting. This opens a meeting in a new window for the desktop app. In case of a web app, it will close the current app and open the meeting in the same tab. There is currently no support or experience for this on mobile platforms.

registerLiveStreamChangedHandler(registerLiveStreamChangedHandlerFunctionType)

Registers an event handler for state changes to the live stream.

registerSpeakingStateChangeHandler(registerSpeakingStateChangeHandlerFunctionType)

Registers a handler for changes to participant speaking states. To learn more, visit https://aka.ms/teamsjs/registerSpeakingStateChangeHandler

requestStartLiveStreaming(liveStreamErrorCallbackFunctionType, string, string)

Allows an app to ask the local user to begin live streaming the current meeting to the given Real-Time Messaging Protocol (RTMP) stream url. A confirmation dialog will be shown to the local user with options to "Allow" or "Cancel" this request.

requestStopLiveStreaming(liveStreamErrorCallbackFunctionType)

Allows an app to request that live streaming be stopped.

shareAppContentToStage(errorCallbackFunctionType, string, IShareAppContentToStageOptions)

Allows an app to share a given URL to the meeting stage for all users in the meeting. To learn more, visit https://aka.ms/teamsjs/shareAppContentToStage

toggleIncomingClientAudio(errorCallbackFunctionType)

Allows an app to toggle the incoming audio speaker setting for the meeting user from mute to unmute or vice-versa. To learn more, visit https://aka.ms/teamsjs/toggleIncomingClientAudio

Function Details

getAppContentStageSharingCapabilities(getAppContentCallbackFunctionType)

Allows an app to request whether the local user's app version has the required app manifest permissions to share content to meeting stage. To learn more, visit https://aka.ms/teamsjs/getAppContentStageSharingCapabilities

function getAppContentStageSharingCapabilities(callback: getAppContentCallbackFunctionType)

Parameters

callback
getAppContentCallbackFunctionType

Completion callback contains 2 parameters: error and appContentStageSharingCapabilities. error can either contain an error of type SdkError (error indication), or null (non-error indication). appContentStageSharingCapabilities will contain an IAppContentStageSharingCapabilities object if the request succeeds, or null if it failed.

Remarks

If you are updating your published app to include the share to stage feature, you can use this API to prompt users to update their app if they are using an older version. Your app's configurableTabs or staticTabs entry's context array must include meetingStage for doesAppHaveSharePermission to be true in the callback response.

getAppContentStageSharingState(getAppContentStageCallbackFunctionType)

Provides information related to current stage sharing state for your app. To learn more, visit https://aka.ms/teamsjs/getAppContentStageSharingState

function getAppContentStageSharingState(callback: getAppContentStageCallbackFunctionType)

Parameters

callback
getAppContentStageCallbackFunctionType

Callback contains 2 parameters, error and appContentStageSharingState. error can either contain an error of type SdkError (error indication), or null (non-error indication) appContentStageSharingState can either contain an IAppContentStageSharingState object if the request succeeds, or null if it failed

Remarks

This API can only be used in the sidePanel and meetingStage frame contexts. For private scheduled meetings, meet now, or calls, include the MeetingStage.Write.Chat RSC permission in your app manifest. For channel meetings, include the ChannelMeetingStage.Write.Group RSC permission in your app manifest. Find the app manifest reference at https://aka.ms/teamsAppManifest/authorization.

getIncomingClientAudioState(errorCallbackFunctionType)

Allows an app to get the incoming audio speaker setting for the meeting user. To learn more, visit https://aka.ms/teamsjs/getIncomingClientAudioState

function getIncomingClientAudioState(callback: errorCallbackFunctionType)

Parameters

callback
errorCallbackFunctionType

Callback contains 2 parameters, error and result. error can either contain an error of type SdkError, in case of an error, or null when fetch is successful. result will be true when incoming audio is muted and false when incoming audio is unmuted, or null when the request fails.

Remarks

Use toggleIncomingClientAudio to toggle the current audio state. For private scheduled meetings, meet now, or calls, include the OnlineMeetingParticipant.ToggleIncomingAudio.Chat RSC permission in your app manifest. Find the app manifest reference at https://aka.ms/teamsAppManifest/authorization. This API can only be used in the sidePanel and meetingStage frame contexts.

getLiveStreamState(getLiveStreamStateCallbackFunctionType)

Allows an app to get the state of the outgoing live stream in the current meeting.

function getLiveStreamState(callback: getLiveStreamStateCallbackFunctionType)

Parameters

callback
getLiveStreamStateCallbackFunctionType

Callback contains 2 parameters: error and liveStreamState. error can either contain an error of type SdkError, in case of an error, or null when the request is successful liveStreamState can either contain a LiveStreamState value, or null when operation fails

Remarks

Use requestStartLiveStreaming or requestStopLiveStreaming to start/stop a live stream. This API can only be used in the sidePanel frame context. The meetingExtensionDefinition.supportsStreaming field in your app manifest must be true to use this API. Find the app manifest reference at https://aka.ms/teamsAppManifest/meetingExtensionDefinition.

joinMeeting(JoinMeetingParams)

This function is used to join a meeting. This opens a meeting in a new window for the desktop app. In case of a web app, it will close the current app and open the meeting in the same tab. There is currently no support or experience for this on mobile platforms.

function joinMeeting(joinMeetingParams: JoinMeetingParams): Promise<void>

Parameters

joinMeetingParams
JoinMeetingParams

This takes JoinMeetingParams for joining the meeting. If source isn't passed then it is marked as 'Other' by default.

Returns

Promise<void>

registerLiveStreamChangedHandler(registerLiveStreamChangedHandlerFunctionType)

Registers an event handler for state changes to the live stream.

function registerLiveStreamChangedHandler(handler: registerLiveStreamChangedHandlerFunctionType)

Parameters

handler
registerLiveStreamChangedHandlerFunctionType

The handler to invoke when the live stream state changes

Remarks

Only one handler can be registered at a time. A subsequent registration replaces an existing registration. Use requestStartLiveStreaming or requestStopLiveStreaming to start/stop a live stream. This API can only be used in the sidePanel frame context. The meetingExtensionDefinition.supportsStreaming field in your app manifest must be true to use this API. Find the app manifest reference at https://aka.ms/teamsAppManifest/meetingExtensionDefinition.

registerSpeakingStateChangeHandler(registerSpeakingStateChangeHandlerFunctionType)

Registers a handler for changes to participant speaking states. To learn more, visit https://aka.ms/teamsjs/registerSpeakingStateChangeHandler

function registerSpeakingStateChangeHandler(handler: registerSpeakingStateChangeHandlerFunctionType)

Parameters

handler
registerSpeakingStateChangeHandlerFunctionType

The handler to invoke when the speaking state of any participant changes (start/stop speaking).

Remarks

This API returns ISpeakingState, which will have isSpeakingDetected and/or an error object. If any participant is speaking, isSpeakingDetected will be true, or false if no participants are speaking. Only one handler can be registered at a time. Subsequent registrations replace existing registrations. This API can only be used in the sidePanel and meetingStage frame contexts. For private scheduled meetings, meet now, or calls, include the OnlineMeetingIncomingAudio.Detect.Chat RSC permission in your app manifest. For channel meetings, include the OnlineMeetingIncomingAudio.Detect.Group RSC permission in your app manifest. Find the app manifest reference at https://aka.ms/teamsAppManifest/authorization.

requestStartLiveStreaming(liveStreamErrorCallbackFunctionType, string, string)

Allows an app to ask the local user to begin live streaming the current meeting to the given Real-Time Messaging Protocol (RTMP) stream url. A confirmation dialog will be shown to the local user with options to "Allow" or "Cancel" this request.

function requestStartLiveStreaming(callback: liveStreamErrorCallbackFunctionType, streamUrl: string, streamKey?: string)

Parameters

callback
liveStreamErrorCallbackFunctionType

completion callback that contains an error parameter, which can be of type SdkError in case of an error, or null when operation is successful

streamUrl

string

the url to the RTMP stream resource

streamKey

string

the key to the RTMP stream resource

Remarks

Meeting content (e.g., user video, screenshare, audio, etc.) can be externally streamed to any platform that supports the popular RTMP standard. Content broadcasted through RTMP is automatically formatted and cannot be customized. Use getLiveStreamState or registerLiveStreamChangedHandler to get updates on the live stream state. This API can only be used in the sidePanel frame context. The meetingExtensionDefinition.supportsStreaming field in your app manifest must be true to use this API. Find the app manifest reference at https://aka.ms/teamsAppManifest/meetingExtensionDefinition.

requestStopLiveStreaming(liveStreamErrorCallbackFunctionType)

Allows an app to request that live streaming be stopped.

function requestStopLiveStreaming(callback: liveStreamErrorCallbackFunctionType)

Parameters

callback
liveStreamErrorCallbackFunctionType

completion callback that contains an error parameter, which can be of type SdkError in case of an error, or null when operation is successful

Remarks

Use getLiveStreamState or registerLiveStreamChangedHandler to get updates on the live stream state. This API can only be used in the sidePanel frame context. The meetingExtensionDefinition.supportsStreaming field in your app manifest must be true to use this API. Find the app manifest reference at https://aka.ms/teamsAppManifest/meetingExtensionDefinition.

shareAppContentToStage(errorCallbackFunctionType, string, IShareAppContentToStageOptions)

Allows an app to share a given URL to the meeting stage for all users in the meeting. To learn more, visit https://aka.ms/teamsjs/shareAppContentToStage

function shareAppContentToStage(callback: errorCallbackFunctionType, appContentUrl: string, shareOptions?: IShareAppContentToStageOptions)

Parameters

callback
errorCallbackFunctionType

Callback contains 2 parameters, error and result. error can either contain an error of type SdkError, in case of an error, or null when share is successful result can either contain a true value, in case of a successful share or null when the share fails

appContentUrl

string

is the input URL to be shared to the meeting stage. the URL origin must be included in your app manifest's validDomains field.

shareOptions
IShareAppContentToStageOptions

is an object that contains additional sharing options. If omitted, the default sharing protocol will be Collaborative. See IShareAppContentToStageOptions for more information.

Remarks

This API can only be used in the sidePanel and meetingStage frame contexts. For private scheduled meetings, meet now, or calls, include the MeetingStage.Write.Chat RSC permission in your app manifest. For channel meetings, include the ChannelMeetingStage.Write.Group RSC permission in your app manifest. Find the app manifest reference at https://aka.ms/teamsAppManifest/authorization. Use getAppContentStageSharingCapabilities to determine if the local user is eligible to use this API. Use getAppContentStageSharingState to determine whether app content is already being shared to the meeting stage.

toggleIncomingClientAudio(errorCallbackFunctionType)

Allows an app to toggle the incoming audio speaker setting for the meeting user from mute to unmute or vice-versa. To learn more, visit https://aka.ms/teamsjs/toggleIncomingClientAudio

function toggleIncomingClientAudio(callback: errorCallbackFunctionType)

Parameters

callback
errorCallbackFunctionType

Callback contains 2 parameters, error and result. error can either contain an error of type SdkError, in case of an error, or null when toggle is successful. result will be true when incoming audio is muted and false when incoming audio is unmuted, or null when the toggling fails.

Remarks

Use getIncomingClientAudioState to get the current audio state. For private scheduled meetings, meet now, or calls, include the OnlineMeetingParticipant.ToggleIncomingAudio.Chat RSC permission in your app manifest. Find the app manifest reference at https://aka.ms/teamsAppManifest/authorization. This API can only be used in the sidePanel and meetingStage frame contexts.