In my app I'm trying to play an Apple Music video using
VideoPlayer(player: AVPlayer(url: video.url!))
where "video" is a MusicVideo instance but all I get is a blank player. video.title and video.artistName work fine
I've tried using fileURLWithPath and string also, which work with hosted videos no problem
(apologies for the poor use of terms, newbie)
Post not yet marked as solved
Has anyone worked out how to create OBJ files instead of USDZ?
Post not yet marked as solved
one or the other works but not both
if the timers have the same interval it works
struct ContentView: View {
@State var isPlaying: Bool = true
@State var timeRemaining: Int = 1800
@State var count = 1
@State var count2 = 10
var body: some View {
let timer2 = Timer.publish(every: 1, on: .main, in: .default).autoconnect()
let timer = Timer.publish(every: 0.5, on: .main, in: .default).autoconnect()
VStack {
Text("\(count) \(count2)")
.padding()
}
.onReceive(timer2) { _ in
if self.timeRemaining > 0 && isPlaying == true {
self.count2 += 1
}
}
.onReceive(timer) { _ in
if self.timeRemaining > 0 && isPlaying == true {
self.count += 1
}
}
}
}
Post not yet marked as solved
I'm trying to add an object to a RealityKit app and then make it move.I'm only guessing that applyLinearImpulse is the correct method.