-
-
Notifications
You must be signed in to change notification settings - Fork 620
Moving from 1.2.x APIs to 1.3.0
shogo4405 edited this page Dec 24, 2022
·
1 revision
// startRecording
rtmpStream.publish("streamName", .localRecord)
// stopRecording
rtmpStream.publish()
- You can record without publishing.
rtmpStream.mixer.recorder.delegate = self
rtmpStream.startRecording()
rtmpStream.stopRecording()
extension ViewController: AVRecorderDelegate {
// MARK: AVRecorderDelegate
func recorder(_ recorder: AVRecorder, errorOccured error: AVRecorder.Error) {
logger.error(error)
}
func recorder(_ recorder: AVRecorder, finishWriting writer: AVAssetWriter) {
PHPhotoLibrary.shared().performChanges({() -> Void in
PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: writer.outputURL)
}, completionHandler: { _, error -> Void in
do {
try FileManager.default.removeItem(at: writer.outputURL)
} catch {
print(error)
}
})
}
}
1.2.x | 1.3.0 |
---|---|
func rtmpStream(_ stream: RTMPStream, didPublishInsufficientBW connection: RTMPConnection) | func rtmpStream(_ stream: RTMPStream, publishInsufficientBWOccured connection: RTMPConnection |
func rtmpStream(_ stream: RTMPStream, didPublishSufficientBW connection: RTMPConnection) | func rtmpStream(_ stream: RTMPStream, publishSufficientBWOccured connection: RTMPConnection) |
func rtmpStream(_ stream: RTMPStream, didStatics connection: RTMPConnection) | func rtmpStream(_ stream: RTMPStream, updatedStats connection: RTMPConnection) |
HaishinKit.swift | 🇬🇧 HaishinKit.kt | 🇯🇵 Zenn