-
-
Notifications
You must be signed in to change notification settings - Fork 620
Moving from 1.8.x APIs to 1.9.0
shogo4405 edited this page Sep 12, 2024
·
5 revisions
FeatureUtil.setEnabled(for: .multiTrackAudioMixing, isEnabled: true)
let stream = RTMPStream(connection: rtmpConnection)
let stream = RTMPStream(connection: rtmpConnection)
stream.isMultiTrackAudioMixingEnabled = true
stream.videoMixerSettings = IOVideoMixerSettings(
mode: .pip,
cornerRadius: 16.0,
regionOfInterest: .init(
origin: CGPoint(x: 16, y: 16),
size: .init(width: 160, height: 160)
),
direction: .east
)
I have revised the API to allow for flexible layout configurations.Advanced Video Editing feature.
There may be times when you want to use CMSampleBuffer directly for custom video editing or ReplayKit data. In such cases, please use stream.videoMixerSettings.mode = .passthrough
.
stream.videoMixerSettings.mode = .offscreen
stream.screen.size = .init(width: 720, height: 1280)
stream.screen.backgroundColor = UIColor.white.cgColor
videoScreenObject.cornerRadius = 16.0
videoScreenObject.track = 1
videoScreenObject.horizontalAlignment = .left
videoScreenObject.layoutMargin = .init(top: 16, left: 16, bottom: 0, right: 0)
videoScreenObject.size = .init(width: 160 * 2, height: 90 * 2)
try? stream.screen.addChild(videoScreenObject)
stream.screen.startRunning()
Up until version 1.8.x, VisualEffect was applied by default. Starting from version 1.9.0, it has been integrated as part of the Offscreen rendering API, so the following settings will be required.
// no op
stream.videoMixerSettings.mode = .offscreen
stream.screen.startRunning()
HaishinKit.swift | 🇬🇧 HaishinKit.kt | 🇯🇵 Zenn