Skip to content

Commit

Permalink
public initialisers
Browse files Browse the repository at this point in the history
  • Loading branch information
maxxfrazer committed Mar 24, 2023
1 parent 620969a commit 058f7ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Sources/AgoraVideoSwiftUI/AgoraManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ Use AgoraManager to set up and manage Agora RTC sessions, manage the client's ro
*/
open class AgoraManager: NSObject, ObservableObject, AgoraRtcEngineDelegate {
/// The Agora App ID for the session.
var appId: String
public let appId: String
/// The client's role in the session.
var role: AgoraClientRole = .audience {
public var role: AgoraClientRole = .audience {
didSet { engine.setClientRole(role) }
}
/// The Agora RTC Engine Kit for the session.
var engine: AgoraRtcEngineKit {
public var engine: AgoraRtcEngineKit {
let eng = AgoraRtcEngineKit.sharedEngine(withAppId: appId, delegate: self)
eng.enableVideo()
eng.setClientRole(role)
Expand All @@ -35,7 +35,7 @@ open class AgoraManager: NSObject, ObservableObject, AgoraRtcEngineDelegate {
- appId: The Agora App ID for the session.
- role: The client's role in the session. The default value is `.audience`.
*/
init(appId: String, role: AgoraClientRole = .audience) {
public init(appId: String, role: AgoraClientRole = .audience) {
self.appId = appId
self.role = role
}
Expand All @@ -45,7 +45,7 @@ open class AgoraManager: NSObject, ObservableObject, AgoraRtcEngineDelegate {

- Parameter leaveChannelBlock: An optional closure that will be called when the client leaves the channel. The closure takes an `AgoraChannelStats` object as its parameter.
*/
func leaveChannel(leaveChannelBlock: ((AgoraChannelStats) -> Void)? = nil) {
open func leaveChannel(leaveChannelBlock: ((AgoraChannelStats) -> Void)? = nil) {
self.engine.leaveChannel(leaveChannelBlock)
self.engine.stopPreview()
AgoraRtcEngineKit.destroy()
Expand Down
10 changes: 5 additions & 5 deletions Sources/AgoraVideoSwiftUI/AgoraVideoCanvasView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ public struct AgoraVideoCanvasView: UIViewRepresentable {
@StateObject var canvas = AgoraRtcVideoCanvas()

/// A weak reference to the `AgoraRtcEngineKit` object for the session.
weak var agoraKit: AgoraRtcEngineKit?
public weak var agoraKit: AgoraRtcEngineKit?

/// The user ID of the remote user whose video to display, or `0` to display the local user's video.
let uid: UInt
public let uid: UInt

/// The render mode for the view.
var renderMode: AgoraVideoRenderMode = .hidden
public var renderMode: AgoraVideoRenderMode = .hidden

/// The crop area for the view.
var cropArea: CGRect = .zero
public var cropArea: CGRect = .zero

/// The setup mode for the view.
var setupMode: AgoraVideoViewSetupMode = .replace
public var setupMode: AgoraVideoViewSetupMode = .replace

/**
Creates and configures a `UIView` for the view. This UIView will be the view the video is rendered onto.
Expand Down

0 comments on commit 058f7ef

Please sign in to comment.