java.lang.Object | |
↳ | com.amazonaws.ivs.broadcast.BroadcastSession.Listener |
Provide a listener to receive status updates and errors from the SDK. Updates will be run on arbitrary threads and not the main thread.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Listener() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
onAudioStats(double peak, double rms)
Periodically called with audio peak and rms in dBFS.
| ||||||||||
void |
onBroadcastQualityChanged(double quality)
This method is deprecated.
Prefer onTransmissionStatsChanged instead.
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.
| ||||||||||
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)
This method is deprecated.
Prefer onTransmissionStatsChanged instead.
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.
| ||||||||||
abstract void |
onStateChanged(BroadcastSession.State state)
Indicates that the broadcast state changed.
| ||||||||||
void |
onTransmissionStatsChanged(TransmissionStats statistics)
Periodically called with current statistics on the broadcast, such as the measured bitrate, recommended bitrate
by the SDK's adaptive bitrate algorithm, average round trip time, broadcast quality (relative to configured
minimum and maximum bitrates), and network health.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Periodically called with audio peak and rms in dBFS. Range is -100 (silent) to 0.
peak | Audio Peak over the time period |
---|---|
rms | Audio RMS over the time period |
This method is deprecated.
Prefer onTransmissionStatsChanged instead.
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.
quality | The quality of the stream |
---|
Indicates that a device has become available
descriptor | the device's descriptor |
---|
Indicates that a device has become unavailable
descriptor | the device's descriptor. This may not contain specific hardware information other than IDs. |
---|
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.
exception | exception object with information for the error that occurred. |
---|
This method is deprecated.
Prefer onTransmissionStatsChanged instead.
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.
health | The instantaneous health of the network |
---|
Indicates that the broadcast state changed.
state | current broadcast state |
---|
Periodically called with current statistics on the broadcast, such as the measured bitrate, recommended bitrate
by the SDK's adaptive bitrate algorithm, average round trip time, broadcast quality (relative to configured
minimum and maximum bitrates), and network health.
Expect this callback to be triggered on the BroadcastListener quite frequently (approximately twice per second)
as the measured and recommended bitrates change.
See TransmissionStats
documentation for further information on how to interpret the metrics.
statistics | The current transmission stats |
---|