Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the problem that the real-time live broadcast remote screen does … #420

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading