Release notes
This page provides the release notes of PlanetKit 5.5 for iOS/macOS.
PlanetKit 5.5.2
Release date: 2025-02-26
Add previous audio route information to PlanetKitAudioRouteChangeDelegate
Added the previous PlanetKitAudioRoute
value to didAudioRouteChange
of PlanetKitAudioRouteChangeDelegate
.
API
Changed
-
PlanetKitAudioRouteChangeDelegate
protocol 1-to-1 callGroup callPrevious PlanetKit 5.5.2 didAudioRouteChange(audioRoute: PlanetKitAudioRoute)
didAudioRouteChange(current: PlanetKitAudioRoute, previous: PlanetKitAudioRoute)
Fix a bug in PlanetKitCall.speakerOut()
and PlanetKitConference.speakerOut()
Resolved an issue in the speaker out functions where the speaker failed to turn off under certain conditions, ensuring consistent audio management across all scenarios.
Fix a bug in the PlanetKit internal camera module
Resolved an issue in the PlanetKit internal camera module that led to unintended effects when the camera was interrupted, enhancing the stability and reliability of camera operations.
PlanetKit 5.5.1
Release date: 2025-01-15
Fix an issue with delay in initiating voice transmission at the start of a call
Fixed an issue where there was a 500ms delay in initiating the transmission of the local user's voice at the start of 1-to-1 calls and group calls.
Reflect SDK changes for Flutter support
Added code for PlanetKit Flutter support within the SDK.
PlanetKit 5.5.0
Release date: 2024-12-09
Add PlanetKitInitialMyVideoState
PlanetKitInitialMyVideoState
is an enum added to determine the state of the local user's video when a video call is started or activated.
- This change allows you to set the initial video state to either
resume
orpause
. - The default value for a property or parameter of type
PlanetKitInitialMyVideoState
isPlanetKitInitialMyVideoState.resume
.
API
Added
PlanetKitInitialMyVideoState
enum 1-to-1 callcase resume
case pause
PlanetKitCallParam
class 1-to-1 callvar initialMyVideoState: PlanetKitInitialMyVideoState { get set }
PlanetKitConferenceParam
class Group callvar initialMyVideoState: PlanetKitInitialMyVideoState { get set }
Changed
-
PlanetKitCall
class 1-to-1 callPrevious PlanetKit 5.5 func acceptCall(startMessage: PlanetKitCallStartMessage?, useResponderPreparation: Bool, recordOnCloud: Bool = false)
func acceptCall(startMessage: PlanetKitCallStartMessage?, useResponderPreparation: Bool, recordOnCloud: Bool = false, initialMyVideoState: PlanetKitInitialMyVideoState = .resume)
func enableVideo(completion: @escaping (Bool)->Void)
func enableVideo(initialMyVideoState: PlanetKitInitialMyVideoState = .resume, completion: @escaping (Bool)->Void)
func disableVideo(reason: PlanetKitMediaDisableReason, stopCamera: Bool = true, completion: @escaping (Bool)->Void)
func disableVideo(reason: PlanetKitMediaDisableReason, completion: @escaping (Bool)->Void)
-
PlanetKitConference
class Group callPrevious PlanetKit 5.5 func enableVideo(completion: @escaping (Bool)->Void)
func enableVideo(initialMyVideoState: PlanetKitInitialMyVideoState = .resume, completion: @escaping (Bool)->Void)
func disableVideo(stopCamera: Bool = true, completion: @escaping (Bool)->Void)
func disableVideo(completion: @escaping (Bool)->Void)
Improve camera control
PlanetKit has been enhanced to turn on the camera only when sending data to Planet Cloud.
API
Added
PlanetKitCameraManager
class 1-to-1 callGroup callfunc startPreview(delegate: PlanetKitVideoOutputDelegate)
func stopPreview(delegate: PlanetKitVideoOutputDelegate)
var previewModifier: PlanetKitVideoModifierDelegate? { get set }
func setCustomCamera(_ customCamera: PlanetKitCustomCamera)
func resetToDefaultCamera()
var currentDeviceInfo: PlanetKitVideoCaptureDeviceInfo? { get }
var isStarted: Bool { get }
var preset: PlanetKitCameraPreset? { get }
var position: PlanetKitCameraPosition { get }
var frameRate: PlanetKitFrameRate? { get }
func change(deviceInfo: PlanetKitVideoCaptureDeviceInfo)
func switchPosition()
func addInterruptReceiver(_ interruptReceiver: PlanetKitCameraInterruptDelegate)
func removeInterruptReceiver(_ interruptReceiver: PlanetKitCameraInterruptDelegate)
var virtualBackground: PlanetKitVirtualBackground? { get set }
var deviceInfos: [PlanetKitVideoCaptureDeviceInfo] { get }
static var isCameraAvailable: Bool { get }
static var shared: PlanetKitCameraManager { get }
weak var delegate: PlanetKitCameraDelegate? { get set }
func addDeviceChangeDelegate(_ delegate: PlanetKitCameraDeviceChangeDelegate)
func removeDeviceChangeDelegate(_ delegate: PlanetKitCameraDeviceChangeDelegate)
PlanetKitCameraDelegate
protocol 1-to-1 callGroup callfunc didStart()
func didStop(_ error: NSError?)
PlanetKitCustomCamera
class 1-to-1 callGroup callfunc sendVideo(videoBuffer: PlanetKitVideoBuffer)
func isVideoSendAvailable() -> Bool
PlanetKitCall
class 1-to-1 callvar peerVideoStream: PlanetKitVideoStream
Changed
-
PlanetKitCall
class 1-to-1 callPrevious PlanetKit 5.5 weak var myVideoReceiver: PlanetKitVideoOutputDelegate? { get set }
var myVideoStream: PlanetKitVideoStream { get }
var myCameraStream: PlanetKitVideoStream { get }
var myVideoStream: PlanetKitVideoStream { get }
-
PlanetKitConference
class Group callPrevious PlanetKit 5.5 var myCameraStream: PlanetKitVideoStream { get }
var myVideoStream: PlanetKitVideoStream { get }
-
Rename
PlanetKitVideoCaptureDevice
toPlanetKitVideoCaptureDeviceInfo
1-to-1 callGroup call -
PlanetKitCameraManager
class 1-to-1 callGroup callPrevious PlanetKit 5.5 PlanetKitCall.startPreview()
func startPreview(delegate: PlanetKitVideoOutputDelegate)
PlanetKitCall.stopPreview()
func stopPreview(delegate: PlanetKitVideoOutputDelegate)
PlanetKitMakeCallSettingBuilder.withCustomCameraKey(camera:)
orPlanetKitVerifyCallSettingBuilder.withCustomCameraKey(camera:)
orPlanetKitJoinConferenceSettingBuilder.withCustomCameraKey(camera:)
func setCustomCamera(_ camera: PlanetKitCustomCamera)
PlanetKitCamera.isStarted
var isStarted: Bool { get }
PlanetKitCamera.currentDevice
var currentDeviceInfo: PlanetKitVideoCaptureDeviceInfo? { get }
PlanetKitCamera.cameraPreset
var preset: PlanetKitCameraPreset? { get }
PlanetKitCamera.cameraPosition
var position: PlanetKitCameraPosition { get }
PlanetKitCamera.cameraFrameRate
var frameRate: PlanetKitFrameRate? { get }
PlanetKitCamera.change(device:)
func change(deviceInfo: PlanetKitVideoCaptureDeviceInfo)
PlanetKitCamera.switchPosition()
func switchPosition()
PlanetKitCamera.addInterruptReceiver(_:)
func addInterruptReceiver(_ interruptReceiver: PlanetKitCameraInterruptDelegate
PlanetKitCamera.removeInterruptReceiver(_:)
func removeInterruptReceiver(_ interruptReceiver: PlanetKitCameraInterruptDelegate)
PlanetKitCamera.isCameraAvailable
static var isCameraAvailable: Bool { get }
PlanetKitCamera.devices
var deviceInfos: [PlanetKitVideoCaptureDeviceInfo] { get }
PlanetKitCamera.virtualBackground
var virtualBackground: PlanetKitVirtualBackground? { get set }
PlanetKitCamera.addDeviceChangeDelegate(_:)
func addDeviceChangeDelegate(_ delegate: PlanetKitCameraDeviceChangeDelegate)
PlanetKitCamera.removeDeviceChangeDelegate(_:)
func removeDeviceChangeDelegate(_ delegate: PlanetKitCameraDeviceChangeDelegate)
PlanetKitCamera.didStartNotification
var delegate: PlanetKitCameraDelegate? { get set }
PlanetKitCamera.didStopNotification
var delegate: PlanetKitCameraDelegate? { get set }
Removed
PlanetKitCamera
class 1-to-1 callGroup callPlanetKitCameraControllable
protocol 1-to-1 callGroup callPlanetKitCall
class 1-to-1 callvar camera: PlanetKitCameraControllable? { get }
func startPreview()
func stopPreview()
PlanetKitConference
class Group callvar camera: PlanetKitCameraControllable? { get }
func startPreview()
func stopPreview()
PlanetKitInitialSettingBuilder
class 1-to-1 callGroup callfunc withDisableKitCameraKey(disable: Bool) -> PlanetKitInitialSettingBuilder
PlanetKitMakeCallSettingBuilder
class 1-to-1 callfunc withCustomCameraKey(camera: PlanetKitCameraControllable) -> PlanetKitMakeCallSettingBuilder
func withCustomCameraStreamKey(videoStream: PlanetKitVideoStream) -> PlanetKitMakeCallSettingBuilder
PlanetKitVerifyCallSettingBuilder
class 1-to-1 callfunc withCustomCameraKey(camera: PlanetKitCameraControllable) -> PlanetKitVerifyCallSettingBuilder
func withCustomCameraStreamKey(videoStream: PlanetKitVideoStream) -> PlanetKitVerifyCallSettingBuilder
PlanetKitJoinConferenceSettingBuilder
class Group callfunc withCustomCameraKey(camera: PlanetKitCameraControllable) -> PlanetKitJoinConferenceSettingBuilder
func withCustomCameraStreamKey(videoStream: PlanetKitVideoStream) -> PlanetKitJoinConferenceSettingBuilder
Migration
Start camera preview
- Example of an earlier version
class PreviewVideoViewController: UIViewController {
....
var myVideoView: PlanetKitMTKView!
private func setupView() {
let videoStream = PlanetKitVideoStream()
videoStream.addReceiver(myVideoView!)
videoStream.modifier = self
PlanetKitCamera.shared.addReceiver(videoStream)
PlanetKitCamera.shared.open()
PlanetKitCamera.shared.start()
}
}
extension VideoViewController: PlanetKitVideoModifierDelegate {
func videoOutput(_ videoBuffer: PlanetKitVideoBuffer) {
....
}
}
- New version example
class PreviewVideoViewController: UIViewController {
....
var myVideoView: PlanetKitMTKView!
private func setupView() {
PlanetKitCameraManager.shared.previewModifier = self
PlanetKitCameraManager.shared.startPreview(delegate: myVideoView)
}
}
extension VideoViewController: PlanetKitVideoModifierDelegate {
func videoOutput(_ videoBuffer: PlanetKitVideoBuffer) {
....
}
}
Switch to another camera device
- Example of an earlier version
class CameraDeviceViewController: UIViewController {
....
private var devices: [PlanetKitVideoCaptureDevice] = []
private var deviceNames: [String] = []
private func refreshDevices() {
devices = PlanetKitCamera.shared.devices
deviceNames.removeAll()
for device in devices {
deviceNames.append(device.name)
}
}
private func change(device: PlanetKitVideoCaptureDevice) {
PlanetKitCamera.shared.change(device: device)
}
}
- New version example
class CameraDeviceViewController: UIViewController {
....
private var deviceInfos: [PlanetKitVideoCaptureDeviceInfo] = []
private var deviceNames: [String] = []
private func refreshDevices() {
deviceInfos = PlanetKitCameraManager.shared.deviceInfos
var selectedIndex = -1
deviceNames.removeAll()
for (index, deviceInfo) in deviceInfos.enumerated() {
deviceNames.append(deviceInfo.name)
if PlanetKitCameraManager.shared.currentDeviceInfo?.uniqueID == deviceInfo.uniqueID {
selectedIndex = index
}
}
}
private func change(deviceInfo: PlanetKitVideoCaptureDeviceInfo) {
PlanetKitCameraManager.shared.change(deviceInfo: deviceInfo)
}
}
Add a receiver for the local user's video view
- Example of an earlier version
class VideoViewController: UIViewController {
....
var call: PlanetKitCall!
var myVideoView: PlanetKitMTKView!
private func setMyVideo() {
call.myVideoReceiver = myVideoView
}
}
- New version example
class VideoViewController: UIViewController {
....
var call: PlanetKitCall!
var myVideoView: PlanetKitMTKView!
private func setMyVideo() {
call.myVideoStream.addReceiver(myVideoView)
}
}
Use a custom camera for the video source
import PlanetKit
class CustomCamera: PlanetKitCustomCamera {
static var shared = CustomCamera()
// Implement the abstract method to handle FPS limit updates
override func processFpsLimitUpdate(enabled: Bool, fps: Int32) {
// Handle the FPS limit update
// If `enabled` is true, adjust your frame generation logic to according to the `fps`
}
// Method to simulate video buffer processing
func processVideoBuffer(buffer: CMSampleBuffer) {
guard let targetBuffer = PlanetKitVideoBuffer.getPreferredSampleBuffer(buffer) else {
return
}
let timestamp = CMSampleBufferGetPresentationTimeStamp(targetBuffer)
// Check if video buffer can be sent. If false, drop the buffer.
guard isVideoSendAvailable(timestamp: timestamp) else { return }
let videoBuffer = PlanetKitVideoBuffer(sampleBuffer: targetBuffer,
timestamp: timestamp,
rotation: .rotation0,
position: .unknown,
sender: nil,
source: .camera)
sendVideo(videoBuffer: videoBuffer)
}
}
// Start using the custom camera.
PlanetKitCameraManager.shared.setCustomCamera(CustomCamera.shared)
// Reset to the default device.
PlanetKitCameraManager.shared.resetToDefaultCamera()
Add the audio hooking feature
Audio hooking allows you to get the audio data before Planet Cloud transmits audio to a peer. This function can be used to modify the local user's voice or use the audio data for speech recognition.
API
Added
PlanetKitHookedAudio
class 1-to-1 callvar sampleRate: UInt32 { get }
var channel: UInt32 { get }
var sampleType: PlanetKitAudioSampleType { get }
var sampleCount: UInt32 { get }
var seq: Int64 { get }
var data: Data { get set }
PlanetKitCallHookedAudioDelegate
protocol 1-to-1 callfunc didHook(_ call: PlanetKitCall, audio: PlanetKitHookedAudio)
PlanetKitCall
class 1-to-1 callvar isHookMyAudioEnabled: Bool { get }
func enableHookMyAudio(delegate: PlanetKitCallHookedAudioDelegate, completion: @escaping (Bool)->Void)
func disableHookMyAudio(completion: @escaping (Bool)->Void)
func putHookedMyAudioBack(audio: PlanetKitHookedAudio) -> Bool
Add a disconnect reason for screen lock
This disconnect reason occurs only on desktop systems when the desktop screen is locked by the user or due to system inactivity (applicable to macOS only). When the peer is using a desktop and the screen is locked, the call will end and you will receive this reason through an event.
API
Added
PlanetKitDisconnectReason
enum 1-to-1 callGroup callcase desktopScreenLocked = 1314
Remove unnecessary declineCall()
The unnecessary function has been removed in 1-to-1 calls. To end a call by declining it, use endCall()
instead of declineCall()
.
API
Removed
PlanetKitCall
class 1-to-1 callGroup callfunc declineCall()