PlanetKitScreen
public class PlanetKitScreen : NSObject
extension PlanetKitScreen: PlanetKitScreenControllable
A class representing the screen in the PlanetKit framework.
-
The shared instance of the
PlanetKitScreen
class.Declaration
Swift
@objc public static var shared: PlanetKitScreen
-
The delegate for the video stream.
Declaration
Swift
public weak var delegate: PlanetKitVideoStreamDelegate? { get set }
-
An array of
PlanetKitScreenCaptureDisplay
objects representing the available displays.Declaration
Swift
@objc public var displays: [PlanetKitScreenCaptureDisplay] { get }
-
An array of
PlanetKitScreenCaptureWindow
objects representing the available windows.Declaration
Swift
@objc public var windows: [PlanetKitScreenCaptureWindow] { get }
-
The current device used for screen capture.
Declaration
Swift
public var currentDevice: PlanetKitScreenCaptureDevice? { get set }
-
The preferred frame rate for the screen.
Declaration
Swift
public var preferredFrameRate: PlanetKitFrameRate { get set }
-
A Boolean value indicating whether the screen can be captured.
Declaration
Swift
@objc public var canScreenCapture: Bool { get }
Return Value
true
if the screen can be captured,false
otherwise. -
Opens the screen capture preference in the system preferences.
Declaration
Swift
@objc public static func openScreenCapturePreference()
-
Called when the FPS limit for the screen is updated.
Declaration
Swift
public func didFpsLimitUpdate(enabled: Bool, fps: Int32)
Parameters
enabled
A Boolean value indicating whether the FPS limit is enabled.
fps
The desired frames per second (FPS) for the screen.
-
A Boolean value indicating whether the screen is started.
Declaration
Swift
public var isStart: Bool { get }
-
Starts the screen capture with the specified device.
Declaration
Swift
public func start(device: PlanetKitScreenCaptureDevice, completion: @escaping (Bool) -> Void)
Parameters
device
The screen capture device to use.
completion
A closure that is called when the screen capture starts. The closure takes a single
Bool
parameter indicating whether the screen capture started successfully. -
Stops the screen capture.
Declaration
Swift
public func stop(completion: @escaping (Bool) -> Void)
Parameters
completion
A closure that is called when the stop operation is completed. The closure takes a Boolean parameter indicating whether the operation was successful.
-
Changes the device used for screen capture.
Declaration
Swift
public func change(device: PlanetKitScreenCaptureDevice, completion: @escaping (Bool) -> Void)
Parameters
device
The new device to use for screen capture.
completion
A closure that is called when the change operation is completed. The closure takes a Boolean parameter indicating whether the operation was successful.
-
Adds an interrupt receiver to the screen.
Declaration
Swift
public func addInterruptReceiver(_ interruptReceiver: PlanetKitScreenInterruptDelegate)
Parameters
interruptReceiver
The interrupt receiver to add.
-
Removes an interrupt receiver from the screen.
Declaration
Swift
public func removeInterruptReceiver(_ interruptReceiver: PlanetKitScreenInterruptDelegate)
Parameters
interruptReceiver
The interrupt receiver to remove.
-
Sets the overlay windows for the PlanetKit screen.
Declaration
Swift
@objc public func setOverlay(windowIDs: Set<CGWindowID>)
Parameters
windowIDs
A set of
CGWindowID
representing the overlay windows. -
Clears the overlay windows for the PlanetKit screen.
Declaration
Swift
@objc public func clearOverlay()