diff --git a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/LiveStreaming/LiveStreaming.swift b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/LiveStreaming/LiveStreaming.swift index a8563e159..7650d4bb4 100644 --- a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/LiveStreaming/LiveStreaming.swift +++ b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/LiveStreaming/LiveStreaming.swift @@ -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) diff --git a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/LiveStreaming/LiveStreamingRTC.swift b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/LiveStreaming/LiveStreamingRTC.swift index 3f83a0152..00f709087 100644 --- a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/LiveStreaming/LiveStreamingRTC.swift +++ b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Advanced/LiveStreaming/LiveStreamingRTC.swift @@ -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! @@ -208,6 +212,10 @@ class LiveStreamingRTC: NSObject, ObservableObject { } func onTapForegroundVideo() { + if remoteUid == nil { + return + } + isLocalVideoForeground.toggle() let localVideoCanvas = AgoraRtcVideoCanvas() diff --git a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Basic/JoinChannelAudio/JoinChannelAudio.swift b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Basic/JoinChannelAudio/JoinChannelAudio.swift index b3ed1635c..317965d45 100644 --- a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Basic/JoinChannelAudio/JoinChannelAudio.swift +++ b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Examples/Basic/JoinChannelAudio/JoinChannelAudio.swift @@ -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)) diff --git a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Info.plist b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Info.plist index ed241a6f7..77e2004c0 100644 --- a/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Info.plist +++ b/iOS/APIExample-SwiftUI/APIExample-SwiftUI/Info.plist @@ -2,6 +2,32 @@ + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + CFBundleShortVersionString + $(MARKETING_VERSION) + LSRequiresIPhoneOS + + NSMicrophoneUsageDescription + Request Mic Access + NSCameraUsageDescription + Request Camera Access + CFBundleInfoDictionaryVersion + 6.0 + CFBundleIdentifier + Bundle identifier + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + BGTaskSchedulerPermittedIdentifiers + + com.yourCompanyName.appName + + Application supports iTunes + + UIFileSharingEnabled + CFBundleURLTypes