Skip to content

Commit b0da106

Browse files
author
HeZhengQing
committed
[FIX] camera focal
1 parent 0984347 commit b0da106

3 files changed

Lines changed: 14 additions & 53 deletions

File tree

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

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@
4242
</connections>
4343
</switch>
4444
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Q0N-nV-bez">
45-
<rect key="frame" x="28" y="82" width="119.5" height="34.5"/>
45+
<rect key="frame" x="28" y="82" width="119.5" height="40.5"/>
4646
<state key="normal" title="Button"/>
4747
<buttonConfiguration key="configuration" style="plain" title="default color"/>
4848
<connections>
4949
<action selector="doChoseBackgroundColor:" destination="O0d-ef-mTa" eventType="touchUpInside" id="kas-nl-lc9"/>
5050
</connections>
5151
</button>
5252
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="S19-UR-C2c">
53-
<rect key="frame" x="28" y="184" width="146" height="34.5"/>
53+
<rect key="frame" x="28" y="184" width="146" height="40.5"/>
5454
<state key="normal" title="Button"/>
5555
<buttonConfiguration key="configuration" style="plain" title="preload channel"/>
5656
<connections>
@@ -65,7 +65,7 @@
6565
</connections>
6666
</button>
6767
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="leading" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ug1-fz-GYz">
68-
<rect key="frame" x="30" y="235" width="166" height="35"/>
68+
<rect key="frame" x="30" y="241" width="166" height="35"/>
6969
<constraints>
7070
<constraint firstAttribute="height" constant="35" id="2n6-ch-vfJ"/>
7171
<constraint firstAttribute="width" constant="166" id="6sx-zg-CJ4"/>
@@ -77,7 +77,7 @@
7777
</connections>
7878
</button>
7979
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZB2-jf-zOV">
80-
<rect key="frame" x="179" y="235" width="139" height="35"/>
80+
<rect key="frame" x="179" y="235" width="139" height="40.5"/>
8181
<state key="normal" title="Button"/>
8282
<buttonConfiguration key="configuration" style="plain" title="Video Scenario"/>
8383
<connections>
@@ -158,14 +158,6 @@
158158
<action selector="onTapCodingSegment:" destination="jxp-ZN-2yG" eventType="valueChanged" id="Bbt-xf-zZg"/>
159159
</connections>
160160
</segmentedControl>
161-
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dZm-Rf-imt">
162-
<rect key="frame" x="202" y="433.5" width="124.5" height="34.5"/>
163-
<state key="normal" title="Button"/>
164-
<buttonConfiguration key="configuration" style="filled" title="CameraFocal"/>
165-
<connections>
166-
<action selector="onTapCameraFocalButton:" destination="jxp-ZN-2yG" eventType="touchUpInside" id="SK3-MU-0lJ"/>
167-
</connections>
168-
</button>
169161
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="eGT-sd-I3g">
170162
<rect key="frame" x="141" y="512" width="183" height="36"/>
171163
<subviews>
@@ -194,7 +186,7 @@
194186
</constraints>
195187
</view>
196188
<view alpha="0.80000001192092896" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="CN0-n0-1Gh" userLabel="B帧">
197-
<rect key="frame" x="21" y="479.5" width="108" height="35"/>
189+
<rect key="frame" x="21" y="473.5" width="108" height="35"/>
198190
<subviews>
199191
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="B帧" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="m3M-Tw-nzd">
200192
<rect key="frame" x="8" y="-2" width="37" height="40"/>
@@ -224,7 +216,7 @@
224216
</constraints>
225217
</view>
226218
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pha-4w-IfR">
227-
<rect key="frame" x="21" y="388" width="372" height="35"/>
219+
<rect key="frame" x="21" y="382" width="372" height="35"/>
228220
<constraints>
229221
<constraint firstAttribute="height" constant="35" id="LLi-Kw-ErI"/>
230222
</constraints>
@@ -235,7 +227,7 @@
235227
</connections>
236228
</button>
237229
<view alpha="0.80000001192092896" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="v58-rP-HKa" userLabel="CenterStage">
238-
<rect key="frame" x="21" y="434.5" width="170.5" height="35"/>
230+
<rect key="frame" x="21" y="428.5" width="170.5" height="35"/>
239231
<subviews>
240232
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="751" text="CenterStage" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7gz-OE-0O4">
241233
<rect key="frame" x="7" y="-2" width="91.5" height="40"/>
@@ -319,7 +311,7 @@
319311
</constraints>
320312
</view>
321313
<view alpha="0.80000001192092896" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="i5U-ta-1hj" userLabel="watermark">
322-
<rect key="frame" x="20" y="524.5" width="108" height="35"/>
314+
<rect key="frame" x="20" y="518.5" width="108" height="35"/>
323315
<subviews>
324316
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="水印" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nSq-Vu-o9H">
325317
<rect key="frame" x="8" y="-2" width="37" height="40"/>
@@ -376,7 +368,7 @@
376368
</constraints>
377369
</view>
378370
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="w4q-aT-JBc">
379-
<rect key="frame" x="20" y="569.5" width="93.5" height="34.5"/>
371+
<rect key="frame" x="20" y="563.5" width="93.5" height="40.5"/>
380372
<color key="backgroundColor" name="btnPanelBackground"/>
381373
<constraints>
382374
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="80" id="Xdc-MD-QxT"/>
@@ -394,7 +386,7 @@
394386
</connections>
395387
</button>
396388
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lpn-6Z-VV3">
397-
<rect key="frame" x="127" y="569" width="93.5" height="35"/>
389+
<rect key="frame" x="127" y="563" width="93.5" height="35"/>
398390
<color key="backgroundColor" name="btnPanelBackground"/>
399391
<constraints>
400392
<constraint firstAttribute="height" constant="35" id="EJL-Hg-zEY"/>
@@ -484,16 +476,13 @@
484476
<constraint firstItem="Uwe-Fi-04a" firstAttribute="leading" secondItem="CeS-QQ-Djo" secondAttribute="leading" constant="20" id="0oI-Iz-1eG"/>
485477
<constraint firstItem="w4q-aT-JBc" firstAttribute="leading" secondItem="CeS-QQ-Djo" secondAttribute="leading" constant="20" id="0za-L8-AHw"/>
486478
<constraint firstItem="XSO-cE-x5n" firstAttribute="top" secondItem="CeS-QQ-Djo" secondAttribute="top" constant="10" id="1HU-w7-YYi"/>
487-
<constraint firstItem="dZm-Rf-imt" firstAttribute="top" secondItem="pha-4w-IfR" secondAttribute="bottom" constant="10.5" id="66O-Xr-Aml"/>
488479
<constraint firstItem="q9v-1n-ZYf" firstAttribute="top" secondItem="CeS-QQ-Djo" secondAttribute="top" id="7Ra-XK-uPS"/>
489-
<constraint firstItem="b7R-QN-CCh" firstAttribute="top" secondItem="dZm-Rf-imt" secondAttribute="bottom" constant="7" id="AdA-I4-fg9"/>
490480
<constraint firstItem="v58-rP-HKa" firstAttribute="top" secondItem="pha-4w-IfR" secondAttribute="bottom" constant="11.5" id="Avv-nK-e5T"/>
491481
<constraint firstItem="pha-4w-IfR" firstAttribute="top" secondItem="tOf-AP-HSe" secondAttribute="bottom" constant="15" id="B1H-mT-8wd"/>
492482
<constraint firstItem="sOi-ZR-6Oj" firstAttribute="top" secondItem="b7R-QN-CCh" secondAttribute="bottom" constant="45" id="Fn8-02-ePb"/>
493483
<constraint firstItem="w4q-aT-JBc" firstAttribute="top" secondItem="i5U-ta-1hj" secondAttribute="bottom" constant="10" id="GpK-P5-Dz2"/>
494484
<constraint firstItem="Uwe-Fi-04a" firstAttribute="top" secondItem="Wts-5Z-p7a" secondAttribute="bottom" constant="10" id="JJa-xD-z27"/>
495485
<constraint firstItem="lpn-6Z-VV3" firstAttribute="leading" secondItem="w4q-aT-JBc" secondAttribute="trailing" constant="13.5" id="JOL-0B-Kgk"/>
496-
<constraint firstItem="dZm-Rf-imt" firstAttribute="leading" secondItem="v58-rP-HKa" secondAttribute="trailing" constant="10.5" id="LaR-vk-DTf"/>
497486
<constraint firstItem="q9v-1n-ZYf" firstAttribute="leading" secondItem="CeS-QQ-Djo" secondAttribute="leading" id="LsZ-af-6Wt"/>
498487
<constraint firstItem="q9v-1n-ZYf" firstAttribute="leading" secondItem="UFF-wU-Wze" secondAttribute="trailing" constant="-323" id="M4O-C8-oP4"/>
499488
<constraint firstItem="CeS-QQ-Djo" firstAttribute="bottom" secondItem="q9v-1n-ZYf" secondAttribute="bottom" id="Ne5-if-Q54"/>
@@ -529,7 +518,6 @@
529518
</constraints>
530519
</view>
531520
<connections>
532-
<outlet property="CameraFocalButton" destination="dZm-Rf-imt" id="owk-Ou-NSb"/>
533521
<outlet property="bFrameContainer" destination="CN0-n0-1Gh" id="ILN-XR-Efd"/>
534522
<outlet property="backgroundVideoContainer" destination="q9v-1n-ZYf" id="ADa-RX-kZg"/>
535523
<outlet property="cameraStabilizationButton" destination="pha-4w-IfR" id="5Q8-iF-7uG"/>
@@ -578,7 +566,7 @@
578566
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
579567
</systemColor>
580568
<systemColor name="systemGray6Color">
581-
<color red="0.94901960780000005" green="0.94901960780000005" blue="0.96862745100000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
569+
<color red="0.94901960784313721" green="0.94901960784313721" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
582570
</systemColor>
583571
</resources>
584572
</document>

iOS/APIExample/APIExample/Examples/Advanced/LiveStreaming/LiveStreaming.swift

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ class LiveStreamingMain: BaseViewController {
197197
@IBOutlet weak var codingSegment: UISegmentedControl!
198198
@IBOutlet weak var videoImageContainer: UIView!
199199
@IBOutlet weak var centerStageContainerView: UIView!
200-
@IBOutlet weak var CameraFocalButton: UIButton!
201200
@IBOutlet weak var cameraStabilizationButton: UIButton?
202201
@IBOutlet weak var localRenderTextField: UITextField?
203202
@IBOutlet weak var remoteRenderTextField: UITextField?
@@ -216,7 +215,6 @@ class LiveStreamingMain: BaseViewController {
216215
codingSegment.isHidden = role == .audience
217216
videoImageContainer.isHidden = role == .audience
218217
centerStageContainerView.isHidden = role == .audience
219-
CameraFocalButton.isHidden = role == .audience
220218
localRenderTextField?.isHidden = role == .audience
221219
cameraStabilizationButton?.isHidden = role == .audience
222220
takeLocalSnapshot.isHidden = role == .audience
@@ -262,10 +260,6 @@ class LiveStreamingMain: BaseViewController {
262260
agoraKit.delegate = self
263261
}
264262

265-
if let key = configs["cameraKey"] as? String, key.isEmpty == false {
266-
CameraFocalButton.setTitle(key, for: .normal)
267-
}
268-
269263
if let isFirstFrame = configs["isFirstFrame"] as? Bool, isFirstFrame == true {
270264
agoraKit.enableInstantMediaRendering()
271265
agoraKit.startMediaRenderingTracing()
@@ -368,27 +362,6 @@ class LiveStreamingMain: BaseViewController {
368362
self.view.endEditing(true)
369363
}
370364

371-
@IBAction func onTapCameraFocalButton(_ sender: UIButton) {
372-
let infos = agoraKit.queryCameraFocalLengthCapability()
373-
let pickerView = PickerView()
374-
let params = infos?.flatMap({ $0.value })
375-
pickerView.dataArray = params?.map({ $0.key })
376-
AlertManager.show(view: pickerView, alertPostion: .bottom)
377-
pickerView.pickerViewSelectedValueClosure = { [weak self] key in
378-
guard let self = self else { return }
379-
let type = params?.first(where: { $0.key == key })?.value ?? .default
380-
let config = AgoraCameraCapturerConfiguration()
381-
config.cameraFocalLengthType = type
382-
config.cameraDirection = key.contains("Front camera".localized) ? .front : .rear
383-
if config.cameraDirection != self.cameraDirection {
384-
self.agoraKit.switchCamera()
385-
}
386-
sender.setTitle(key, for: .normal)
387-
self.agoraKit.setCameraCapturerConfiguration(config)
388-
self.cameraDirection = config.cameraDirection
389-
}
390-
}
391-
392365
@IBAction func onTapCenterStage(_ sender: UISwitch) {
393366
if agoraKit.isCameraCenterStageSupported() {
394367
agoraKit.enableCameraCenterStage(sender.isOn)

iOS/APIExample/Podfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ target 'APIExample' do
2222
pod 'SwiftLint', '~> 0.53.0'
2323
pod 'SnapKit', '~> 5.7.0'
2424

25-
# pod 'SenseLib', :path => 'sense.podspec'
26-
# pod 'bytedEffect', :path => 'bytedEffect.podspec'
27-
# pod 'fuLib', :path => 'fu.podspec'
25+
pod 'SenseLib', :path => 'sense.podspec'
26+
pod 'bytedEffect', :path => 'bytedEffect.podspec'
27+
pod 'fuLib', :path => 'fu.podspec'
2828
end
2929

3030
target 'Agora-ScreenShare-Extension' do

0 commit comments

Comments
 (0)