nm - Looking for private forum.
Post
Replies
Boosts
Views
Activity
Same issue! Has anyone got this API to work?
Team Apple: How about marking up non-implemented APIS not as Beta, but (Beta: Feature not currently implemented)
Model: A2084
FW: 2D27
CMDeviceMotion has a SensorLocation property...
public enum SensorLocation : Int {
case default = 0
case headphoneLeft = 1
case headphoneRight = 2
}
Does this suggest we could use coremotionManager class and specify the sensor to get the raw data?
Seems pretty strange that this issue is still unresolved. Can someone from Apple comment on the rationale behind this messy business of orphan containers? Could this open up security breaches? Anyone in the community know if an un-used container could be a potental vulnerability?
Any find a solution?
Vision Framework for GenerateForegroundMask does NOT work on VisionOS 2.0 (Beta 5) See example code:
func analyse() async {
guard let selectedImage = selectedImage else { return }
let ciImage = CIImage(image: selectedImage)
let handler = VNImageRequestHandler(ciImage: ciImage!, options: [:])
let request = VNGenerateForegroundInstanceMaskRequest { request, error in
DispatchQueue.main.async {
self.isProcessing = false
if let error = error {
print("Error: \(error.localizedDescription)")
return
}
guard let results = request.results as? [VNPixelBufferObservation],
let pixelBuffer = results.first?.pixelBuffer else {
print("No results found")
return
}
let ciImage = CIImage(cvPixelBuffer: pixelBuffer)
let context = CIContext()
if let cgImage = context.createCGImage(ciImage, from: ciImage.extent) {
self.processedImage = UIImage(cgImage: cgImage)
}
}
}
// Configure the Vision request with preferred compute device
do {
// Query supported devices for each compute stage (handle potential errors)
let supportedDevices = try request.supportedComputeStageDevices
print("Supported Devices: \(supportedDevices)")
// Check the available devices for the main compute stage
if let mainStageDevices = supportedDevices[.main] {
print("Main Stage Devices: \(mainStageDevices)")
// Try to set the Neural Engine first, then GPU, and finally CPU (if applicable)
var selectedDevice: MLComputeDevice? = nil
if let neuralEngineDevice = mainStageDevices.first(where: { "\($0)".contains("NeuralEngine") }) {
selectedDevice = neuralEngineDevice
print("Selected Neural Engine: \(neuralEngineDevice)")
} else
if let gpuDevice = mainStageDevices.first(where: { "\($0)".contains("GPU") }) {
selectedDevice = gpuDevice
print("Selected GPU: \(gpuDevice)")
} else
if let cpuDevice = mainStageDevices.first(where: { "\($0)".contains("CPU") }) {
selectedDevice = cpuDevice
print("Selected CPU: \(cpuDevice)")
} else {
print("No preferred device found, using default.")
}
// Set the selected compute device, if any
if let selectedDevice = selectedDevice {
try request.setComputeDevice(selectedDevice, for: .main)
}
}
} catch {
print("Failed to configure Vision request compute device: \(error)")
}
#if targetEnvironment(simulator)
request.usesCPUOnly = true
#endif
if #available(iOS 14.0, *) {
request.usesCPUOnly = true
}
do {
try handler.perform([request])
} catch {
DispatchQueue.main.async {
self.isProcessing = false
print("Failed to perform request: \(error.localizedDescription)")
}
}
}```
Could you provide instructions on how to use the application player vs the system player with this work around. MPMusicPlayerController.systemMusicPlayer.openToPlay(queueDescriptor)
We'd live to understand why it's not possible via the API. Video Previews are available. It seems to me that if an Apple Music Subscriber authenticates within your MusicKit app developers should be able to write music kit apps that also play video content. The suggested workaround is NOT a great experience, the preloading sequence brings the user to a random looking view state before loading the video. The video's audio is clipped and pops during this loading sequence. Developer wanting to re-skin the interface need full access to the applications player. MusicKit is awesome with this major oversight and omission as an exception. Calling the Apple Music API also fails to return the actual video URL Pleas explain a better work around.