Interface Stage.BaseStrategy

All Known Subinterfaces:
Stage.Strategy, Stage.StrategyV2
Enclosing class:
Stage

@RequiresApi(api=28) public static interface Stage.BaseStrategy
Everything a Stage asks of a strategy except the desired subscription.

Implement Stage.Strategy or Stage.StrategyV2 rather than this directly: a Stage asks one of them which media it should subscribe to, and a strategy that answers neither subscribes to nothing.

  • 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, call Stage.refreshStrategy() to use the new streams.
      Parameters:
      stage - The Stage to publish the streams to.
      participantInfo - The ParticipantInfo 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, call Stage.refreshStrategy() update the local publishing state. This will only be invoked on participants that have the publish capability.
      Parameters:
      stage - The Stage associated with the participant.
      participantInfo - The ParticipantInfo that will be published or unpublished
      Returns:
      Whether or not the participant should publish.
    • subscribeConfigrationForParticipant

      default SubscribeConfiguration subscribeConfigrationForParticipant(@NonNull Stage stage, @NonNull ParticipantInfo participantInfo)
      Return the SubscribeConfiguration to subscribe to the associated participant.
      Parameters:
      stage - The Stage associated with the participant.
      participantInfo - The ParticipantInfo 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 the RemoteStageStream.Layer to be preferred for specific remote streams.
      Parameters:
      stage - The Stage associated with the participant.
      participantInfo - The ParticipantInfo that will be associated with the returned layer.
      stream - The RemoteStageStream that will be associated with the returned layer.
      Returns:
      The RemoteStageStream.Layer for the associated participant.