AudioVideoControllerFacade
@objc
public protocol AudioVideoControllerFacade
AudioVideoControllerFacade manages the signaling and peer connections.
-
Declaration
Swift
var configuration: MeetingSessionConfiguration { get } -
Declaration
Swift
var logger: Logger { get } -
Start AudioVideo Controller
Throws
MediaError.audioFailedToStartif audio client failed to startThrows
MediaError.illegalStateif audio client is already started before calling start()Declaration
Swift
func start(audioVideoConfiguration: AudioVideoConfiguration) throwsParameters
audioVideoConfigurationThe configuration used for Audio & Video
-
Start AudioVideo Controller
Throws
MediaError.audioFailedToStartif audio client failed to startThrows
MediaError.illegalStateif audio client is already started before calling start()Declaration
Swift
func start(callKitEnabled: Bool) throwsParameters
callKitEnabledA Bool value to indicate whether the VoIP call to start has CallKit integration. This parameter is used to determine how audio session interruptions should be handled, in scenarios such as receving another phone call during the VoIP call.
-
Start AudioVideo Controller
Throws
MediaError.audioFailedToStartif audio client failed to startThrows
MediaError.illegalStateif audio client is already started before calling start()Declaration
Swift
func start() throws -
Stop AudioVideo Controller. This will exit the meeting
Declaration
Swift
func stop() -
Start local video and begin transmitting frames from an internally held
DefaultCameraCaptureSource.stopLocalVideowill stop the internal capture source if being used.Calling this after passing in a custom
VideoSourcewill replace it with the internal capture source.This function will only have effect if
starthas already been calledDeclaration
Swift
func startLocalVideo() throws -
Start local video with configurations and begin transmitting frames from an internally held
DefaultCameraCaptureSource.stopLocalVideowill stop the internal capture source if being used.Calling this after passing in a custom
VideoSourcewill replace it with the internal capture source.This function will only have effect if
starthas already been called If maxBitRateKbps is not set, it will be self adjusted depending on number of users and videos in the meetingDeclaration
Swift
func startLocalVideo(config: LocalVideoConfiguration) throwsParameters
configconfigurations of emitted video stream, e.g. simulcast, maxBitRateKbps
-
Start local video with a provided custom
VideoSourcewhich can be used to provide customVideoFrames to be transmitted to remote clients. This will callVideoSource.addVideoSinkon the provided source.Calling this function repeatedly will replace the previous
VideoSourceas the one being transmitted. It will also stop and replace the internal capture source ifstartLocalVideowas previously called with no arguments.This function will only have effect if
starthas already been calledDeclaration
Swift
func startLocalVideo(source: VideoSource)Parameters
sourceThe source of video frames to be sent to other clients
-
Start local video with configurations and a provided custom
VideoSourcewhich can be used to provide customVideoFrames to be transmitted to remote clients. This will callVideoSource.addVideoSinkon the provided source.Calling this function repeatedly will replace the previous
VideoSourceas the one being transmitted. It will also stop and replace the internal capture source ifstartLocalVideowas previously called with no arguments.This function will only have effect if
starthas already been called If maxBitRateKbps is not set, it will be self adjusted depending on number of users and videos in the meetingDeclaration
Swift
func startLocalVideo(source: VideoSource, config: LocalVideoConfiguration)Parameters
sourceThe source of video frames to be sent to other clients
configConfigurations of emitted video stream, e.g. simulcast, maxBitRateKbps
-
Stops sending video for local attendee. This will additionally stop the internal capture source if being used. If using a custom video source, this will call
VideoSource.removeVideoSinkon the previously provided source.Declaration
Swift
func stopLocalVideo() -
Enable remote video to start receiving streams
Declaration
Swift
func startRemoteVideo() -
Disable remote video to stop receiving streams
Declaration
Swift
func stopRemoteVideo() -
Subscribe to audio, video, and connection events with an
AudioVideoObserver.Declaration
Swift
func addAudioVideoObserver(observer: AudioVideoObserver)Parameters
observerThe observer to subscribe to events with
-
Unsubscribes from audio, video, and connection events by removing specified
AudioVideoObserver.Declaration
Swift
func removeAudioVideoObserver(observer: AudioVideoObserver)Parameters
observerThe observer to unsubscribe from events with
-
Subscribe to metrics events with an
MetricsObserver.Declaration
Swift
func addMetricsObserver(observer: MetricsObserver)Parameters
observerThe observer to subscribe to events with
-
Unsubscribes from metrics events by removing specified
MetricsObserver.Declaration
Swift
func removeMetricsObserver(observer: MetricsObserver)Parameters
observerThe observer to unsubscribe from events with
-
Add, update, or remove subscriptions to remote video sources provided via
remoteVideoSourcesDidBecomeAvailable.This function requires using the
RemoteVideoSourceprovided byremoteVideoSourcesDidBecomeAvailable, otherwise it will not update properly. This is what allows to use theRemoteVideoSourceobjects as keys in a map.Including a
RemoteVideoSourceinaddedOrUpdatedwhich was not previously provided will result in the negotiation of media flow for that source. After negotiation has completed,videoTileDidAddon the tile controller will be called with theTileStateof the source, and applications can render the video via ‘bindVideoTile’. Reincluding aRemoteVideoSourcecan be done to update the providedVideoSubscriptionConfiguration, but it is not necessary to continue receiving frames.Including a
RemoteVideoSourceinremovedwill stop the flow video from that source, and lead to avideoTileDidRemovecall on the tile controller to indicate to the application that the tile should be unbound. To restart the flow of media, the source should be re-added by including inaddedOrUpdated. Note that videos no longer available in a meeting (i.e. listed inremoteVideoSourcesDidBecomeUnavailabledo not need to be removed, as they will be automatically unsubscribed from.Note that before this function is called for the first time, the client will automatically subscribe to all video sources. However this behavior will cease upon first call (e.g. if there are 10 videos in the meeting, the controller will subscribe to all 10, however if
updateVideoSourceSubscriptionsis called with a single video inaddedOrUpdated, the client will unsubscribe from the other 9. This automatic subscription behavior may be removed in future major version updates, builders should avoid relying on the logic and instead explicitly callupdateVideoSourceSubscriptionswith the sources they want to receive.Declaration
Swift
func updateVideoSourceSubscriptions(addedOrUpdated: Dictionary<RemoteVideoSource, VideoSubscriptionConfiguration>, removed: Array<RemoteVideoSource>)Parameters
addedOrUpdatedDictionary of remote video sources to configurations to add or update
removedArray of remote video sources to remove
-
Allows an attendee in a Replica meeting to immediately transition to a Primary meeting attendee without need for reconnection.
PrimaryMeetingPromotionObserver.didPromoteToPrimaryMeetingwill be called exactly once onobserverfor each call. If the promotion is successful,PrimaryMeetingPromotionObserver.didDemoteFromPrimaryMeetingwill 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.videoSessionDidStartWithStatuswithoutMeetingSessionStatusCode.VideoAtCapacityViewOnlyto indicate they can begin to share video.chime::DeleteAttendeeon the Primary meeting attendee will result inPrimaryMeetingPromotionObserver.didDemoteFromPrimaryMeetingto 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.didDemoteFromPrimaryMeeting; if the attendee still needs to be an interactive participant in the Primary meeting,promoteToPrimaryMeetingshould 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.didPromoteToPrimaryMeetingis called for the first time. Doing so may result in unexpected behavior.Declaration
Swift
func promoteToPrimaryMeeting(credentials: MeetingSessionCredentials, observer: PrimaryMeetingPromotionObserver)Parameters
credentialsThe credentials for the primary meeting. This needs to be obtained out of band.
observerWill be called with a session status for the request and possible demotion. See possible options above.
-
Remove the promoted attendee from the Primary meeting. This client will stop sharing audio, video, and data messages. This will revert the end-user to precisely the state they were before a call to
promoteToPrimaryMeetingThis will have no effect if there was no previous successful call to
promoteToPrimaryMeeting. This may result inPrimaryMeetingPromotionObserver.didPromoteToPrimaryMeetingbut there is no need to wait for that callback to revert UX, etc.Declaration
Swift
func demoteFromPrimaryMeeting()