in AmazonChimeSDKDemo/AmazonChimeSDKDemo/MeetingModel.swift [623:652]
func videoTileDidAdd(tileState: VideoTileState) {
logger.info(msg: "Attempting to add video tile tileId: \(tileState.tileId)" +
" attendeeId: \(tileState.attendeeId) with size \(tileState.videoStreamContentWidth)*\(tileState.videoStreamContentHeight)")
if tileState.isContent {
screenShareModel.tileId = tileState.tileId
if activeMode == .screenShare {
screenShareModel.viewUpdateHandler?(true)
videoModel.addContentShareVideoSource()
} else {
videoModel.removeContentShareVideoSources()
}
} else {
if tileState.isLocalTile {
videoModel.setSelfVideoTileState(tileState)
if activeMode == .video {
videoModel.localVideoUpdatedHandler?()
}
} else {
videoModel.addRemoteVideoTileState(tileState, completion: {
if self.activeMode == .video {
self.videoModel.videoSubscriptionUpdatedHandler?()
} else {
// Currently not in the video view, no need to render non content share video tiles
self.videoModel.removeNonContentShareVideoSources()
}
})
}
}
videoModel.updateVideoSourceSubscription()
}