Skip to content

Commit

Permalink
Fix the problem that the real-time live broadcast remote screen does …
Browse files Browse the repository at this point in the history
…not display, and add the permission to open the directory
  • Loading branch information
qinhui committed Oct 21, 2024
1 parent a871d56 commit 9f2c6b2
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,22 +194,16 @@ struct LiveStreaming: View {
ZStack {
backgroundView
VStack {
if liveStreamRTCKit.remoteUid != nil {
HStack {
Spacer()
foregroundView
.frame(width: 136, height: 182)
.offset(x: -20)
.onTapGesture {
liveStreamRTCKit.onTapForegroundVideo()
}
}
} else {
Rectangle()
HStack {
Spacer()
foregroundView
.frame(width: 136, height: 182)
.adaptiveForegroundStyle(.clear)
.offset(x: -20)
.onTapGesture {
liveStreamRTCKit.onTapForegroundVideo()
}
}

//防抖
HStack {
Text("anti shake".localized)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import Combine
import AgoraRtcKit

class LiveStreamingRTC: NSObject, ObservableObject {
@Published var role: AgoraClientRole = .broadcaster
@Published var role: AgoraClientRole = .broadcaster {
didSet {
foregroundView?.isHidden = !(role == .broadcaster && remoteUid != nil)
}
}
@Published var showUltraLowEntry: Bool = false
@Published var showLinkStreamEntry: Bool = false
var agoraKit: AgoraRtcEngineKit!
Expand Down Expand Up @@ -208,6 +212,10 @@ class LiveStreamingRTC: NSObject, ObservableObject {
}

func onTapForegroundVideo() {
if remoteUid == nil {
return
}

isLocalVideoForeground.toggle()

let localVideoCanvas = AgoraRtcVideoCanvas()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ struct JoinChannelAudioEntry: View {
getAudioProfileAction(item)
}
adaptiveCancelStyleButton(title: "Cancel".localized) {}
}, actionSheetActions: AgoraAudioScenario.allValues().map { item in
}, actionSheetActions: AgoraAudioProfile.allValues().map { item in
.default(Text(item.description())) {
self.profile = profile
self.profile = item
}
} + [.cancel(Text("Cancel".localized))])
}.padding(EdgeInsets(top: 0, leading: 35, bottom: 0, trailing: 35))
Expand Down
26 changes: 26 additions & 0 deletions iOS/APIExample-SwiftUI/APIExample-SwiftUI/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSMicrophoneUsageDescription</key>
<string>Request Mic Access</string>
<key>NSCameraUsageDescription</key>
<string>Request Camera Access</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleIdentifier</key>
<string>Bundle identifier</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>com.yourCompanyName.appName</string>
</array>
<key>Application supports iTunes</key>
<true/>
<key>UIFileSharingEnabled</key>
<true/>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand Down

0 comments on commit 9f2c6b2

Please sign in to comment.