Created
November 27, 2019 17:52
-
-
Save digitallysavvy/3e6dc4edcba47e65bdde8d6a4e18feb4 to your computer and use it in GitHub Desktop.
Snippet to set the video configuration within the viewDidLoad for the ARSupportAudienceViewController
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func setupLocalVideo() { | |
guard let localVideoView = self.localVideoView else { return } // get a reference to the localVideo UI element | |
// enable the local video stream | |
self.agoraKit.enableVideo() | |
// Set video encoding configuration (dimensions, frame-rate, bitrate, orientation) | |
let videoConfig = AgoraVideoEncoderConfiguration(size: AgoraVideoDimension360x360, frameRate: .fps15, bitrate: AgoraVideoBitrateStandard, orientationMode: .fixedPortrait) | |
self.agoraKit.setVideoEncoderConfiguration(videoConfig) | |
// Set up local video view | |
let videoCanvas = AgoraRtcVideoCanvas() | |
videoCanvas.uid = 0 | |
videoCanvas.view = localVideoView | |
videoCanvas.renderMode = .hidden | |
// Set the local video view. | |
self.agoraKit.setupLocalVideo(videoCanvas) | |
// stylin - round the corners for the view | |
guard let videoView = localVideoView.subviews.first else { return } | |
videoView.layer.cornerRadius = 25 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment