tvOS is the operating system for Apple TV.

Posts under tvOS tag

111 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

`displayManager.isDisplayCriteriaMatchingEnabled` arbitrary result (no distinction between frame rate and dynamic range)
displayManager.isDisplayCriteriaMatchingEnabled returns true if one (or both) between refresh rate, and dynamic range, is set to match the content in the AppleTV settings. There's no way to make a distinction between them, and only enable one of them accordingly. Looks like Apple failed to change their APIs to me. What am I missing?
0
0
440
Oct ’23
[tvOS][XCTest] Detect which keyboard key has focus
I am writing a UI automation test for a view on Apple TV. The view has a numeric input field(TVDigitEntryViewController) which accepts 5 digits password. When the view loads the focus is on key '1' of the numeric apple input keyboard for tvOS. However when I try po pinEntryKeyboard.keys["1"].hasFocus in the debug terminal it says false. Is there a way to find out which keyboard key has focus for tvOS input keyboard? For more context I am adding some debug terminal output here: (lldb) po pinEntryKeyboard.keys ... ... ↪︎Find: Descendants matching type Key Output: { Key, 0x102e4d2f0, {{645.0, 691.5}, {70.0, 80.0}}, label: '1' Key, 0x102e4d410, {{707.0, 699.5}, {54.0, 64.0}}, label: '2' Key, 0x102e4d530, {{761.0, 699.5}, {54.0, 64.0}}, label: '3' Key, 0x102e4d650, {{815.0, 699.5}, {54.0, 64.0}}, label: '4' Key, 0x102e4d770, {{869.0, 699.5}, {54.0, 64.0}}, label: '5' Key, 0x102e4d890, {{923.0, 699.5}, {54.0, 64.0}}, label: '6' Key, 0x102e4d9b0, {{977.0, 699.5}, {54.0, 64.0}}, label: '7' Key, 0x102e4dad0, {{1031.0, 699.5}, {54.0, 64.0}}, label: '8' Key, 0x102e4dbf0, {{1085.0, 699.5}, {54.0, 64.0}}, label: '9' Key, 0x102e4dd10, {{1139.0, 699.5}, {54.0, 64.0}}, label: '0' Key, 0x102e4de30, {{1193.0, 699.5}, {74.0, 64.0}}, identifier: 'delete', label: 'delete' } (lldb) po pinEntryKeyboard.keys["1"] ... ... ↪︎Find: Elements matching predicate '"1" IN identifiers' Output: { Key, 0x1032baa80, {{645.0, 691.5}, {70.0, 80.0}}, label: '1' } (lldb) po pinEntryKeyboard.keys["1"].hasFocus t = 956.09s Find the "1" Key false
0
0
388
Oct ’23
TVOS 17 - Text Field in Alert adds a Button
When adding a textfield to an alert in SwiftUI (as shown below) the behavior changes from TVOS 16 to TVOS 17. In the simulator running TVOS 17, it displays an additional button labeled with the text from inside the textfield when the alert is presented. So, the alert below would have two buttons. One button would be labeled "OK" and run addFunction, and the other is labeled with whatever is in $url when the alert is presented and does nothing. Button { showAlert = true } label: { Image(systemName: "plus") } .alert("Add", isPresented: $showAlert) { Button("OK", action: addFunction) TextField("Enter URL", text: $url) .keyboardType(.URL) }
1
1
638
Oct ’23
Changing the video playing in VideoPlayer programmatically
I'm using SwiftUI to play videos. I'm trying to use a NavigationStack to show a list of videos, then when i click on on it goes to a new view to play that video. I see lots of example that have the underlying AVPlayer in a @State or @StateObject, but as soon as I reassign it to a new AVPlayer the VideoPlayer stops working; I just get a black screen. Is there a better way to change the url that VideoPlayer is playing? I'm trying to avoid creating a bunch of VideoPlayer objects ahead of time and having them all in memory, as this might have a large number of videos. More details: App is TVOS 17, using Xcode 15.
1
0
1.3k
Oct ’23
Config Apple TV programmatically
I have an Apple TV and I would like to choose an specific photo album as screensaver. my current solution is to use remote control API, but it is not reliable given I need to count the "down" the "left" keys and assume where the photo album would be. is there a way to choose the album by name? using API? or deploying some configuration profile? thanks, Hiro
0
0
259
Oct ’23
tvOS 17 padding or frame breaks highlight of Button inside List
Hello, found a issue with tvOS 17. When I use either a frame or padding, the button highlight has no round corners anymore, seems like the left and right margin of buttons is not displayed. Works perfectly fine on tvOS 16. Is this a bug? Any way to fix this? struct ListOfButtons: View { var values = (0...13).map{"item \($0)"} @State var selectedValue: String = "item 0" var body: some View { List(values, id: \.self) { item in Button { selectedValue = item } label: { Text(item) } } .frame(width: 200, height: 900) .padding(40) .background(Color.cyan) } } tvOS 16.4: tvOS 17:
3
0
563
Nov ’23
Unable to build tvOS 17.2(Beta version) with webdriverAgent project
Current Behavior I'm working with latest AppleTV 4k upgraded with beta version i.e 17.2 tvOS(real device) , on which we execute some automated tests using appium for some of our in-house app's when i'm trying to build the tvOS webDriverAgent project with below command( running from webdriver agent default project path) it is throwing following error. command : xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner_tvOS -destination 'id=4d61282d6871dd9006c73a8e7e8f20298ed82e00' test response: Ineligible destinations for the "WebDriverAgentRunner_tvOS" scheme: { platform:tvOS, id:4d61282d6871dd9006c73a8e7e8f20298ed82e00, name:Living Room, error:Living Room’s tvOS 17.0 doesn’t match WebDriverAgentRunner_tvOS.xctest’s tvOS 17.2 deployment target. Upgrade Living Room’s tvOS version or lower WebDriverAgentRunner_tvOS.xctest’s deployment target. } Note: I'm able to successfully build the tvos webDriverAgentLib_tvOS and webDriverAgentRunner_tvOS tvOS runner from Xcode, no error for Target devices there i have set it to 17.2 image attached but when i tried to run the command xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner_tvOS -destination 'id=4d61282d6871dd9006c73a8e7e8f20298ed82e00' test, it is complaining about deployment target. Even i tried to set the tvOS deployment target to 17.0 and build the i had below issue which was expected because my AppleTV is deployed with 17.2 version when u tried to run above command by downgrading the target got below response: Response Logs : 2023-11-07 13:25:40.722 xcodebuild[19962:485925] DTDeviceKit: Started connection with 00008020-0011188A1A50003A xcodebuild: error: Unable to find a destination matching the provided destination specifier: { id:4d61282d6871dd9006c73a8e7e8f20298ed82e00 } Available destinations for the "WebDriverAgentRunner_tvOS" scheme: { platform:tvOS, id:dvtdevice-DVTiOSDevicePlaceholder-appletvos:placeholder, name:Any tvOS Device } { platform:tvOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-appletvsimulator:placeholder, name:Any tvOS Simulator Device } Expected Behavior since i'm using all the latest drivers, plugin's, appium , xcode and macos it should build the tvOS webdriverAgent properly. since i'm able to launch the app for iphone with 17.1 os version with the same setup. Environment: and i have the following versions installed on mac, all are almost latest and some are beta version's too. MAC ----SONOMA 14.1 XCODE --- 15.1 beta (15C5042i) Appium --- 2.2.1 CLI version execute-driver-3.0.19 [installed (npm) uiautomator2-2.34.0 [installed (npm)] [Up to date] xcuitest -5.8.1 [installed (npm)] [Up to date] NPM version ---8.15.0 NODE version --v16.17.1 Real Device --AppleTV 4k upgraded with beta version i.e 17.2 tvO Further Information: with this issue, want to know whether tvOS beta version is supported by latest webdriverAgent Project. or do i need to wait for official release of 17.2 as i'm using Beta version
2
0
582
Nov ’23
Detecting Video Playback Status of Other Apps on AppleTV?
I'm interested in determining whether another AppleTV app is currently playing a video or not, without accessing the actual content or violating any privacy policies. I'm aware of the privacy and security concerns related to accessing other app's data, and I want to ensure that any solution I implement is in compliance with Apple's guidelines and respects user privacy. My goal is to provide enhanced user experiences without compromising security or privacy. Is there any legitimate and secure way to achieve this functionality? I appreciate any guidance or information you can provide on this matter. Thank you for your time and assistance! :)
0
0
495
Nov ’23
App Review Guys Getting Worse?
I don't know if it's just me lately but it seems the review guys for app submissions and updates have lost several hundred thousand brain cells. I guess it depends on who actually touches your submission but I've had a lot of copyright and random app performance rejections for like the past year and a half. There are no performance issues with the apps created as they're all made the same just pointing to different content which all work and after a resubmission it gets passed anyway. The copyright one makes sense for new apps and that's always provided yet somehow they sometimes miss that it's been included with the submission anyway and eventually passes when pointed out or resubmitted, but they'll also do it for updates to apps that have been published for years now and even when adding another platform. Ex Apple TV app around for years then add an IOS version for it BAM flagged for rejection over copyright. Some apps being updated from v1X to 2X BAM flagged for copyright. It doesn't make any sense. Anyone else seeing this? The support guys never answer my questions. Just spam the same copy/paste posts. Quite infuriating.
0
0
425
Nov ’23
XCTest tvOS UI testing: focus on element without navigation
For iOS, it can send tap() event to an element, that means it doesn't need to explicitly navigate the UI to focus on the element first. Based on the document "Available in iOS and for Touch Bar interactions in macOS.", such events (like tap, click) don't support for tvOS , seems like for tvOS XCTest, I have to explicitly navigate the UI to locate the element first, and then send remote event like "select()" to trigger the click event. Anyone know is this the only way for tvOS?
0
0
386
Nov ’23
How to implement search controller on search view controller with side menu in appletvos
class SearchController: UISearchController { override func viewDidLoad() { super.viewDidLoad() } override func viewWillDisappear(_ animated: Bool) { let appDelegate = UIApplication.shared.delegate as! AppDelegate AppDelegate.searchFlag = true DispatchQueue.main.async(execute: { self.searchBar.text = "abc" }) } override func viewWillAppear(_ animated: Bool) { self.view.frame.origin.y = 400 self.view.frame.origin.x = 400 } } how to add this SearchController on search view controller because when use this code self.present(appDelegate.searchController, animated: true, completion: nil) it is showing full width screen
0
0
323
Nov ’23
AVPlayer playing video 6x or more faster than normal rate
0 I have a TV app which is used in Fitness industry where 6 smart TVs connected to Apple TVs and the App playing videos from a local server. Unitl tvOS 17.0 everything was smooth but soon after that we are facing a strange issue in that sometimes same Video is playing 6x or more faster than normal rate only in 1 random TV. I can see 12 min video finished playing in 1.3 min. Video Codecs: MPEG-4 AAC, H.264. Is these format affects speed in Apple TV? TVs are initially runs Intro videos, then warm up, then exercise and at last cooldown. I added the code for exercise background timer video where I am facing issue. On top on background video there are other 4 videos playing in loop. Please find attached image. I am using AVPlayer, Swift 5, Xcode 5 and tvOS 17.0, Apple TV 4K. code-block import UIKit import AVKit import AVFoundation class ViewController: UIViewController { @IBOutlet weak var workoutCircuitContainerView: UIView! var workoutCircuitPlayerItem: AVPlayerItem? var workoutCircuitPlayerLayer: AVPlayerLayer? var workoutCircuitPlayer: AVPlayer? var isWorkoutCircuitPlayerObserverAdded: Bool = false private var workoutCircuitObserverContext = 0 override func viewDidLoad() { super.viewDidLoad() } override func viewWillAppear(_ animated: Bool) { initializeWorkoutCircuitPlayer() } func initializeWorkoutCircuitPlayer() { workoutCircuitPlayer?.pause() workoutCircuitPlayerLayer?.removeFromSuperlayer() self.removeWorkoutCircuitPlayerObservers() startWorkoutCircuitPlayer() } func startWorkoutCircuitPlayer() { guard let streamURL = URL(string: "http://192.168.1.116:3001/videos/CARDIO_Work_Circuit1.mp4") else { return } self.workoutCircuitPlayerItem = AVPlayerItem(url: streamURL as URL) self.workoutCircuitPlayer = AVPlayer(playerItem: self.workoutCircuitPlayerItem) self.workoutCircuitPlayerLayer = AVPlayerLayer(player: self.workoutCircuitPlayer!) self.workoutCircuitPlayerLayer!.videoGravity = AVLayerVideoGravity(rawValue: AVLayerVideoGravity.resizeAspectFill.rawValue) self.workoutCircuitPlayerLayer!.frame = self.workoutCircuitContainerView.bounds self.workoutCircuitContainerView.layer.addSublayer(self.workoutCircuitPlayerLayer!) self.workoutCircuitPlayer!.addObserver(self, forKeyPath: "timeControlStatus", options: [.old, .new], context: nil) self.playWorkoutCircuitPlayer() self.addWorkoutCircuitPlayerObservers() } func playWorkoutCircuitPlayer() { workoutCircuitPlayer?.play() } func addWorkoutCircuitPlayerObservers() { if !isWorkoutCircuitPlayerObserverAdded { workoutCircuitPlayer?.addObserver(self, forKeyPath: #keyPath(AVPlayerItem.status), options: [.old, .new], context: &workoutCircuitObserverContext) NotificationCenter.default.addObserver(self, selector: #selector(self.workoutCircuitPlayerDidFinishPlaying), name: NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: workoutCircuitPlayer?.currentItem) NotificationCenter.default.addObserver(self, selector: #selector(self.workoutCircuitPlayerStalled(note:)), name: .AVPlayerItemPlaybackStalled, object: self.workoutCircuitPlayer?.currentItem) isWorkoutCircuitPlayerObserverAdded = true } } @objc func workoutCircuitPlayerDidFinishPlaying(notification: NSNotification) { // play cool down videos code } @objc func workoutCircuitPlayerStalled(note: NSNotification) { if let playerItem = note.object as? AVPlayerItem { playerItem.seek(to: (workoutCircuitPlayer?.currentTime())!, completionHandler: nil) self.workoutCircuitPlayer!.play() } } func removeWorkoutCircuitPlayerObservers() { if isWorkoutCircuitPlayerObserverAdded { workoutCircuitPlayer?.removeObserver(self, forKeyPath: #keyPath(AVPlayerItem.status), context: &workoutCircuitObserverContext) NotificationCenter.default.removeObserver(self, name: NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: workoutCircuitPlayer?.currentItem) NotificationCenter.default.removeObserver(self, name: NSNotification.Name.AVPlayerItemPlaybackStalled, object: workoutCircuitPlayer?.currentItem) isWorkoutCircuitPlayerObserverAdded = false } } }
0
0
500
Nov ’23
Apple TV A2843 Dolby Vision Pink Distorted Picture at 23.9Hz and 29.9Hz Pioneer SC-LX904 Sony XR-90J
Hello friends, my Apple TV A2843 is connected to a Pioneer SC-LX904 AVR that passes the signal to a Sony XR-90J TV. The TV is set to Enhanced Dolby Vision and the AVR HDMI is set to Enhanced too. The Format on my Apple TV is 4K Dolby Vision at 60HZ. Auto Frame and Dynamic Range match are on. The Color is set to RGB 24 bit automatically when the DV 60HZ format is selected and I cannot switch the Color from RGB back to YUV 4.4.4, 4.2.2 or 4.2.0. 4K Dolby Vision works perfectly at 60HZ and 50HZ. 4K Dolby Vision is not working (pink distorted Picture) at 23.9HZ and 29.9HZ When I swap the Apple TV A2843 with a Apple TV A1842 everything works perfectly. When I connect the Apple TV A2843 directly to the tv's HDMI 2.1 everything works perfectly. Months ago on March 2023 the problem was fixed with the 16.4 Beta (16.4 20L5474e) and it came back with the 16.4 RC and 16.4 Public. I haven't seen a fix since then. I have an older Apple TV A1842 that works fine all the time. Thank You
0
0
531
Nov ’23