is-camera-on:检查 Mac 摄像头开启状态,或发送开启通知

387 阅读1分钟
原文链接: github.com

Check if the built-in Mac camera is on

The camera is commonly known as FaceTime HD or iSight.

This module can be useful to check if the camera is already in use or notify you if it's turned on when you didn't intend it to be.

Requirements

  • macOS 10.11+
  • Xcode 9+
  • Swift 4+

Install

With SPM:

.package(url: "https://github.com/sindresorhus/is-camera-on", from: "2.0.0")

Usage

import IsCameraOn

print(isCameraOn())
//=> true

Related

License

MIT © Sindre Sorhus