Skip to content

Commit e800f07

Browse files
author
xianing
committed
adapt latest sdk changes
1 parent 81bb027 commit e800f07

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

iOS/APIExample/Examples/Advanced/JoinMultiChannel/JoinMultiChannel.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ extension JoinMultiChannelMain: AgoraRtcEngineDelegate {
184184
extension JoinMultiChannelMain: AgoraRtcChannelDelegate
185185
{
186186
func rtcChannelDidJoin(_ rtcChannel: AgoraRtcChannel, withUid uid: UInt, elapsed: Int) {
187-
LogUtils.log(message: "Join \(rtcChannel.getChannelId() ?? "") with uid \(uid) elapsed \(elapsed)ms", level: .info)
187+
LogUtils.log(message: "Join \(rtcChannel.getId() ?? "") with uid \(uid) elapsed \(elapsed)ms", level: .info)
188188
}
189189
/// callback when warning occured for a channel, warning can usually be ignored, still it's nice to check out
190190
/// what is happening
@@ -193,7 +193,7 @@ extension JoinMultiChannelMain: AgoraRtcChannelDelegate
193193
/// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraWarningCode.html
194194
/// @param warningCode warning code of the problem
195195
func rtcChannel(_ rtcChannel: AgoraRtcChannel, didOccurWarning warningCode: AgoraWarningCode) {
196-
LogUtils.log(message: "channel: \(rtcChannel.getChannelId() ?? ""), warning: \(warningCode.description)", level: .warning)
196+
LogUtils.log(message: "channel: \(rtcChannel.getId() ?? ""), warning: \(warningCode.description)", level: .warning)
197197
}
198198

199199
/// callback when error occured for a channel, you are recommended to display the error descriptions on demand
@@ -222,7 +222,7 @@ extension JoinMultiChannelMain: AgoraRtcChannelDelegate
222222
videoCanvas.view = channel1 == rtcChannel ? channel1RemoteVideo.videoView : channel2RemoteVideo.videoView
223223
videoCanvas.renderMode = .hidden
224224
// set channelId so that it knows which channel the video belongs to
225-
videoCanvas.channelId = rtcChannel.getChannelId()
225+
videoCanvas.channelId = rtcChannel.getId()
226226
agoraKit.setupRemoteVideo(videoCanvas)
227227
}
228228

@@ -242,7 +242,7 @@ extension JoinMultiChannelMain: AgoraRtcChannelDelegate
242242
videoCanvas.view = nil
243243
videoCanvas.renderMode = .hidden
244244
// set channelId so that it knows which channel the video belongs to
245-
videoCanvas.channelId = rtcChannel.getChannelId()
245+
videoCanvas.channelId = rtcChannel.getId()
246246
agoraKit.setupRemoteVideo(videoCanvas)
247247
}
248248
}

iOS/APIExample/Examples/Advanced/RTMPStreaming/RTMPStreaming.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class RTMPStreamingMain: BaseViewController {
180180
// therefore we have to create a livetranscoding object and call before addPublishStreamUrl
181181
transcoding.size = CGSize(width: CANVAS_WIDTH, height: CANVAS_HEIGHT)
182182
agoraKit.setLiveTranscoding(transcoding)
183-
agoraKit.startRtmpStreamWithTranscoding(rtmpURL, transcoding: transcoding)
183+
agoraKit.startRtmpStream(withTranscoding: rtmpURL, transcoding: transcoding)
184184
}
185185
else{
186186
agoraKit.startRtmpStreamWithoutTranscoding(rtmpURL)

macOS/APIExample/Examples/Advanced/JoinMultiChannel/JoinMultiChannel.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class JoinMultipleChannel: BaseViewController {
7575
}
7676
} else {
7777
channel1?.leave()
78-
if let channelName = channel1?.getChannelId() {
78+
if let channelName = channel1?.getId() {
7979
if isPublished && channelName == selectedChannel {
8080
if let channel = getChannelByName(selectedChannel) {
8181
channel.setClientRole(.audience)
@@ -147,7 +147,7 @@ class JoinMultipleChannel: BaseViewController {
147147
}
148148
} else {
149149
channel2?.leave()
150-
if let channelName = channel2?.getChannelId() {
150+
if let channelName = channel2?.getId() {
151151
if isPublished && channelName == selectedChannel {
152152
if let channel = getChannelByName(selectedChannel) {
153153
channel.setClientRole(.audience)
@@ -258,9 +258,9 @@ class JoinMultipleChannel: BaseViewController {
258258
}
259259

260260
func getChannelByName(_ channelName: String?) -> AgoraRtcChannel? {
261-
if channel1?.getChannelId() == channelName {
261+
if channel1?.getId() == channelName {
262262
return channel1
263-
} else if channel2?.getChannelId() == channelName {
263+
} else if channel2?.getId() == channelName {
264264
return channel2
265265
}
266266
return nil
@@ -305,8 +305,8 @@ extension JoinMultipleChannel: AgoraRtcEngineDelegate {
305305

306306
extension JoinMultipleChannel: AgoraRtcChannelDelegate {
307307
func rtcChannelDidJoin(_ rtcChannel: AgoraRtcChannel, withUid uid: UInt, elapsed: Int) {
308-
LogUtils.log(message: "Join \(rtcChannel.getChannelId() ?? "") with uid \(uid) elapsed \(elapsed)ms", level: .info)
309-
selectChannelsPicker.picker.addItem(withTitle: rtcChannel.getChannelId()!)
308+
LogUtils.log(message: "Join \(rtcChannel.getId() ?? "") with uid \(uid) elapsed \(elapsed)ms", level: .info)
309+
selectChannelsPicker.picker.addItem(withTitle: rtcChannel.getId()!)
310310
if (channel1 == rtcChannel) {
311311
isJoined = true
312312
} else {
@@ -320,7 +320,7 @@ extension JoinMultipleChannel: AgoraRtcChannelDelegate {
320320
/// cn: https://docs.agora.io/cn/Voice/API%20Reference/oc/Constants/AgoraWarningCode.html
321321
/// @param warningCode warning code of the problem
322322
func rtcChannel(_ rtcChannel: AgoraRtcChannel, didOccurWarning warningCode: AgoraWarningCode) {
323-
LogUtils.log(message: "channel: \(rtcChannel.getChannelId() ?? ""), warning: \(warningCode.rawValue)", level: .warning)
323+
LogUtils.log(message: "channel: \(rtcChannel.getId() ?? ""), warning: \(warningCode.rawValue)", level: .warning)
324324
}
325325

326326
/// callback when error occured for a channel, you are recommended to display the error descriptions on demand
@@ -349,7 +349,7 @@ extension JoinMultipleChannel: AgoraRtcChannelDelegate {
349349
videoCanvas.view = channel1 == rtcChannel ? videos2[0].videocanvas : videos2[1].videocanvas
350350
videoCanvas.renderMode = .hidden
351351
// set channelId so that it knows which channel the video belongs to
352-
videoCanvas.channelId = rtcChannel.getChannelId()
352+
videoCanvas.channelId = rtcChannel.getId()
353353
agoraKit.setupRemoteVideo(videoCanvas)
354354
}
355355

@@ -369,7 +369,7 @@ extension JoinMultipleChannel: AgoraRtcChannelDelegate {
369369
videoCanvas.view = nil
370370
videoCanvas.renderMode = .hidden
371371
// set channelId so that it knows which channel the video belongs to
372-
videoCanvas.channelId = rtcChannel.getChannelId()
372+
videoCanvas.channelId = rtcChannel.getId()
373373
agoraKit.setupRemoteVideo(videoCanvas)
374374
}
375375
}

macOS/APIExample/Examples/Advanced/RTMPStreaming/RTMPStreaming.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class RTMPStreaming: BaseViewController {
102102

103103
// start publishing to this URL
104104
if transcodingEnabled {
105-
agoraKit.startRtmpStreamWithTranscoding(rtmpURL, transcoding: transcoding)
105+
agoraKit.startRtmpStream(withTranscoding: rtmpURL, transcoding: transcoding)
106106
}
107107
else {
108108
agoraKit.startRtmpStreamWithoutTranscoding(rtmpURL)
@@ -364,7 +364,7 @@ extension RTMPStreaming: AgoraRtcEngineDelegate {
364364
if !unpublishing {
365365
// start publishing to this URL
366366
if transcodingEnabled {
367-
agoraKit.startRtmpStreamWithTranscoding(url, transcoding: transcoding)
367+
agoraKit.startRtmpStream(withTranscoding: url, transcoding: transcoding)
368368
}
369369
else {
370370
agoraKit.startRtmpStreamWithoutTranscoding(url)

macOS/APIExample/Examples/Advanced/ScreenShare/ScreenShare.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class ScreenShare: BaseViewController {
7171
let params = AgoraScreenCaptureParameters()
7272
params.frameRate = fps
7373
params.dimensions = resolution.size()
74-
self.agoraKit.updateScreenCaptureParameters(params)
74+
self.agoraKit.update(params)
7575
} else {
7676
self.agoraKit.setVideoEncoderConfiguration(
7777
AgoraVideoEncoderConfiguration(
@@ -114,7 +114,7 @@ class ScreenShare: BaseViewController {
114114
let params = AgoraScreenCaptureParameters()
115115
params.frameRate = fps
116116
params.dimensions = resolution.size()
117-
self.agoraKit.updateScreenCaptureParameters(params)
117+
self.agoraKit.update(params)
118118
} else {
119119
self.agoraKit.setVideoEncoderConfiguration(
120120
AgoraVideoEncoderConfiguration(
@@ -151,7 +151,7 @@ class ScreenShare: BaseViewController {
151151
}
152152
guard let displayHint = self.selectedDisplayHint else { return }
153153
print("setScreenCapture")
154-
self.agoraKit.setScreenCaptureContentHint(displayHint)
154+
self.agoraKit.setScreenCapture(displayHint)
155155
}
156156
}
157157

@@ -203,7 +203,7 @@ class ScreenShare: BaseViewController {
203203
let params = AgoraScreenCaptureParameters()
204204
params.frameRate = fps
205205
params.dimensions = resolution.size()
206-
let result = agoraKit.startScreenCaptureByDisplayId(UInt(screen.sourceId), rectangle: .zero, parameters: params)
206+
let result = agoraKit.startScreenCapture(byDisplayId: UInt(screen.sourceId), rectangle: .zero, parameters: params)
207207

208208
if result != 0 {
209209
// Usually happens with invalid parameters
@@ -262,7 +262,7 @@ class ScreenShare: BaseViewController {
262262
let params = AgoraScreenCaptureParameters()
263263
params.frameRate = fps
264264
params.dimensions = resolution.size()
265-
let result = agoraKit.startScreenCaptureByWindowId(UInt(window.id), rectangle: .zero, parameters: params)
265+
let result = agoraKit.startScreenCapture(byWindowId: UInt(window.id), rectangle: .zero, parameters: params)
266266
if result != 0 {
267267
// Usually happens with invalid parameters
268268
// Error code description can be found at:

0 commit comments

Comments
 (0)