Post

Replies

Boosts

Views

Activity

Reply to AVFoundation player.publisher().assign() for @Observable/@ObservationTracked?
Hi Quinn, thanks for the insight! The reason for deviating from the approach in the link was to explore some of the new features with @Observable and converting projects which previously used ObservableObjects. It seems that most classes can be converted quite easily, but this is a case where it takes a deeper understanding to adjust to the new approach. I am new to all this (AVPlayer, Observable, Concurrency), but the solution I ended up implementing to represent Play state is to just look at the rate and return a bool, since AVPlayer just adjust the rate from 0.0 / (> 0.0) to Pause/Play. .receive(on: DispatchQueue.main) .sink { [weak self] rate in Logger.funcUpdate("Rate changed to: \(rate)") if rate == 0 { self?.isPlaying = false } else { self?.isPlaying = true } } .store(in: &subscriptions)
Topic: Media Technologies SubTopic: Audio Tags:
Dec ’23
Reply to Unexpected “OTHER” error in CloudKit despite app functioning normally
So strange, my app also showed a large increase in Other errors starting in September. There are no logs available for any of these errors, which is also odd. Have you found any insight into the issue?
Replies
Boosts
Views
Activity
Oct ’24
Reply to AVFoundation player.publisher().assign() for @Observable/@ObservationTracked?
Hi Quinn, thanks for the insight! The reason for deviating from the approach in the link was to explore some of the new features with @Observable and converting projects which previously used ObservableObjects. It seems that most classes can be converted quite easily, but this is a case where it takes a deeper understanding to adjust to the new approach. I am new to all this (AVPlayer, Observable, Concurrency), but the solution I ended up implementing to represent Play state is to just look at the rate and return a bool, since AVPlayer just adjust the rate from 0.0 / (> 0.0) to Pause/Play. .receive(on: DispatchQueue.main) .sink { [weak self] rate in Logger.funcUpdate("Rate changed to: \(rate)") if rate == 0 { self?.isPlaying = false } else { self?.isPlaying = true } } .store(in: &subscriptions)
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Dec ’23