StreamCameraUploadView
Contract of the camera capture view, BunnyStreamCameraUpload. The same view covers two cases:
liveStreamId not set (default): the camera records straight to a new video in your library.
liveStreamId set: the camera broadcasts to that existing live stream. The SDK starts the stream on the server when the connection is up and ends it when you call stopRecording.
Before use: call BunnyStreamApi.initialize(...) and make sure the CAMERA and RECORD_AUDIO runtime permissions are granted - startPreview does nothing without them. Configure liveStreamId, dualPublish and the listeners before starting, not mid-broadcast.
The view ships its own controls (start/stop, mute, camera switch, close, status). Set hideDefaultControls to true to drive it from your own UI through the methods below.
Inheritors
Properties
Click listener to receive close clicked event so you can handle it, e.g. finish hosting activity or navigate to some other screen
When true, publishes to BOTH the primary and backup ingest simultaneously (dual-publish), so a failover is instant — the second ingest is already running.
Hides default controls, if you plan to use your own
Optional override for the live RTMP ingest endpoint (e.g. a regional host shown in the Bunny dashboard). null uses the SDK default. Only used when liveStreamId is set.
When set, the view broadcasts to this existing Bunny live stream (RTMP publish using the stream's streamKey) instead of recording a new VOD video. Set to null (default) for the classic camera-upload behavior.
Listener to receive stream duration
Listener to receive events about stream status
Functions
Returns true while a recording or live broadcast is running. Covers both the VOD-record and the live-broadcast case despite the name.
Mutes or unmutes the microphone. The video keeps streaming either way.
Starts the camera preview.
Stops the recording or broadcast. For a live stream (liveStreamId set) this also ends the stream on the server, so viewers see it as ended. Stop through this method rather than just tearing the view down; otherwise the stream stays live for viewers until the server times it out.
Switches between the front and back camera. Works during preview and mid-broadcast.