Skip to content

Commit a0dba4b

Browse files
committed
upgrade
1 parent ad183f0 commit a0dba4b

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

agora/MutilChatViewController.swift

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class MutilChatViewController: UIViewController,LDWaterflowLayoutDelegate,UICol
2222

2323
override func viewDidLoad() {
2424
super.viewDidLoad()
25-
agoraKit=AgoraRtcEngineKit.sharedEngine(withAppId: AgoraSetting.AgoraAppId, delegate: self)
26-
agoraKit.enableVideo()
25+
initAgoraEngine()
26+
setupVideo()
2727
setupLocalVideo()
2828
agoraKit.joinChannel(byKey: nil, channelName: "demo", info: nil, uid: 0) { [weak self](sid,uid,elapsed)->Void in
2929
if let weakSelf=self{
@@ -42,16 +42,28 @@ class MutilChatViewController: UIViewController,LDWaterflowLayoutDelegate,UICol
4242

4343

4444
}
45-
func setupLocalVideo(){
45+
func initAgoraEngine() {
46+
agoraKit = AgoraRtcEngineKit.sharedEngine(withAppId: AgoraSetting.AgoraAppId, delegate: self)
47+
}
48+
49+
50+
func setupVideo() {
51+
agoraKit.enableVideo()
4652
agoraKit.setVideoProfile(._VideoProfile_360P, swapWidthAndHeight: false)
47-
let videoCanvas=AgoraRtcVideoCanvas()
48-
videoCanvas.uid=localUid
49-
videoCanvas.view = remoteView
50-
videoCanvas.renderMode = .render_Fit
53+
}
54+
55+
56+
func setupLocalVideo(){
5157

58+
// let videoCanvas=AgoraRtcVideoCanvas()
59+
// videoCanvas.uid=localUid
60+
// videoCanvas.view=localVideo
61+
// videoCanvas.renderMode = .render_Adaptive
62+
// agoraKit.setupLocalVideo(videoCanvas)
5263
}
5364

5465

66+
5567
@IBAction func handUp(_ sender: Any) {
5668
agoraKit.leaveChannel(nil)
5769
remoteView.removeFromSuperview()
@@ -111,7 +123,7 @@ class MutilChatViewController: UIViewController,LDWaterflowLayoutDelegate,UICol
111123
case 1:
112124
return 1
113125
case 2:
114-
return 1
126+
return 2
115127
case 3:
116128
return 2
117129
case 4:

0 commit comments

Comments
 (0)