Skip to content

Commit fb5ede9

Browse files
author
Arlin
committed
import video process slider and adapt new api on v3.6.2 ios
1 parent 78426b6 commit fb5ede9

File tree

4 files changed

+38
-11
lines changed

4 files changed

+38
-11
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.getId() ?? "") with uid \(uid) elapsed \(elapsed)ms", level: .info)
187+
LogUtils.log(message: "Join \(rtcChannel.getChannelId() ?? "") 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.getId() ?? ""), warning: \(warningCode.description)", level: .warning)
196+
LogUtils.log(message: "channel: \(rtcChannel.getChannelId() ?? ""), 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.getId()
225+
videoCanvas.channelId = rtcChannel.getChannelId()
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.getId()
245+
videoCanvas.channelId = rtcChannel.getChannelId()
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.startRtmpStream(withTranscoding: rtmpURL, transcoding: transcoding)
183+
agoraKit.startRtmpStreamWithTranscoding(rtmpURL, transcoding: transcoding)
184184
}
185185
else{
186186
agoraKit.startRtmpStreamWithoutTranscoding(rtmpURL)

iOS/APIExample/Examples/Advanced/VideoProcess/Base.lproj/VideoProcess.storyboard

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,12 @@
400400
<outlet property="beautySwitch" destination="HJK-u9-Pbi" id="BJi-uH-0Ej"/>
401401
<outlet property="colorEnhanceSwitch" destination="ild-oT-4Wd" id="dlM-f1-2mW"/>
402402
<outlet property="container" destination="C5w-5n-tMz" id="e3p-iz-mhh"/>
403+
<outlet property="lightenSlider" destination="nvZ-wK-6K0" id="wxG-4T-Psw"/>
404+
<outlet property="rednessSlider" destination="dYc-0b-FOH" id="sMI-zc-qtT"/>
405+
<outlet property="sharpnessSlider" destination="wq5-Fv-CoK" id="1Cc-Fv-2tb"/>
406+
<outlet property="skinProtectSlider" destination="iaY-Em-L91" id="U2Y-Es-7XI"/>
407+
<outlet property="smoothSlider" destination="85r-9h-59u" id="bf0-uT-gos"/>
408+
<outlet property="strengthSlider" destination="okH-Cz-E2u" id="FJx-Uf-cTd"/>
403409
<outlet property="virtualBgSegment" destination="64G-UU-8yO" id="Nr5-L4-p4z"/>
404410
<outlet property="virtualBgSwitch" destination="zLF-q0-KbR" id="B0F-mx-aI1"/>
405411
</connections>

iOS/APIExample/Examples/Advanced/VideoProcess/VideoProcess.swift

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ class VideoProcessMain : BaseViewController
3939
@IBOutlet weak var colorEnhanceSwitch: UISwitch!
4040
@IBOutlet weak var virtualBgSwitch: UISwitch!
4141
@IBOutlet weak var virtualBgSegment: UISegmentedControl!
42+
@IBOutlet weak var lightenSlider: UISlider!
43+
@IBOutlet weak var rednessSlider: UISlider!
44+
@IBOutlet weak var sharpnessSlider: UISlider!
45+
@IBOutlet weak var smoothSlider: UISlider!
46+
@IBOutlet weak var strengthSlider: UISlider!
47+
@IBOutlet weak var skinProtectSlider: UISlider!
48+
4249

4350
var agoraKit: AgoraRtcEngineKit!
4451
var localVideo = Bundle.loadVideoView(type: .local, audioOnly: false)
@@ -51,11 +58,8 @@ class VideoProcessMain : BaseViewController
5158

5259
override func viewDidLoad(){
5360
super.viewDidLoad()
54-
// layout render view
55-
localVideo.setPlaceholder(text: "Local Host".localized)
56-
remoteVideo.setPlaceholder(text: "Remote Host".localized)
57-
container.layoutStream(views: [localVideo, remoteVideo])
58-
61+
setupUI()
62+
5963
// set up agora instance when view loaded
6064
let config = AgoraRtcEngineConfig()
6165
config.appId = KeyCenter.AppId
@@ -124,6 +128,23 @@ class VideoProcessMain : BaseViewController
124128
}
125129
}
126130

131+
// MARK: - UI
132+
133+
func setupUI() {
134+
// layout render view
135+
localVideo.setPlaceholder(text: "Local Host".localized)
136+
remoteVideo.setPlaceholder(text: "Remote Host".localized)
137+
container.layoutStream(views: [localVideo, remoteVideo])
138+
139+
lightenSlider.value = beautifyOption.lighteningLevel
140+
rednessSlider.value = beautifyOption.rednessLevel
141+
sharpnessSlider.value = beautifyOption.sharpnessLevel
142+
smoothSlider.value = beautifyOption.smoothnessLevel
143+
strengthSlider.value = colorEnhanceOption.strengthLevel
144+
skinProtectSlider.value = colorEnhanceOption.skinProtectLevel
145+
}
146+
147+
127148
@IBAction func onChangeBeauty(_ sender:UISwitch){
128149
agoraKit.setBeautyEffectOptions(sender.isOn, options: beautifyOption)
129150
}
@@ -188,7 +209,7 @@ class VideoProcessMain : BaseViewController
188209
break
189210
case 1:
190211
source.backgroundSourceType = .color
191-
source.color = 0xFFFF
212+
source.color = 0xFFFFFF
192213
break
193214
case 2:
194215
source.backgroundSourceType = .blur

0 commit comments

Comments
 (0)