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 when a broadcast has been added to the Bambuser database.
|
void |
onBroadcastInfoAvailable(String vid,
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)
Will be called on incoming messages from the backend to the broadcaster.
|
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)
message
- The incoming 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 vid, String url)
vid
- Internal video id. This value is no longer used. See
onBroadcastIdAvailable(String)
instead.url
- Legacy url. This value is no longer used. See the Bambuser documentation on
resourceUris instead.void onBroadcastIdAvailable(String broadcastId)
broadcastId
- Unique id for this broadcast.