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

Bug fix for SwiftUI project #424

Merged
merged 1 commit into from
Oct 23, 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
2 changes: 2 additions & 0 deletions iOS/APIExample-SwiftUI/APIExample-SwiftUI/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ struct ContentView: View {
}
}
}

Text("SDK Version: arsenal_46627_FULL_20241022_0154_394587")
}
.listStyle(GroupedListStyle())
.navigationTitle("Agora API Example")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,20 @@ struct ARKit: View {

@State private var statsInfo: String = ""
@ObservedObject private var agoraKit = ARKitRTC()
@GestureState private var tappedLocation: CGPoint = .zero

@State var tappedLocation: CGPoint = .zero
@State var dragLocation: CGPoint = .zero

let sceneView = ARViewWrapper()

var body: some View {
VStack {
let tap = TapGesture().onEnded {
tappedLocation = dragLocation
agoraKit.doSceneViewTapped(tappedLocation)
}
let drag = DragGesture(minimumDistance: 0).onChanged { value in
dragLocation = value.location
}.sequenced(before: tap)
sceneView
.adaptiveBackground().alert(isPresented: $agoraKit.isSupportedAR) {
let message = "This app requires world tracking, which is available only on iOS devices with the A9 processor or later.".localized
Expand All @@ -115,13 +123,8 @@ struct ARKit: View {
}).onReceive(agoraKit.$isHiddenStatsLabel, perform: { _ in
sceneView.statsLabel.isHidden = agoraKit.isHiddenStatsLabel
sceneView.statsLabel.text = agoraKit.stats
}).onTapGesture {
agoraKit.doSceneViewTapped(tappedLocation)
}.gesture(DragGesture(minimumDistance: 0)
.updating($tappedLocation) { (value, state, _) in
state = value.startLocation
}
)
})
.gesture(drag)

}.onAppear(perform: {
agoraKit.setupRTC(configs: configs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ struct KtvCopyrightMusic: View {
var body: some View {
ZStack {
Button("Ktv copyright music".localized) {
let urlString = "https://doc.shengwang.cn/doc/online-ktv/ios/implementation/ktv-scenario/integrate-ktvapi"
let urlString = "https://doc.shengwang.cn/doc/online-ktv/ios/ktv-scenario/get-started/integrate-ktvapi"

if let url = URL(string: urlString) {
UIApplication.shared.open(url)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ struct ActionSheetView: View {
}
}.padding(.horizontal, 15)
}.frame(height: 200)
.adaptiveBackground(Color.white)
.offset(x: 0, y: isShow ? 200 : 0)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class SpatialAudioRTC: NSObject, ObservableObject {
if isVoice1 {
_ = isMute ? mediaPlayer1.pause() : mediaPlayer1.resume()
} else {
_ = isMute ? mediaPlayer1.pause() : mediaPlayer1.resume()
_ = isMute ? mediaPlayer2.pause() : mediaPlayer2.resume()
}
}
func mediaPlayerVoiceBlur(isVoice1: Bool, isOn: Bool) {
Expand All @@ -135,7 +135,7 @@ class SpatialAudioRTC: NSObject, ObservableObject {
if isVoice1 {
mediaPlayer1.setSpatialAudioParams(params)
} else {
mediaPlayer1.setSpatialAudioParams(params)
mediaPlayer2.setSpatialAudioParams(params)
}
}
func mediaPlayerAirborne(isVoice1: Bool, isOn: Bool) {
Expand All @@ -144,7 +144,7 @@ class SpatialAudioRTC: NSObject, ObservableObject {
if isVoice1 {
mediaPlayer1.setSpatialAudioParams(params)
} else {
mediaPlayer1.setSpatialAudioParams(params)
mediaPlayer2.setSpatialAudioParams(params)
}
}
func mediaPlayerAttenuation(isVoice1: Bool, value: Float) {
Expand Down
Loading