     
         
     }
+    func initAgoraEngine() {
+        agoraKit = AgoraRtcEngineKit.sharedEngine(withAppId: AgoraSetting.AgoraAppId, delegate: self)
+    }
+    
+    
+    func setupVideo() {
+        agoraKit.enableVideo()
+        agoraKit.setVideoProfile(._VideoProfile_360P, swapWidthAndHeight: false)
+    }
+    
+    
     func setupLocalVideo(){
-        agoraKit.setVideoProfile(._VideoProfile_360P, swapWidthAndHeight: false)
-        let videoCanvas=AgoraRtcVideoCanvas()
-        videoCanvas.uid=localUid
-        videoCanvas.view = remoteView
-        videoCanvas.renderMode = .render_Fit
         
+//        let videoCanvas=AgoraRtcVideoCanvas()
+//        videoCanvas.uid=localUid
+//        videoCanvas.view=localVideo
+//        videoCanvas.renderMode = .render_Adaptive
+//        agoraKit.setupLocalVideo(videoCanvas)
     }
+    
     
     
     @IBAction func handUp(_ sender: Any) {

        case 1:
            return 1
        case 2:
            return 1
        case 3:
            return 2
        case 4:

    
    override func viewDidLoad() {
        super.viewDidLoad()
        initAgoraEngine()
        setupVideo()
        setupLocalVideo()
        agoraKit.joinChannel(byKey: nil, channelName: "demo", info: nil, uid: 0) { [weak self](sid,uid,elapsed)->Void in
            if let weakSelf=self{
