标签: apple-tv

iOS屏幕镜像显示所选应用程序的过扫描边框

问题:iPhone屏幕镜像和我的应用程序的专用外部视图显示所有侧面都有一英寸的黑色边框.

但是:有些视图在全屏幕上显示完美而没有黑色边框,例如Apple TV菜单和照片应用程序.

已经尝试过 - 没有效果:

设置:iPhone 4S(5.0.1),Apple TV第2代(4.4.4)

有什么建议我还可以尝试吗?

screen mirroring ios airplay apple-tv

7
推荐指数
1
解决办法
6060
查看次数

如何使用Apple TV遥控器获取动作事件

有没有人想出如何使用新的Apple TV遥控器进行动作事件?谢谢.

我试过打电话

override func motionBegan(motion: UIEventSubtype, withEvent event: UIEvent?) {
    super.motionBegan(motion, withEvent: event)
    print("motion!")
}
override func motionEnded(motion: UIEventSubtype, withEvent event: UIEvent?) {
    super.motionEnded(motion, withEvent: event)
    print("motion ended!")
}
Run Code Online (Sandbox Code Playgroud)

有和没有电话超级给我什么都没有.

apple-tv swift tvos

7
推荐指数
1
解决办法
3358
查看次数

无法将UICollectionViewCell集中在UITableViewCell中

所以我正在探索新的tvOS.因为我想要复制应用商店的水平功能部分(例如"最佳新应用")

我的计划是使用UITableView来布局基本结构(行),并为所有单独的可水平滚动项使用UICollectionView.

不幸的是,tvOS始终关注UITableViewCell,而不是内部的UICollectionViewCell.我已经读过了

override var preferredFocusedView: UIView? {
    return aView
}
Run Code Online (Sandbox Code Playgroud)

所以在我的控制器中使用这个在获得正确的子视图方面很难.

有什么我可以研究或有人可以指出我正确的方向?迭代所有子视图直到我得到正确的视图似乎是一个坏主意.

非常感谢!

uitableview apple-tv uicollectionview swift tvos

7
推荐指数
1
解决办法
3184
查看次数

检测Apple TV第4代何时从睡眠中醒来

我正在研究一些家庭自动化程序,我希望能够做的事情之一是检测我的第四代Apple TV是否已经从睡眠中醒来.当有人按下Siri遥控器上的按钮将其唤醒时,通常只会发生这种情况.

我有一台PC(连接到与Apple TV相同的电视机),它有一个Pulse-Eight USB-CEC适配器,所以我尝试的第一件事就是使用CEC确定Apple TV何时清醒.不幸的是,它不可靠,因为监视Apple TV的电源状态以查看它何时唤醒会产生误报.(我应该注意,我没有在Apple TV上启用"控制电视和接收器",并且无法为我正在处理的特定项目打开它,因为我需要Apple TV才能更改电视的输入. )

我正在考虑其他一些方法来做到这一点.我对任何可能性持开放态度,包括:

  • 在Apple TV上使用私有API
  • 在Apple TV的背景中运行"始终开启"程序,当Apple TV唤醒时发送信号,如果可能的话.(我怀疑它不是.)
  • 监控Siri Remote和Apple TV之间的蓝牙通信,如果可能的话
  • 以某种方式过滤HDMI-CEC命令,以便我可以打开"控制电视和接收器",允许Apple TV的CEC命令打开和关闭电视,并排除更改电视输入的命令.
  • 任何其他方法,无论多么黑巧或荒谬,只要它有效!

有没有人有什么建议?我已经没事了!

bluetooth home-automation hdmi apple-tv tvos

7
推荐指数
1
解决办法
922
查看次数

将自己的视频提供给Apple TV屏幕保护程序

在第四代Apple TV上,您可以选择自定义的json文件URL来加载除苹果之外的屏幕保护程序电影.为此,你必须进入设置,移动到约,在开启时,单击播放/暂停4次.这进入商店/频道模式,允许在选择频道模式时通过描述下载URL的中间JSON文件指定从哪里获取电影的URL.这对我有一次工作,我的一部电影下载了.但是从那时起我改变了网址,Apple TV几天没有下载任何新电影.

我有1080p版本(每部电影约600MB)和720p版本(每部电影约70MB).我的JSON文件版本位于:http://wx.inside.net/sat/ss.json,你可以在这里将它与Apple自己的版本进行比较:http://a1.phobos.apple.com/us/ r1000/000/Features/atv/AutumnResources/videos/entries.json,我觉得我的语法还行.

Apple TV一直处于永久性状态,因此可以有足够的时间下载新电影,并且电影已经可用(并且可以使用JSON文件中的URL在iPad或MBP上播放.

问题: - 有没有办法从Apple TV获得一些关于它是否已获取最新JSON文件的反馈? - 可以删除本地存储/缓存的电影以强制下载新电影吗? - 它将播放哪些电影文件有任何尺寸/质量限制吗? - 我可以以某种方式强制Apple TV重新加载屏保URL吗?

json ios apple-tv

7
推荐指数
1
解决办法
8316
查看次数

ViewController和TabBarViewcontroller的登录注销?苹果电视

有人会有这种布局的经验吗?我有一个用于登录的初始ViewController然后在登录之后它从LoginViewController转到一个TabBarViewController作为presentViewController().所有这一切都运行良好并注销但是一旦我注销并在同一会话中重新登录,它看起来像在ontop上创建另一个Tabbarviewcontroller,然后崩溃应用程序.贝娄是故事板布局的图像

let mainStoryboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle())
    let vc : UIViewController = mainStoryboard.instantiateViewControllerWithIdentifier("TabBarViewController") as UIViewController
    self.presentViewController(vc, animated: true, completion: nil)
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

xcode apple-tv swift2

7
推荐指数
1
解决办法
87
查看次数

如何在swift中连接外部游戏控制器 - 苹果电视

我在这里遵循了这个教程:https://cartoonsmart.com/how-to-support-external-game-controllers-with-swift-2-and-sprite-kit-for-the-new-apple-tv/ to在sprite工具包中将外部游戏控制器连接到apple tv,但我无法使用教程代码.我没有得到任何错误消息,但它根本无法正常工作.这是我的代码:

func setUpControllerObservers() {
    NotificationCenter.default.addObserver(self, selector: #selector(connectControllers), name: NSNotification.Name.GCControllerDidConnect, object: nil)
    NotificationCenter.default.addObserver(self, selector: #selector(disconnectController), name: NSNotification.Name.GCControllerDidDisconnect, object: nil)
}

func connectControllers() {
    var count = 0
    for controller in GCController.controllers() {
        count = count + 1
        print(count)
        print(controller.extendedGamepad != nil)
        print(controller.microGamepad != nil)
        print(controller.gamepad != nil)
        if (controller.extendedGamepad != nil && controller.playerIndex == .indexUnset) {
            if (count == 1) {
                controller.playerIndex = .index1
            }
            else if (count == 2) {
                controller.playerIndex = .index2
            }
            else …
Run Code Online (Sandbox Code Playgroud)

apple-tv gamecontroller swift

7
推荐指数
1
解决办法
677
查看次数

在iphone上使用大量电池将视频从网址播放到ATV

我正在编写一个使用MPMoviePlayerController播放网址的应用.该应用程序在后台运行,使用airplay也可以使用ATV,macmini使用airserver和XBMC.该URL是本地网络上的电影文件.我理解的方式是手机没有做任何繁重的工作,只是将网址传递给苹果电视,只要网址指向AppleTV支持的媒体,它就会播放.

我遇到的问题是苹果电视必须积极地ping通iphone并保持wifi有效,因为电池寿命非常严重.播放一部平均大小的电影会使iPhone 3GS的电池续航时间缩短约2/3,而iPhone 4S的电池续航时间则为1/2.

如果我正在使用空中服务器在mac mini上玩,那么手机上的电池寿命就会降低,就像手机背景并没有播放任何东西一样.我注意到,如果我停止在iPhone上的wifi,那么电影将继续在Mac mini上播放,但在ATV上停止约30秒.我猜测ATV一直在推出一个事件,说它正在播放,如果没有收到OK,那么它就会停止播放.

有什么我做错了吗?让其他人使用手机中的airplay体验相同的电量消耗吗?我试过别人的应用程序,它也做了同样的事情.

iphone airplay apple-tv

6
推荐指数
1
解决办法
819
查看次数

禁用焦点触发的UICollectionView滚动

有没有办法禁用自动滚动UICollectionView时单元格聚焦?我想在聚焦时手动调整单元格的内容偏移量.

我不想更新内容偏移量:

- (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context
       withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator
{
    [coordinator addCoordinatedAnimations:^
     {
         [UIView animateWithDuration:[UIView inheritedAnimationDuration]
                          animations:^
          {
              // Move next focused cell.
              if ([context.nextFocusedView isKindOfClass:[YBZEventCollectionViewCell class]])
              {
                  UICollectionViewCell *cell = (UICollectionViewCell *)context.nextFocusedView;

                  CGPoint offset = CGPointMake(CGRectGetMinX(cell.frame), 0.0f);

                  [_collectionView setContentOffset:offset];
              }
          }];

     } completion:nil];
}
Run Code Online (Sandbox Code Playgroud)

这是有效的,但由于焦点引擎也移动我的单元格(滚动它)我最终得到的动画不顺畅,在它的末尾有一个"踢".

apple-tv uicollectionview tvos

6
推荐指数
1
解决办法
2402
查看次数

通过蓝牙从iPhone检测Siri Remote

是否可以使用iOS应用程序检测Apple TV 4 Siri Remote CoreBluetooth?我能够检测到Apple TV,但是我没有运气检测到Siri Remote.在Siri的远程使用蓝牙4.0,所以我假设它是检测到.理想情况下,我想检测Siri Remote,即使它已经与Apple TV配对了.

只需能够检测来自Siri Remote的任何信号/知道它在用户iPhone附近就是我所追求的.

#import "ViewController.h"
@import CoreBluetooth;

@interface ViewController () <CBPeripheralDelegate, CBCentralManagerDelegate>

@end

@implementation ViewController {
    CBCentralManager *btManager;
}

-(void)viewDidLoad {
    [super viewDidLoad];
    btManager = [[CBCentralManager alloc] initWithDelegate:self queue:nil];
}

#pragma mark - CBCentralManagerDelegate Methods

-(void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary<NSString *, id> *)advertisementData RSSI:(NSNumber *)RSSI {
    NSLog(@"peripheral name: %@", peripheral.name);
    NSLog(@"peripheral services: %@", peripheral.services);
    NSLog(@"peripheral identifier: %@", peripheral.identifier);
    NSLog(@"peripheral state: %ld", (long)peripheral.state);
    NSLog(@"RSSI: %@ \n\n", RSSI);
}

-(void)centralManagerDidUpdateState:(CBCentralManager …
Run Code Online (Sandbox Code Playgroud)

bluetooth ios apple-tv core-bluetooth siri-remote

6
推荐指数
0
解决办法
658
查看次数