apple-tv

Forced Touch with tvOS

我只是一个虾纸丫 提交于 2019-12-21 20:24:35
问题 Does anybody know how to detect a forced touch/click on the remote control with tvOS? I want to use the click in a Sprite Kit scene to open a 'game paused alert'. I have no UIKit controls which have the focus and will react on the click. I'm already using the 'normal' touch events on the remote control to move my sprites around. 回答1: Apple suggests using UIPressesEvent 's to detect presses/clicks. override func pressesBegan(presses: Set<UIPress>, withEvent event: UIPressesEvent?) { for item

Change background color for page control

試著忘記壹切 提交于 2019-12-20 06:42:19
问题 Is there any way to change background color of page control in tvOS ? NOTE : i want to set background color as clear color I have try the below code, but it is not working in tvOS . var pageControl : UIPageControl! pageControl = UIPageControl(frame: CGRectMake(0, self.view.frame.height - 200, self.view.frame.width, 50)) pageControl.pageIndicatorTintColor = UIColor(red: 255/255, green: 255/255, blue: 255/255, alpha: 0.70) pageControl.currentPageIndicatorTintColor = UIColor.whiteColor()

TcpClient or HttpWebRequest to Apple TV ending after 30 seconds?

瘦欲@ 提交于 2019-12-19 08:42:13
问题 I'm working on creating an Library in C# to use the Airplay protocol to send Photos and Video to my Apple TV (Specifically working with Generation 3 but hopefully that should not matter for this). https://airlib.codeplex.com/ All of the commands for Airplay are HTTP on port 70 as per this spec: http://nto.github.com/AirPlay.html I have been successful at getting both photos and video to play on the Apple TV, but no matter what I do the AppleTV will only play 30 seconds worth of video. It

UITextView not Scrolling in tvOS

℡╲_俬逩灬. 提交于 2019-12-19 03:24:37
问题 I have a UITextView in my TV app, when i try to make it focusable then the UI is not making it focusable and i am unable to scroll it. I read some questions about it and some says that its a known issue and we should use storyboards. Actually i am using storyboards but still unable to get this to work. I have also tried to make it selectable , scrollEnabled and userInteractionEnabled and then finally also tried this line of code but none of them is working. descriptionLbl.panGestureRecognizer

How do I play a video on tvOS for Apple TV?

末鹿安然 提交于 2019-12-18 10:35:45
问题 I started a blank tvOS project and created the following code: - (void)viewDidLoad { [super viewDidLoad]; AVPlayer *avPlayer = [AVPlayer playerWithURL:[NSURL URLWithString:@"http://www.myurl.com/myvideo.mp4"]]; AVPlayerLayer *avPlayerLayer = [AVPlayerLayer playerLayerWithPlayer:avPlayer]; avPlayerLayer.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height); [self.view.layer addSublayer:avPlayerLayer]; [avPlayer play]; } Nothing happens in the simulator though once

UICollectionViewCell to UIButton Focus in tvOS

☆樱花仙子☆ 提交于 2019-12-18 02:42:20
问题 I have a UICollectionView which contains 12-13 UICollectionViewCells. I can easily focus on the UICollectionViewCells and everything works. There is a UIButton outside the UICollectionView. If I am on the first cell or the second cell and I swipe up then I can easily focus on the UIButton. When I am on the third cell then I am not able to move the focus to the UIButton. Any ideas what is going on? 回答1: You should use a UIFocusGuide that encompasses the UIButton you want to focus. Make the

AVPlayer with playback controls of avplayerviewcontroller

时光怂恿深爱的人放手 提交于 2019-12-17 19:18:49
问题 I am putting n avplayer inside of a view controller to customize some other elements of the view controller but I still want the playback and scrubbing controls used in AVPlayerViewController. Is there a way to enable these controls for the Avplayer when I am not using AvPlayerViewcontroller? 回答1: No. The usual solution (explicitly advised by Apple) is to use the AVPlayerViewController as an embedded view controller - i.e., make your view controller a custom parent view controller and the

Web app in tvOS

元气小坏坏 提交于 2019-12-17 04:31:52
问题 Apple has released it's SDK for apple tv yesterday. Most apps for TVs are web based (html, javascript and css) and I would like to port an existing tv web app to the tvOS. The SDK in Xcode shows no Webview implementation like in iOS for creating apps based in html, javascript and css, however, according to the docs, it is possible to use javascript using tvjs framework, but instead of html, apple has it's own markup language for TVs called TVML. My question is: Is it possible to port an

Web app in tvOS

这一生的挚爱 提交于 2019-12-17 04:31:20
问题 Apple has released it's SDK for apple tv yesterday. Most apps for TVs are web based (html, javascript and css) and I would like to port an existing tv web app to the tvOS. The SDK in Xcode shows no Webview implementation like in iOS for creating apps based in html, javascript and css, however, according to the docs, it is possible to use javascript using tvjs framework, but instead of html, apple has it's own markup language for TVs called TVML. My question is: Is it possible to port an

UITapGestureRecognizer & tvOS remote for Pause/Play Button

喜欢而已 提交于 2019-12-13 19:40:44
问题 I am trying to create an action when a user clicks the pause/play button on the Apple TV Remote. I looked at the documentation, but the code Apple's documentation recommended does not work. Here is my code below. Could someone please tell me what I am doing wrong? Things to consider: I am using an AVPlayerMovieController & I do have another gesture recognizer in my code but for it is a swipe gesture AND this method is getting called, just not the Pause/Play. Can someone please help?