Package com.amazonaws.ivs.broadcast
Interface StageRenderer
@RequiresApi(api=28)
public interface StageRenderer
An interface to implement that can be used to build user interfaces.
Implementing a
StageRenderer provides all the necessary information about a Stage to create a complete UI.-
Method Summary
Modifier and TypeMethodDescriptiondefault voidonConnectionStateChanged(Stage stage, Stage.ConnectionState state, BroadcastException exception) The connection state of the associatedStagehas changed.default voidonError(BroadcastException exception) Triggers whenever an error occursdefault voidonParticipantJoined(Stage stage, ParticipantInfo participantInfo) A new participant has joined the Stage and started publishing.default voidonParticipantLeft(Stage stage, ParticipantInfo participantInfo) A new participant has left the Stage or stopped publishing.default voidonParticipantPublishStateChanged(Stage stage, ParticipantInfo participantInfo, Stage.PublishState publishState) The publish state of a participant has changed.default voidonParticipantSubscribeStateChanged(Stage stage, ParticipantInfo publishingParticipantInfo, Stage.SubscribeState subscribeState) The subscribe state of the local participant has changed with respect to a remote publisher.default voidonStreamAdaptionChanged(Stage stage, ParticipantInfo participantInfo, RemoteStageStream stream, boolean adaption) Triggers whenever a adaption is changed Your application should implement Strategy.preferredLayerForStream to enable these eventsdefault voidonStreamLayersChanged(Stage stage, ParticipantInfo participantInfo, RemoteStageStream stream, List<RemoteStageStream.Layer> layers) Triggers whenever a stream layers are changed Your application should implement Strategy.preferredLayerForStream to enable these eventsdefault voidonStreamLayerSelected(Stage stage, ParticipantInfo participantInfo, RemoteStageStream stream, RemoteStageStream.Layer layer, RemoteStageStream.LayerSelectedReason reason) Triggers whenever a stream layer is selected Your application should implement Strategy.preferredLayerForStream to enable these eventsdefault voidonStreamsAdded(Stage stage, ParticipantInfo participantInfo, List<StageStream> streams) Triggers whenever a remote audio/video stream is added.default voidonStreamsMutedChanged(Stage stage, ParticipantInfo participantInfo, List<StageStream> streams) Triggers whenever a stream is muted, the stream could either beLocalStageStreamorStageStreamdefault voidonStreamsRemoved(Stage stage, ParticipantInfo participantInfo, List<StageStream> streams) Triggers whenever a remote audio/video stream is removed.
-
Method Details
-
onError
Triggers whenever an error occurs- Parameters:
exception- The error that occured
-
onConnectionStateChanged
default void onConnectionStateChanged(@NonNull Stage stage, @NonNull Stage.ConnectionState state, @Nullable BroadcastException exception) The connection state of the associatedStagehas changed.- Parameters:
stage- TheStagethat had the connection state change.state- The new connection state of the Stage.exception- An error, if the state change was caused by an error.
-
onParticipantJoined
A new participant has joined the Stage and started publishing.- Parameters:
stage- TheStagethat the participant joined and started publishing.participantInfo- A description of the participant that joined and started publishing.
-
onParticipantLeft
A new participant has left the Stage or stopped publishing.- Parameters:
stage- TheStagethat the participant left or stopped publishing.participantInfo- A description of the participant that left or stopped publishing.
-
onParticipantPublishStateChanged
default void onParticipantPublishStateChanged(@NonNull Stage stage, @NonNull ParticipantInfo participantInfo, @NonNull Stage.PublishState publishState) The publish state of a participant has changed.- Parameters:
stage- TheStageassociated with the participant that changed their publish state.participantInfo- The participant that changed their publish state.publishState- The new publish state.
-
onParticipantSubscribeStateChanged
default void onParticipantSubscribeStateChanged(@NonNull Stage stage, @NonNull ParticipantInfo publishingParticipantInfo, @NonNull Stage.SubscribeState subscribeState) The subscribe state of the local participant has changed with respect to a remote publisher. This callback only fires when the local participant's subscribe state changes. Participants are not made aware of subscription updates for other participants via this callback.- Parameters:
stage- TheStageassociated with the participant that changed their subscribe state.publishingParticipantInfo- The publishing participant for whom the local participant has changed their subscribe state.subscribeState- The new subscribe state.
-
onStreamsAdded
default void onStreamsAdded(@NonNull Stage stage, @NonNull ParticipantInfo participantInfo, @NonNull List<StageStream> streams) Triggers whenever a remote audio/video stream is added. This is the result of subscription state change- Parameters:
stage- TheStageassociated with the added streamsparticipantInfo- TheParticipantInfoassociated with the added streams.streams- A list of added streams
-
onStreamsRemoved
default void onStreamsRemoved(@NonNull Stage stage, @NonNull ParticipantInfo participantInfo, @NonNull List<StageStream> streams) Triggers whenever a remote audio/video stream is removed. This could be caused by either remote participant is no longer publishing or network issue- Parameters:
stage- TheStageassociated with the removed streamsparticipantInfo- TheParticipantInfoassociated with the removed streams.streams- A list of removed streams
-
onStreamsMutedChanged
default void onStreamsMutedChanged(@NonNull Stage stage, @NonNull ParticipantInfo participantInfo, @NonNull List<StageStream> streams) Triggers whenever a stream is muted, the stream could either beLocalStageStreamorStageStream- Parameters:
stage- TheStageassociated with the updated streamsparticipantInfo- TheParticipantInfoassociated with the updated streams.streams- A list of streams that have had their mute state changed
-
onStreamLayersChanged
default void onStreamLayersChanged(@NonNull Stage stage, @NonNull ParticipantInfo participantInfo, @NonNull RemoteStageStream stream, @NonNull List<RemoteStageStream.Layer> layers) Triggers whenever a stream layers are changed Your application should implement Strategy.preferredLayerForStream to enable these events- Parameters:
stage- TheStageassociated with the updated streamparticipantInfo- TheParticipantInfoassociated with the updated stream.stream- A stream that have had its layers changedlayers- An updated list of layers
-
onStreamLayerSelected
default void onStreamLayerSelected(@NonNull Stage stage, @NonNull ParticipantInfo participantInfo, @NonNull RemoteStageStream stream, @Nullable RemoteStageStream.Layer layer, @NonNull RemoteStageStream.LayerSelectedReason reason) Triggers whenever a stream layer is selected Your application should implement Strategy.preferredLayerForStream to enable these events- Parameters:
stage- TheStageassociated with the updated streamparticipantInfo- TheParticipantInfoassociated with the updated stream.stream- A stream that have had its layer selectedlayer- An newly selected layerreason- A reason to be selected
-
onStreamAdaptionChanged
default void onStreamAdaptionChanged(@NonNull Stage stage, @NonNull ParticipantInfo participantInfo, @NonNull RemoteStageStream stream, boolean adaption) Triggers whenever a adaption is changed Your application should implement Strategy.preferredLayerForStream to enable these events- Parameters:
stage- TheStageassociated with the updated streamparticipantInfo- TheParticipantInfoassociated with the updated stream.stream- A stream that have had its adaption changedadaption- An updated adaption
-