public static interface Broadcaster.Observer
Broadcaster
. All callbacks are done on the main UI thread.Modifier and Type | Method and Description |
---|---|
void |
onBroadcastIdAvailable(String broadcastId)
Called right after
onBroadcastInfoAvailable(String, String) with a broadcast
id, used when communicating with certain backend API endpoints. |
void |
onBroadcastInfoAvailable(String videoId,
String url)
Called when a broadcast has been added to the Bambuser database.
|
void |
onCameraError(CameraError error) |
void |
onCameraPreviewStateChanged()
Called whenever a camera has stopped or started.
|
void |
onChatMessage(String message) |
void |
onConnectionError(ConnectionError type,
String message)
This callback will be called for any kind of connection error.
|
void |
onConnectionStatusChange(BroadcastStatus status) |
void |
onResolutionsScanned()
This callback will be called every time a camera is starting and updated lists of supported
resolutions are available via
Broadcaster.getSupportedResolutions() and
Broadcaster.getSupportedPictureResolutions() . |
void |
onStreamHealthUpdate(int health)
Will be called regularly while capturing.
|
void onConnectionStatusChange(BroadcastStatus status)
void onStreamHealthUpdate(int health)
Broadcaster
will switch between
resolutions automatically to produce less data, keeping the stream health value high.health
- The current stream health percent, 0 to 100.void onConnectionError(ConnectionError type, String message)
type
- A constant that identifies the error type.message
- An optional error-message from the streaming server, null for most error types.void onCameraError(CameraError error)
void onChatMessage(String message)
void onResolutionsScanned()
Broadcaster.getSupportedResolutions()
and
Broadcaster.getSupportedPictureResolutions()
.
Camera preview and capture will not start before this callback returns. We recommend that
you use Broadcaster.getSupportedResolutions()
and setResolution(width, height)
to choose the
desired camera resolution, which sets an upper limit for the broadcast resolution.
If you switch between cameras and don't do anything in this callback, the starting camera
will use the same resolution as the previous camera. If the same resolution is not supported,
the camera will select the closest lower supported resolution. To step up to a higher
resolution when switching cameras you need to invoke
setResolution(width, height)
.
void onCameraPreviewStateChanged()
hasFocus()
,
hasZoom()
and
hasTorch()
and enable/disable corresponding buttons in the UI.void onBroadcastInfoAvailable(String videoId, String url)
videoId
- Each broadcast has a unique id.url
- Optional url for viewing the broadcast. This may not be included,
for example if the broadcast is private.void onBroadcastIdAvailable(String broadcastId)
onBroadcastInfoAvailable(String, String)
with a broadcast
id, used when communicating with certain backend API endpoints.broadcastId
- Long unique id for this broadcast.