amazon-chime-sdk / com.amazonaws.services.chime.sdk.meetings.audiovideo / DefaultAudioVideoController / promoteToPrimaryMeeting

# promoteToPrimaryMeeting

`fun promoteToPrimaryMeeting(credentials: MeetingSessionCredentials, observer: PrimaryMeetingPromotionObserver): Unit`

Allows an attendee in a Replica meeting to immediately transition to a Primary meeting attendee without need for reconnection.

PrimaryMeetingPromotionObserver.onPrimaryMeetingPromotion will be called exactly once on `observer` for each call. If the promotion is successful, PrimaryMeetingPromotionObserver.onPrimaryMeetingDemotion will be called exactly once if/when the attendee is demoted. See the observer documentation for possible status codes.

Application code may also receive a callback on `AudioVideoObserver.onVideoSessionStarted` without MeetingSessionStatusCode.VideoAtCapacityViewOnly to indicate they can begin to share video.

`chime::DeleteAttendee` on the Primary meeting attendee will result in PrimaryMeetingPromotionObserver.onPrimaryMeetingDemotion being called on `observer` to indicate the attendee is no longer able to share.

Any disconnection will trigger an automatic demotion to avoid unexpected or unwanted promotion state on reconnection. This will also call PrimaryMeetingPromotionObserver.onPrimaryMeetingDemotion; if the attendee still needs to be an interactive participant in the Primary meeting, promoteToPrimaryMeeting should be called again with the same credentials.

Note that given the asynchronous nature of this function, this should not be called a second time before PrimaryMeetingPromotionObserver.onPrimaryMeetingPromotion is called for the first time. Doing so may result in unexpected behavior.

### Parameters

`credentials` - The credentials for the primary meeting. This needs to be obtained out of band.

`observer` - Function to be called on promotion and possibly demotion; see note above.