tvOS is the operating system for Apple TV.

Posts under tvOS tag

111 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

AVPlayerViewController (AppleTV) - Dolby (multi-channel audio) visualisation
We noticed that AVPlayerViewController does not always show the "Multi-channel" label in the audio setting in the player when playing a video asset with surround sound as an audio track. (see image) We only serve in the HLS master manifest a multichannel audio track, like this #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio_0",CHANNELS="6",NAME="Surround",LANGUAGE.... Different tvOS versions will give us different outcomes on whether or not the "multi-channel" label is shown DOES NOT SHOW (the label Multi-channel will not show) Model A1842 (tvOS v 17.5.1) Model A1625 (tvOS v 16.6) DOES SHOW (see image) Model A1625 (tvOS v 15.6) This gives us the impression that the label being shown depends on tvOS version.. Any reason why? This is an ideal way for the user to see that the audio track has surround..
0
1
138
1w
How to ensure current SKScene has fully loaded before engaging it with the GamePad Controller?
How to ensure current SKScene has fully loaded before engaging it with the GamePad Controller? The problem is this = when stopping sound is involved when I do switch SKScenes, if I press the buttons of the GamePad Controller (which cycle thru these other SKScenes) too fast, the movement of the Game Pieces fails to resume when I return to the Game Scene after the above cycling. This problem occurs only with the os(tvOS) version, but not with the iPad version. And the reason for this distinction is that each SKScene for the iPad has to fully load due to the fact that the button I press to switch SKScenes is at the top-left corner of the iPad -- so, by definition, by the time I have access to this button, the current SKScene has fully loaded. By definition, there is no such button for os(tvOS). Given this button’s absence, I believe I need the Swift version of jQuery’s $(document).ready (function() {. Any help will be appreciated to the rafters ...
2
0
214
2w
How to ensure current SKScene has fully loaded before engaging it with the GamePad Controller?
How to ensure current SKScene has fully loaded before engaging it with the GamePad Controller? MAJOR REWRITE FOR THE SAKE OF HOPEFULLY (?) INCREASED CLARITY The problem is this = when stopping sound is involved when I do switch SKScenes, if I press the buttons of the GamePad Controller (which cycle thru these other SKScenes) too fast, the movement of the Game Pieces fails to resume when I return to the Game Scene after the above cycling. This problem occurs only with the os(tvOS) version, but not with the iPad version. And the reason for this distinction is that each SKScene for the iPad has to fully load due to the fact that the button I press to switch SKScenes is at the top-left corner of the iPad -- so, by definition, by the time I have access to this button, the current SKScene has fully loaded. By definition, there is no such button for os(iOS). Given this button’s absence, I need the Swift version of jQuery’s $(document).ready (function() {. Any help will be appreciated to the rafters ...
1
0
182
2w
AppleTV Simulator SiriRemote not working in App
Hi, I'm having a small App in the AppleTV-Simulator which is supposed to use the Siri-Remotes Swipe-Gesture. It works perfect on the real device but on the simulator the Swipe-Gesture is not recognized in the App but it works on the Start-Screen of the Simulator using the simulated Siri-Remote app. Here is the code which sets up the xAxis ans yAxis value change handlers: #if targetEnvironment(simulator) // Simulator let siriRemote = GCController.controllers().filter { controller in if controller.vendorName == "Gamepad" { return true } else { return false } } let sController = siriRemote.first! let inputProfile = sController.physicalInputProfile let dPad = inputProfile.dpads["Direction Pad"] self.dPad = dPad self.dPad!.xAxis.valueChangedHandler = self.directionPadXAxisValueChangeHandler self.dPad!.yAxis.valueChangedHandler = self.directionPadYAxisValueChangeHandler } #else // Device if let _ = ( notification.object as? GCController)?.microGamepad { let microProfileController = notification.object as! GCController self.microGamePad = microProfileController.microGamepad self.dPad = self.microGamePad!.dpad self.dPad!.xAxis.valueChangedHandler = self.directionPadXAxisValueChangeHandler self.dPad!.yAxis.valueChangedHandler = self.directionPadYAxisValueChangeHandler } #endif Any help is greatly appreciated. Cheers, Frank
0
0
206
3w
How to customise text field? tvOS
I'd like to customise text fields in my application, but I don't see any options for it. When I click text field, new window opens. And there is no title or description. But there must be something that allows me to customize it, right? Apple applications contain customised text fields. This is apple's text field (after clicking on it) This is my text field (after clicking on it) Here is my code: Form { //... TextField("", text: $address) //... } And there is one more problem. After filling this TextField I click enter and it immediately opens the next TextField. I don't want this behaviour.
1
1
195
Jun ’24
tvOS Context Menu on LazyVGrid is selecting item below.
Context menu on tvOS LazyVGrid selecting wrong item. It works fine if selecting items on last row. Testing on code from https://developer.apple.com/videos/play/wwdc2024/10207/ I just added contextMenu LazyVGrid(columns: columns, spacing: 40) { ForEach(sortedMatchingAssets) { asset in Button {} label: { asset.landscapeImage .resizable() .aspectRatio(16 / 9, contentMode: .fit) .contextMenu { Button("Test") {} } Text(asset.title) } .buttonStyle(.borderless) } } Attached video with the bug - https://www.icloud.com/iclouddrive/020zq2PxZ_E_1Pr0vE86-8aww#Screen_Recording_2024-06-13_at_9.26.15%E2%80%AFPM
2
2
174
Jun ’24
use of @Model macro from SwiftData causes project build to fail
Target tvOS 17.4 macOS Version 14.5 Xcode Version 15.4 (15F31d) I am working on integrating SwiftData (not migrating from CoreData) into an app in active development for tvOS, and I cannot get the project to compile whenever the @Model macro is introduced. I've traced every error back to the code generated by the @Model, and commenting it out removes the errors. I am able to use @Model on a fresh project, but any attempt to import SwiftData results in the build failing with the following errors: /var/folders/t5/c9qp7_4j19x9s3p3z26kn6v80000gn/T/swift-generated-sources/@__swiftmacro_9AeolusKit11DeviceModel0D0fMe_.swift:1:1 Type 'DeviceModel' does not conform to protocol 'Observable' /var/folders/t5/c9qp7_4j19x9s3p3z26kn6v80000gn/T/swift-generated-sources/@__swiftmacro_9AeolusKit11DeviceModelC2id18_PersistedPropertyfMa_.swift:4:9 Member 'setValue' cannot be used on value of type 'any BackingData<DeviceModel>'; consider using a generic constraint instead /var/folders/t5/c9qp7_4j19x9s3p3z26kn6v80000gn/T/swift-generated-sources/@__swiftmacro_9AeolusKit11DeviceModel0D0fMe_.swift:4:36 'Observable' is not a member type of struct 'AeolusKit.Observation' /var/folders/t5/c9qp7_4j19x9s3p3z26kn6v80000gn/T/swift-generated-sources/@__swiftmacro_9AeolusKit11DeviceModelC2id18_PersistedPropertyfMa_.swift:4:50 Cannot convert value of type 'String' to expected argument type 'PersistentIdentifier' /var/folders/t5/c9qp7_4j19x9s3p3z26kn6v80000gn/T/swift-generated-sources/@__swiftmacro_9AeolusKit11DeviceModelC2id18_PersistedPropertyfMa_.swift:8:54 Cannot infer key path type from context; consider explicitly specifying a root type /var/folders/t5/c9qp7_4j19x9s3p3z26kn6v80000gn/T/swift-generated-sources/@__swiftmacro_9AeolusKit11DeviceModelC2id18_PersistedPropertyfMa_.swift:12:64 Cannot infer key path type from context; consider explicitly specifying a root type /var/folders/t5/c9qp7_4j19x9s3p3z26kn6v80000gn/T/swift-generated-sources/@__swiftmacro_9AeolusKit11DeviceModel0D0fMm_.swift:25:50 Type 'Observation' has no member 'ObservationRegistrar' the code in question causing the error: import Foundation import SwiftData @Model public final class DeviceModel { @Attribute(.unique) public var id: String init(id: String) { self.id = id } } I've already done the following: clean the project erase the contents of the derived directory restart xcode restart my mac. I want to emphasize, I do not believe it is my code causing this issue, as commenting out the @Model result's in a perfectly normal build with no warnings or errors Any help is appreciated
2
0
279
Jun ’24
SwiftUI, tvOS - can't focus buttons
I'm trying to create a simple app for tvOS. But I immediately encountered difficulties. At the top I have a tab selection, and at the bottom there is item management. The problem is that all buttons in HStack are connected into one big button. So I solved it by adding .plain style to the buttons. But now I have a new problem - I can't focus on my buttons for tab selection. Here is the code: struct ContentView: View { var body: some View { VStack { HStack (alignment: .center) { Button("tab1"){} Button("tab2"){} } .frame(width: 500) // works when remove List { HStack { Text("Item 1") Spacer() Button("Button1"){} .buttonStyle(.plain) // added Button("Button2"){} .buttonStyle(.plain) // added } HStack { Text("Item 2") Spacer() Button("Button1"){} .buttonStyle(.plain) // added Button("Button2"){} .buttonStyle(.plain) // added } } } } } I would appreciate any help. Unfortunately, there is very little information on the Internet about designing applications for tvOS, which confuses me.
1
0
332
May ’24
tvOS 17 does not show the content of my text (.html) file
In my app I have the option to enable a help screen. This is a new view that simply shows a .html file. It works fine until tvOS 16.1 In tvOS 17.0 the screen is blank. Any ideas? This is how it looks in tvOS 16.1 This is tvOS 17.0 textView.backgroundColor = SKColor.white textView.isScrollEnabled = true textView.clipsToBounds = true textView.layer.cornerRadius = 20.0 textView.textColor = SKColor.black textView.isUserInteractionEnabled = true; textView.isScrollEnabled = true; textView.showsVerticalScrollIndicator = true; textView.bounces = true; textView.panGestureRecognizer.allowedTouchTypes = [NSNumber(value: UITouch.TouchType.indirect.rawValue)] if let htmlPath = Bundle.main.url(forResource: NSLocalizedString("manual", tableName: nil, comment: ""), withExtension: "html") { do { let attributedStringWithHtml:NSAttributedString = try NSAttributedString( url: htmlPath, options: [.documentType: NSAttributedString.DocumentType.html], documentAttributes: nil ) self.textView.attributedText = attributedStringWithHtml } catch { print("Error loading text") } }
1
0
422
May ’24
Xcode 13.0 can't pair to Apple TV 4K (tvOS 15.0)
On Xcode 13.0, I can no longer pair with an Apple TV 4K (tvOS 15.0). Until now it has always worked but since the new update to tvOS 15.0 and Xcode 13.0 I can no longer connect. I have gone through the following steps to connect: Open remote app and devices settings on Apple TV 4K (tvOS 15.0). Open Devices and Simulators in Xcode 13.0. Select Apple TV in the list and press "Pair". Code appears on the Apple TV and I can enter it in an Xcode window. After the code input, there is a short loading sign that a connection is being established. After a few seconds, the whole thing stops without an error message and the "Pair" button is visible again. Does anyone have the same problem? I would like to optimize my apps for tvOS 15 and test them on a physical device.
24
1
21k
May ’24
Settings.bundle in tvOS 15.0 seems to no longer work.
I have an App that builds for iOS, iPadOS, macOS and Apple TV, which was last released to all the App Stores in April. Preferences/settings are handled by the App itself except for the Apple TV variant, where I use a Settings bundle. This worked fine until tvOS 15.0, where it appears that tvOS is not updating the value of the App’s settings from NSUserDefaults when the Settings App opens. I have been working on this problem off and on for the last week and am at wits end. I’ve searched WWDC videos looking for a clue, there must be some simple change I cannot see. I’ve made clean projects for iOS and tvOS, and using the identical OBJ-C code and Settings plist entries, the iOS version works perfectly, the tvOS version fails in the simulator and on the device. I am not trying to synchronize Settings across devices, just persist across restarts on a single device. My code stores data correctly in NSUserDefaults, it simply seems that tvOS Settings App is not reading values from there for display, nor writing changes that the user makes from Settings back to user defaults. None of the types in the test projects work: TexField, Switch, Title. The test code is so simple I hesitate to include it, but the code and the NSUserDefaults key identifiers do match. This code will preset my App’s version number for Settings to display in iOS 15 but not tvOS 15. It used to work in tvOS 14: <key>DefaultValue</key> <string>DefaultVersionValue</string> <key>Type</key> <string>PSTitleValueSpecifier</string> <key>Title</key> <string>Version</string> <key>Key</key> <string>VersionKey</string> </dict> ```   NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];    [ud registerDefaults:@{      @"TextFieldKey" : @"TextFieldValue",      @"VersionKey" : @"VersionValue"    }];        [ud setObject:@"3.14" forKey:@"VersionKey"]; Any idea? Many thanks.
4
0
897
May ’24
tvOS focus - "ISSUE: This item is not visible onscreen."
Hey, I have an app that presents a UIWindow on top of an existing window. I've made all the needed calls to makeKeyAndVisible() and I can clearly see the new window with the subviews on the screen. I've made the subview receive focus by implementing them as custom views that have canBecomeFocused as true also the window implements preferredFocusEnvironments and returns these subviews The issue the focus engine doesn't want to move to the bottom view, it seems the first one does get focus. The error I'm seeing when printing using UIFocusDebugger.checkFocusability(): <UIFocusUpdateContext: 0x600003318000: previouslyFocusedItem=<FV: 0x102a17f30>, nextFocusedItem=(null), focusHeading=Down> The following issues were found that would prevent this item from being focusable: - ISSUE: This item is not visible onscreen. I can't find any reference online about this error, so it seems something really wild is going on and I can't find the reason. Did anyone encounter this before or knows when this error is being printed? What causes the focus engine to think the view is not visible when it's all there?
1
0
276
May ’24
Focused Tab Item Color in Apple TV Tab Bar Isn't Changing in SwiftUI
I'm developing an Apple TV OS app using SwiftUI. I'm encountering an issue with the color of the tab item. I want the color of the tab item to turn green when focused; for instance, when the tab item is selected, its background color should be green. Below is my current code, but it's not working. I've tried several other approaches, but none have worked. struct ContentView: View { @State private var selectedTab = 0 var body: some View { ZStack(alignment: .topLeading){ TabView(selection: $selectedTab) { HomeView() .tabItem { AppColors.gradientColor1 Label("Home", image: "home-dash") } .tag(0) ProductsView() .tabItem { Label("Products", image: "open box-search") } .tag(1) SearchView() .tabItem { Label("Search", image: "search") } .tag(2) } .accentColor(Color.green) .background(.black) Image("amazontabbarlogo") } } }
0
0
286
May ’24
tvOS play/pause gesture and non-av views
I have a two-view app where the main view is a procedural animation and a secondary view controls settings for the animation. I want to use Play/Pause to toggle between the views, but can't figure out how to do this. Ideally the main view does not have any visible control and the whole screen can be dedicated to the animation view. Attaching onPlayPauseCommand to the main view does not work. I've also tried managing focus using onFocus without success. I'm open to other ways to toggle between the main and settings views, it's just that Play/Pause seems the most intuitive.
1
0
361
Apr ’24
Apple TV won’t connect to my external surround sound speakers
I know that this is not a coding question and I have posted on the regular Apple Forum and have been working with the 800 Tech Support folk for 4 months. I am in a world of hurt. Have ATV + Samsung TV + external soundbar. All software versions are current NO Cable box (direct input). 4 months ago I had Cable box = zero problems. With Samsung on and ATV off, stereo = Dolby 5.1 sounds great. With ATV also on, no stereo. I can use Siri remote to activate stereo until I change to a new movie. ATV then reverts to mono = PCM One Tech Support lady said to just not watch multiple movie. ?$@!*+^? I have spoken with engineers at Samsung and Sonos (soundbar). Both say my cabling is correct = 1 cable from soundbar to HDMI Arc on TV + 1 cable from ATV to another HDMI port on TV. Another Tech Support folk said to connect ATV to soundbar. Soundbars don’t have gobs of HDMI ports, the TV does. ?!$@*^+%# I have spoken with Apple Tech Support with zero help for 3-4 months. I think I have been a good soldier. But it is time for real results. Please help
1
0
566
Apr ’24