haishin_kit library

Capture, mix, and preview audio and video on Android, iOS, and macOS.

Use MediaMixer to attach input sources and compose overlays through its Screen. Use StreamSession to publish or play RTMP and SRT streams and StreamSessionViewTexture to display the native video texture.

See the package README for native dependencies and setup instructions.

Classes

AudioCodecSettings
Settings for the session's audio encoder.
AudioMixerSettings
Settings for mixing captured audio.
AudioSource
Selects the default audio input for capture.
HaishinKitPlatformInterface
The contract that native implementations of HaishinKit must implement.
ImageScreenObject
Displays an image overlay on the composition screen.
MediaMixer
Captures and mixes audio and video for native streaming sessions.
MediaMixerOptions
Configures native capture and audio mixing on Apple platforms.
Screen
The root of a mixer's native video composition.
ScreenCoordinateTransform
Maps composition pixels to preview-local coordinates and back.
ScreenObject
The ScreenObject class is the abstract base class for all objects that are rendered on the screen.
ScreenObjectContainer
The ScreenObjectContainer represents a collection of screen objects.
ScreenObjectEdgeInsets
Represents edge insets used for layout spacing around a ScreenObject.
ScreenObjectEditor
Edits direct children using layout measured by the native renderer.
ScreenObjectSize
The requested width and height of a screen object.
StreamSession
A native streaming session for publishing or playback.
StreamSessionViewTexture
Displays a native video texture from a StreamSession.
TextScreenObject
Displays a text overlay on the composition screen.
VideoCodecSettings
Settings for the session's video encoder.
VideoMixerSettings
Constraints on the video mixer settings.
VideoScreenObject
Displays a video track on the composition screen.
VideoSource
Represents a video input source.

Enums

CameraPosition
Represents the position of the camera.
CaptureSessionMode
Determines how the native mixer manages capture on Apple platforms.
HorizontalAlignment
Defines horizontal alignment options.
ImageScreenObjectFormat
Supported image formats for ImageScreenObject.
ProfileLevel
The H.264 profile and level requested for video encoding.
StreamSessionMode
Determines the direction of media transfer.
StreamSessionReadyState
Represents the current connection state of a session.
VerticalAlignment
Defines vertical alignment options.
VideoGravity
Specifies how a video should be resized or scaled to fit within its container.
VideoRenderingMode
The type of image rendering mode.

Extensions

AudioMixerSettingsPatterns on AudioMixerSettings
Adds pattern-matching-related methods to AudioMixerSettings.
MediaMixerOptionsPatterns on MediaMixerOptions
Adds pattern-matching-related methods to MediaMixerOptions.
ScreenObjectEdgeInsetsPatterns on ScreenObjectEdgeInsets
Adds pattern-matching-related methods to ScreenObjectEdgeInsets.
ScreenObjectSizePatterns on ScreenObjectSize
Adds pattern-matching-related methods to ScreenObjectSize.
VideoMixerSettingsPatterns on VideoMixerSettings
Adds pattern-matching-related methods to VideoMixerSettings.
VideoSourcePatterns on VideoSource
Adds pattern-matching-related methods to VideoSource.

Exceptions / Errors

MediaMixerException
MediaMixerFailedToAttachException
MediaMixerUnknownException
StreamSessionConnectFailedException
Thrown when establishing a session connection fails.
StreamSessionException
Base exception type for all session-related errors.
StreamSessionUnknownException
Thrown when an unexpected error occurs while handling a session.