tvOS is the operating system for Apple TV.

tvOS Documentation

Posts under tvOS tag

158 Posts
Sort by:
Post not yet marked as solved
0 Replies
161 Views
I have a ATV4k 32 GB that the audio has stearted curtting out regularly for about 3 seconds and about every 2-3 minutes. It started out being once in a while, now it's regularly across most streaming apps but most severely AppleTV+. serial# DY5DMBLWJ1WF
Posted
by The-Bendu.
Last updated
.
Post not yet marked as solved
0 Replies
186 Views
I have 3 UIButton instances in a horizontal UIStackView. I get the focus on the first one. But when I swipe to the right, the next button does not get focus...
Posted
by shindo.
Last updated
.
Post not yet marked as solved
0 Replies
253 Views
Hi Team, In tvOS based on Siri/IR Remote, Keyboard layout will be differently. Is there a way to identify whether user is using Siri Remote or IR Remote, so that we update the UI accordingly. We are using react native or tvOS development and search results UI is developed in React Native. So, we wanted to know which remote user is using.
Posted Last updated
.
Post not yet marked as solved
2 Replies
999 Views
We use a UIScrollView but manage our own virtualization and when fast scrolling kicks in tvOS adds a secret child to our UIScrollView of type _UIFocusFastScrollingIndexBarView and gives it focus. I don't see shouldUpdateFocus being called for when this happens so I can't stop it. This is wreaking havok with our input and virtualization systems.We've tried scrollView.indexDisplayMode = .alwaysHidden but that doesn't stop this.
Posted
by jhbo.
Last updated
.
Post not yet marked as solved
1 Replies
263 Views
I have a UICollectionViewController in shared iOS/tvOS code. On iOS I use context menus while I fallback to UIAlertController (alert sheet) triggered by a long press on tvOS. viewDidLoad: override func viewDidLoad() {     super.viewDidLoad() // ...     #if os(tvOS)     let longPressGestureRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(longPressAction(_:))) collectionView.addGestureRecognizer(longPressGestureRecognizer)     #endif } Selector: #if os(tvOS) @objc func longPressAction(_ sender: UIGestureRecognizer) {     guard sender.state == .began else {         return     }     if let indexPath = collectionView.indexPathForItem(at: sender.location(in: collectionView)) {         let ac = UIAlertController(/* ... */) // alert sheet         present(ac, animated: true, completion: nil)     } } #endif Upon long pressing, the alert sheet gets displayed properly on tvOS but the first tap on one of the sheet actions is ignored (this calls longPressAction again with a .cancel state). I tried inserting a sender.isEnabled = false after the guard but it simply caused the .cancel state to come in faster while still eating the first tap. Suggestions?
Posted
by bbousquet.
Last updated
.
Post marked as solved
2 Replies
301 Views
I have a UITableViewController shared between my iOS and tvOS apps. In order to refresh some of the cells, I call reloadRows. It works fine as far as updating the cell's data but, on tvOS, it moves the focus back to the top of the table. I've noticed that preferredFocusEnvironments does not get called (unlike what happens when I do reloadData). This is pretty much the same issue mentioned in the following post (years ago): https://developer.apple.com/forums/thread/67219 Any suggestions?
Posted
by bbousquet.
Last updated
.
Post not yet marked as solved
1 Replies
295 Views
Hi! I learnt that tvOS 15's playback has a new red "LIVE" badge next to title view. The LIVE badge appears when the video is streaming. However, how does it know the video is live streaming and manage to display? Is the information which defines Live streaming included in metadata? I watched WWDC 21 and read an official document but couldn't find the answer. WWDC21: https://developer.apple.com/videos/play/wwdc2021/10191/
Posted
by nihaoya.
Last updated
.
Post not yet marked as solved
10 Replies
2.3k Views
Are there any events fired when the TV attached to the ATV is turned off?
Posted
by tmm1.
Last updated
.
Post not yet marked as solved
7 Replies
744 Views
I submited my app last Wenesday as soon as the submission process was open. It's been over a week now and still in "In Review". Anyone else?
Posted Last updated
.
Post not yet marked as solved
0 Replies
266 Views
Hi, In the past, I have tried to make an app that reads JSON from a remote server. I tried to use the same steps that are done with an iOS app, without success. I need to know if its even possible and where I would need to look to get this up and running. Thanks, Dan Uff
Posted Last updated
.
Post not yet marked as solved
0 Replies
196 Views
Hi, I am creating audio player in tvos which is quite similar to Podcast App (Playing in background and stoping when user press pause button from Tv Remote). It is working fine when app is in foreground but creating issue when app is background. Audio Player is not getting stopped when user is pressing play/Pause button from remote. I have added MPRemoteCommandCenter target to my home controller. And I am using my audio player as single ton class. Below is snap shot of my code  private func setUpCommand() {     let commandCenter = MPRemoteCommandCenter.shared()     commandCenter.playCommand.isEnabled = true     commandCenter.pauseCommand.isEnabled = true     commandCenter.playCommand.addTarget {(commandEvent) -> MPRemoteCommandHandlerStatus in       PodcastPlayer.shared.playPauseCommad()       return .success     }      commandCenter.pauseCommand.addTarget {(commandEvent) -> MPRemoteCommandHandlerStatus in       PodcastPlayer.shared.playPauseCommad()       return .success     }   } Above code is not triggering when app is in background.
Posted Last updated
.
Post not yet marked as solved
1 Replies
300 Views
I am unable to get In-App Purchases working on a tvOS app target. The IAP SKProductsRequest is successful when running the same code in my iOS target/simulator, but does not work in either a tvOS simulator or physical device. class StoreManager: NSObject, ObservableObject, SKProductsRequestDelegate, SKPaymentTransactionObserver {          //FETCH PRODUCTS     var request: SKProductsRequest!          @Published var premium = SKProduct()          func getProducts() {         print("Start requesting products ...")         let productID = "com.willswire.appname.premium"         let request = SKProductsRequest(productIdentifiers: Set([productID]))         request.delegate = self         request.start()     }          func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) {         print("Did receive response")                  if let product = response.products.first {             DispatchQueue.main.async {                 self.premium = product             }         }                  for invalidIdentifier in response.invalidProductIdentifiers {             print("Invalid identifiers found: \(invalidIdentifier)")         }     }          func request(_ request: SKRequest, didFailWithError error: Error) {         print("Request did fail: \(error)")     }          //HANDLE TRANSACTIONS     @Published var transactionState: SKPaymentTransactionState?          func purchaseProduct() {         if SKPaymentQueue.canMakePayments() {             let payment = SKPayment(product: self.premium)             SKPaymentQueue.default().add(payment)         } else {             print("User can't make payment.")         }     }          func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {         for transaction in transactions {             switch transaction.transactionState {             case .purchasing:                 transactionState = .purchasing             case .purchased:                 UserDefaults.standard.setValue(true, forKey: "premium")                 queue.finishTransaction(transaction)                 transactionState = .purchased             case .restored:                 UserDefaults.standard.setValue(true, forKey: "premium")                 queue.finishTransaction(transaction)                 transactionState = .restored             case .failed, .deferred:                 print("Payment Queue Error: \(String(describing: transaction.error))")                 queue.finishTransaction(transaction)                 transactionState = .failed             default:                 queue.finishTransaction(transaction)             }         }     } }
Posted Last updated
.
Post not yet marked as solved
3 Replies
1k Views
Is there a way to multiselect a variety of airplay 2 speakers as the default speakers for the apple tv (gen4 4k). I have also tried aggregating them in the home app under one labeled system, however the apple tv does not seem to recognize the speaker group (Sonos arc, two ones, and sub grouped together, and two homepod minis).
Posted
by mhannamd.
Last updated
.
Post not yet marked as solved
4 Replies
796 Views
When we add a background audio element in tvOs v15 it generates the exception below: Exception            NSException *    "*** -[AVPlayerPlaybackCoordinator setFigPlaybackCoordinator:] invalid parameter not satisfying: figPlaybackCoordinator != NULL"  0x00006000010d16e0 Below is our TVML: <?xml version="1.0" encoding="UTF-8" ?> <document> <head> <style> * { <!-- To cutomize the interval image is displayed on screen --> tv-transition-interval:8.0; } </style> </head> <mainTemplate> <background> <img src="{{ our server }}/temp/AppleTvProto1/splash.jpg" /> <img src="{{ our server }}/temp/AppleTvProto1/splash_1.jpg" /> <img src="{{ our server }}/temp/AppleTvProto1/splash_2.jpg" /> <audio> <asset id="main_audio" src="{{ our server }}/temp/AppleTvProto1/background.mp3" /> </audio> </background> <menuBar> <section> <menuItem onselect="getDocument('/appletv-live')"> <title>Live</title> </menuItem> <menuItem onselect="getDocument('/appletv-messages')"> <title>Messages</title> </menuItem> <menuItem onselect="getDocument('/appletv-music')"> <title>Music</title> </menuItem> </section> </menuBar> </mainTemplate> </document>
Posted Last updated
.
Post not yet marked as solved
2 Replies
482 Views
I reset the old player item(remove all observers also) and avplayercontroller then add a new avplayerviewcontroller instance and avplayer and player item on playing a new asset/stream etc. It works fine and no crash in tvos 14, 13 etc. But in tvos 15.2 and above i get the following stack trace. Foundation - _NSKVONotifyingOriginalClassForIsa Foundation _NSKVONotifyingOriginalClassForIsa  Foundation _NSKeyValueObservationInfoGetObservances  Foundation -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:maybeNewValuesDict:usingBlock:]  Foundation -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:]  Foundation _NSSetObjectValueAndNotify  AVKit -[AVInterstitialController dealloc]  AVKit -[AVPlayerControllerTVExtras .cxx_destruct]
Posted Last updated
.
Post not yet marked as solved
0 Replies
182 Views
Hello! We are currently trying to develop a TVos Application using SwiftUI, which uses the regular siri-remote-commands for the primary navigation. However, we would like to develop a custom remote control acting as Bluetooth-Keyboard, which has additional keys such as numbers to improve accessibility amongst technically unskilled people. (For prototyping we use an Apple Magic Keyboard) It seems to me tough, that no Keyboard-Inputs apart from the ones also aviable on the Siri remote, are able to be intercepted in any way outside of Textfields in TVos, is that correct? I tried accessing the Keyboard via the CoreBluetooth stack, but connected HIDs are not showing up there (By design, how i learned) Is there any way to recieve non-siri-remote-compliant Keyboard-Inputs (such as the numbers) on TVos, without an overlay popping up?
Posted Last updated
.
Post marked as solved
1 Replies
828 Views
I have the following crash in my Firebase Crashlytics dashboard.How to solve? AVFCore <redacted> Crashed: com.apple.main-thread 0 WTPlayer 0x4ca8 (missing symbol UUID 4f2a03f9ccd73e2dae155590c937b9e7) 1 HamiVideo_tvOS 0x288acc (missing symbol UUID 8943628b2b063a83b199dac92588de61) 2 HamiVideo_tvOS 0x2913c8 (missing symbol UUID 8943628b2b063a83b199dac92588de61) 3 WTPlayer 0xe778 (missing symbol UUID 4f2a03f9ccd73e2dae155590c937b9e7) 4 WTPlayer 0xe850 (missing symbol UUID 4f2a03f9ccd73e2dae155590c937b9e7) 5 AVFCore 0xa1514 <redacted> + 68 6 AVFCore 0xa137c <redacted> + 80 7 libdispatch.dylib 0x5670 <redacted> + 20 8 libdispatch.dylib 0x8b44 <redacted> + 504 9 libdispatch.dylib 0x1bc48 <redacted> + 1356 10 libdispatch.dylib 0x13ac4 _dispatch_main_queue_callback_4CF+772 11 CoreFoundation 0x81b20 <redacted> + 16 12 CoreFoundation 0x7b940 <redacted> + 2540 13 CoreFoundation 0x7aa24 CFRunLoopRunSpecific + 600 14 GraphicsServices 0x6600 GSEventRunModal + 164 15 UIKitCore 0xb2fd94 <redacted> + 1100 16 UIKitCore 0xb354d4 UIApplicationMain + 168 17 libswiftUIKit.dylib 0x1d580 $s5UIKit17UIApplicationMainys5Int32VAD_SpySpys4Int8VGGSgSSSgAJtF+104 18 HamiVideo_tvOS 0x74dc (missing symbol UUID 8943628b2b063a83b199dac92588de61) 19 ??? 0x100b8d21c (missing sign)
Posted
by PaulLien.
Last updated
.
Post not yet marked as solved
0 Replies
239 Views
how do I put the app i am developing on my apple th for testing?my apple tv is the latest 4K model.
Posted Last updated
.
Post not yet marked as solved
0 Replies
292 Views
I tried to run multiple demos utilising spatial audio. However no matter what I do, I only get 2 channel output. Which is also confirmed by calling:       let numHardwareOutputChannels = gameView.audioEngine.outputNode.outputFormat(forBus: 0).channelCount My appleTV is connected to DolbyAtmos capable audio system which works just fine. So my question is more less - how to convince TVOS app that my appleTV has multichannel output ?!
Posted Last updated
.