Skip to content

Commit 9f2c6b2

Browse files
author
qinhui
committed
Fix the problem that the real-time live broadcast remote screen does not display, and add the permission to open the directory
1 parent a871d56 commit 9f2c6b2

4 files changed

Lines changed: 45 additions & 17 deletions

File tree

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

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -194,22 +194,16 @@ struct LiveStreaming: View {
194194
ZStack {
195195
backgroundView
196196
VStack {
197-
if liveStreamRTCKit.remoteUid != nil {
198-
HStack {
199-
Spacer()
200-
foregroundView
201-
.frame(width: 136, height: 182)
202-
.offset(x: -20)
203-
.onTapGesture {
204-
liveStreamRTCKit.onTapForegroundVideo()
205-
}
206-
}
207-
} else {
208-
Rectangle()
197+
HStack {
198+
Spacer()
199+
foregroundView
209200
.frame(width: 136, height: 182)
210-
.adaptiveForegroundStyle(.clear)
201+
.offset(x: -20)
202+
.onTapGesture {
203+
liveStreamRTCKit.onTapForegroundVideo()
204+
}
211205
}
212-
206+
213207
//防抖
214208
HStack {
215209
Text("anti shake".localized)

iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/LiveStreaming/LiveStreamingRTC.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ import Combine
1010
import AgoraRtcKit
1111

1212
class LiveStreamingRTC: NSObject, ObservableObject {
13-
@Published var role: AgoraClientRole = .broadcaster
13+
@Published var role: AgoraClientRole = .broadcaster {
14+
didSet {
15+
foregroundView?.isHidden = !(role == .broadcaster && remoteUid != nil)
16+
}
17+
}
1418
@Published var showUltraLowEntry: Bool = false
1519
@Published var showLinkStreamEntry: Bool = false
1620
var agoraKit: AgoraRtcEngineKit!
@@ -208,6 +212,10 @@ class LiveStreamingRTC: NSObject, ObservableObject {
208212
}
209213

210214
func onTapForegroundVideo() {
215+
if remoteUid == nil {
216+
return
217+
}
218+
211219
isLocalVideoForeground.toggle()
212220

213221
let localVideoCanvas = AgoraRtcVideoCanvas()

iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Basic/JoinChannelAudio/JoinChannelAudio.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ struct JoinChannelAudioEntry: View {
5050
getAudioProfileAction(item)
5151
}
5252
adaptiveCancelStyleButton(title: "Cancel".localized) {}
53-
}, actionSheetActions: AgoraAudioScenario.allValues().map { item in
53+
}, actionSheetActions: AgoraAudioProfile.allValues().map { item in
5454
.default(Text(item.description())) {
55-
self.profile = profile
55+
self.profile = item
5656
}
5757
} + [.cancel(Text("Cancel".localized))])
5858
}.padding(EdgeInsets(top: 0, leading: 35, bottom: 0, trailing: 35))

iOS/APIExample-SwiftUI/APIExample-SwiftUI/Info.plist

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,32 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>CFBundleVersion</key>
6+
<string>$(CURRENT_PROJECT_VERSION)</string>
7+
<key>CFBundleShortVersionString</key>
8+
<string>$(MARKETING_VERSION)</string>
9+
<key>LSRequiresIPhoneOS</key>
10+
<true/>
11+
<key>NSMicrophoneUsageDescription</key>
12+
<string>Request Mic Access</string>
13+
<key>NSCameraUsageDescription</key>
14+
<string>Request Camera Access</string>
15+
<key>CFBundleInfoDictionaryVersion</key>
16+
<string>6.0</string>
17+
<key>CFBundleIdentifier</key>
18+
<string>Bundle identifier</string>
19+
<key>CFBundleExecutable</key>
20+
<string>$(EXECUTABLE_NAME)</string>
21+
<key>CFBundleDevelopmentRegion</key>
22+
<string>$(DEVELOPMENT_LANGUAGE)</string>
23+
<key>BGTaskSchedulerPermittedIdentifiers</key>
24+
<array>
25+
<string>com.yourCompanyName.appName</string>
26+
</array>
27+
<key>Application supports iTunes</key>
28+
<true/>
29+
<key>UIFileSharingEnabled</key>
30+
<true/>
531
<key>CFBundleURLTypes</key>
632
<array>
733
<dict>

0 commit comments

Comments
 (0)