AVPlayerItemHomeOutput 0.1.5

AVPlayerItemHomeOutput 0.1.5

测试已测试
Lang语言 SwiftSwift
许可证 MIT
发布最后发布2017年5月
SwiftSwift 版本3.0
SPM支持 SPM

alexruperez 维护。




AVPlayerItemHomeOutput

codebeat badge

AVPlayerItemHomeOutput

AVPlayerItemHomeOutput 允许您协调与您的 HomeKit 灯泡相关的内容输出。

换句话说,它变成了 播放器的环绕灯效😀

适用于所有 HomeKit(和 HomeBridge)兼容的灯泡。

AVPlayerItemHomeOutput

安装

AVPlayerItemHomeOutput 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中:

pod 'AVPlayerItemHomeOutput'

或者使用 Swift Package Manager 安装

dependencies: [
    .Package(url: "https://github.com/alexruperez/AVPlayerItemHomeOutput.git")
]

使用

let sample = URL(string: "https://raw.githubusercontent.com/bower-media-samples/big-buck-bunny-1080p-30s/master/video.mp4")!
let asset = AVAsset(url: sample)
let playerItem = AVPlayerItem(asset: asset)
let homeOutput = AVPlayerItemHomeOutput(playerItem) // Only create your instance...
homeOutput.setDelegate(self, queue: nil) // Optional AVPlayerItemOutputPullDelegate.
playerItem.add(homeOutput) // ...and add it to your AVPlayerItem!
let playerViewController = AVPlayerViewController()
playerViewController.player = AVPlayer(playerItem: playerItem)
present(playerViewController, animated: true) {
        playerViewController.player?.play()
}

不要忘记

NSHomeKitUsageDescription 键添加到您的 Info.plist 中,以指定您应用中 HomeKit 的使用。

等。

  • 非常欢迎贡献。
  • 感谢贡献(让我们一起传播这个消息!),但不是强制的。

作者

alexruperez[email protected]

许可证

AVPlayerItemHomeOutput 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。