Skip to content

Commit d4e66bf

Browse files
author
zhaoyongqiang
committed
fix MS-204913 视频加密为custom不显示本地预览的问题
1 parent f6617a0 commit d4e66bf

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

macOS/APIExample/Examples/Advanced/StreamEncryption/StreamEncryption.swift

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,19 +249,20 @@ class StreamEncryption: BaseViewController {
249249
self.showAlert(title: "Error", message: "enableEncryption call failed: \(ret), please check your params")
250250
}
251251
// set up local video to render your local camera preview
252-
let localVideo = videos[0]
253-
let videoCanvas = AgoraRtcVideoCanvas()
254-
videoCanvas.uid = 0
255-
// the view to be binded
256-
videoCanvas.view = localVideo.videocanvas
257-
videoCanvas.renderMode = .hidden
258-
agoraKit.setupLocalVideo(videoCanvas)
259252

260253
} else {
261254
// your own custom algorithm encryption
262255
AgoraCustomEncryption.registerPacketProcessing(agoraKit)
263256
}
264257

258+
let localVideo = videos[0]
259+
let videoCanvas = AgoraRtcVideoCanvas()
260+
videoCanvas.uid = 0
261+
// the view to be binded
262+
videoCanvas.view = localVideo.videocanvas
263+
videoCanvas.renderMode = .hidden
264+
agoraKit.setupLocalVideo(videoCanvas)
265+
265266
// start joining channel
266267
// 1. Users can only see each other after they join the
267268
// same channel successfully using the same app id.

0 commit comments

Comments
 (0)