public static abstract class

BroadcastSession.Listener

extends Object
java.lang.Object
   ↳ com.amazonaws.ivs.broadcast.BroadcastSession.Listener

Class Overview

Provide a listener to receive status updates and errors from the SDK. Updates will be run on arbitrary threads and not the main thread.

Summary

Public Constructors
Listener()
Public Methods
void onAudioStats(double peak, double rms)
Periodically called with audio peak and rms in dBFS.
void onBroadcastQualityChanged(double quality)
A number between 0 and 1 that represents the quality of the stream based on bitrate minimum and maximum provided on session configuration.
void onDeviceAdded(Device.Descriptor descriptor)
Indicates that a device has become available
void onDeviceRemoved(Device.Descriptor descriptor)
Indicates that a device has become unavailable
abstract void onError(BroadcastException exception)
Indicates that an error occurred.
void onNetworkHealthChanged(double health)
A number between 0 and 1 that represents the current health of the network.
abstract void onStateChanged(BroadcastSession.State state)
Indicates that the broadcast state changed.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Listener ()

Public Methods

public void onAudioStats (double peak, double rms)

Periodically called with audio peak and rms in dBFS. Range is -100 (silent) to 0.

Parameters
peak Audio Peak over the time period
rms Audio RMS over the time period

public void onBroadcastQualityChanged (double quality)

A number between 0 and 1 that represents the quality of the stream based on bitrate minimum and maximum provided on session configuration. 0 means the stream is at the lowest possible quality, or streaming is not possible at all. 1 means the bitrate is near the maximum allowed.

Parameters
quality The quality of the stream

public void onDeviceAdded (Device.Descriptor descriptor)

Indicates that a device has become available

Parameters
descriptor the device's descriptor

public void onDeviceRemoved (Device.Descriptor descriptor)

Indicates that a device has become unavailable

Parameters
descriptor the device's descriptor. This may not contain specific hardware information other than IDs.

public abstract void onError (BroadcastException exception)

Indicates that an error occurred. Errors may or may not be fatal and will be marked as such. In the case of a fatal error the broadcast session moves into DISCONNECTED state.

Parameters
exception exception object with information for the error that occurred.

public void onNetworkHealthChanged (double health)

A number between 0 and 1 that represents the current health of the network. 0 means the network is struggling to keep up and the broadcast may be experiencing latency spikes. The SDK may also reduce the quality of the broadcast on low values in order to keep it stable, depending on the minimum allowed bitrate in the broadcast configuration. A value of 1 means the network is easily able to keep up with the current demand and the SDK will be trying to increase the broadcast quality over time, depending on the maximum allowed bitrate. Lower values like 0.5 are not necessarily bad, it just means the network is being saturated, but it is still able to keep up.

Parameters
health The instantaneous health of the network

public abstract void onStateChanged (BroadcastSession.State state)

Indicates that the broadcast state changed.

Parameters
state current broadcast state