Package com.amazonaws.ivs.broadcast
Interface Stage.Strategy
- Enclosing class:
Stage
public static interface Stage.Strategy
The Strategy is the decision engine associated with a Stage. It is how the Stage asks the host application what actions to take.
If the host application wants to change their answer to a question, they can call
Stage.refreshStrategy()
.-
Method Summary
Modifier and TypeMethodDescriptiondefault RemoteStageStream.Layer
preferredLayerForStream
(Stage stage, ParticipantInfo participantInfo, RemoteStageStream stream) Return theRemoteStageStream.Layer
to be preferred for specific remote streams.boolean
shouldPublishFromParticipant
(Stage stage, ParticipantInfo participantInfo) Return `true` to publish the associated participant, or `false` to not publish them.shouldSubscribeToParticipant
(Stage stage, ParticipantInfo participantInfo) Return theStage.SubscribeType
corresponding to the type of media streams desired from the associated participant.stageStreamsToPublishForParticipant
(Stage stage, ParticipantInfo participantInfo) Return an array of media streams to publish with the associated participant.default SubscribeConfiguration
subscribeConfigrationForParticipant
(Stage stage, ParticipantInfo participantInfo) Return theSubscribeConfiguration
to subscribe to the associated participant.
-
Method Details
-
stageStreamsToPublishForParticipant
@NonNull List<LocalStageStream> stageStreamsToPublishForParticipant(@NonNull Stage stage, @NonNull ParticipantInfo participantInfo) Return an array of media streams to publish with the associated participant. If the return value of this function changes, callStage.refreshStrategy()
to use the new streams.- Parameters:
stage
- TheStage
to publish the streams to.participantInfo
- TheParticipantInfo
that will be associated with the returned streams.- Returns:
- A non-null (empty is okay) list of
LocalStageStream
objects to publish to the Stage.
-
shouldPublishFromParticipant
boolean shouldPublishFromParticipant(@NonNull Stage stage, @NonNull ParticipantInfo participantInfo) Return `true` to publish the associated participant, or `false` to not publish them. If the return value of this function changes, callStage.refreshStrategy()
update the local publishing state This will only be invoked on participants that have the publish capability.- Parameters:
stage
- TheStage
associated with the participant.participantInfo
- TheParticipantInfo
that will be published or unpublished- Returns:
- Whether or not the participant should publish.
-
shouldSubscribeToParticipant
Stage.SubscribeType shouldSubscribeToParticipant(@NonNull Stage stage, @NonNull ParticipantInfo participantInfo) Return theStage.SubscribeType
corresponding to the type of media streams desired from the associated participant.- Parameters:
stage
- TheStage
associated with the participant.participantInfo
- TheParticipantInfo
that will be subscribed to or unsubscbribed from.- Returns:
- The desired
Stage.SubscribeType
for the associated participant.
-
subscribeConfigrationForParticipant
default SubscribeConfiguration subscribeConfigrationForParticipant(@NonNull Stage stage, @NonNull ParticipantInfo participantInfo) Return theSubscribeConfiguration
to subscribe to the associated participant.- Parameters:
stage
- TheStage
associated with the participant.participantInfo
- TheParticipantInfo
that will be associated with the returned configuration.- Returns:
- The
SubscribeConfiguration
for the associated participant.
-
preferredLayerForStream
@Nullable default RemoteStageStream.Layer preferredLayerForStream(@NonNull Stage stage, @NonNull ParticipantInfo participantInfo, @NonNull RemoteStageStream stream) Return theRemoteStageStream.Layer
to be preferred for specific remote streams.- Parameters:
stage
- TheStage
associated with the participant.participantInfo
- TheParticipantInfo
that will be associated with the returned layer.stream
- TheRemoteStageStream
that will be associated with the returned layer.- Returns:
- The
RemoteStageStream.Layer
for the associated participant.
-