-
-
Notifications
You must be signed in to change notification settings - Fork 620
Moving from 1.3.x APIs to 1.4.0
shogo4405 edited this page Apr 14, 2023
·
3 revisions
stream.captureSettings = [
.fps: 30, // FPS
.sessionPreset: AVCaptureSession.Preset.medium, // input video width/height
// .isVideoMirrored: false,
// .continuousAutofocus: false, // use camera autofocus mode
// .continuousExposure: false, // use camera exposure mode
// .preferredVideoStabilizationMode: AVCaptureVideoStabilizationMode.auto
]
stream.frameRate = 30.0
stream.sessionPreset = .medium
stream.videoCapture(for: 0).isVideoMirrored = false
// stream.videoCapture(for: 0).preferredVideoStabilizationMode = AVCaptureVideoStabilizationMode.auto
let device = AVCaptureDevice.default(for: AVMediaType.video) // or stream.videoCapture(for: 0).device
do {
try device.lockForConfiguration()
device.exposurePointOfInterest = point
device.exposureMode = continuousExposure ? .continuousAutoExposure : .autoExpose
device.unlockForConfiguration()
} catch let error as NSError {
logger.error("while locking device for exposurePointOfInterest: \(error)")
}
stream.audioSettings[.muted] = true
stream.videoSettings[.muted] = true
stream.hasAudio = false
stream.hasVideo = false
stream.recordSettings = [
AVMediaType.audio: [
],
AVMediaType.video: [
]
]
stream.startRecording()
stream.startRecording([
AVMediaType.audio: [
],
AVMediaType.video: [
]
])
stream.attachScreen(ScreenCaptureSession(shared: UIApplication.shared))
screen = IOUIScreenCaptureUnit(shared: UIApplication.shared)
screen.delegate = stream
screen.startRunning()
stream.publish("streamName")
HaishinKit.swift | 🇬🇧 HaishinKit.kt | 🇯🇵 Zenn