Package com.amazonaws.ivs.broadcast
Class Stage
- java.lang.Object
-
- com.amazonaws.ivs.broadcast.Stage
-
- All Implemented Interfaces:
Releasable
@RequiresApi(api=29) public class Stage extends java.lang.Object implements Releasable
The main interface for host Application to create Stage session and interact with created session
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStage.ConnectionStateConnectionState indicates current Stage ession statestatic classStage.PublishStateThe various potential publish states for a participantstatic interfaceStage.StrategyThe Strategy is the decision engine associated with a Stage.static classStage.SubscribeStateThe various potential subscribe states for a participantstatic classStage.SubscribeTypeSubscribeType is used inStage.Strategyto indicate whether SDK should subscribe and what media type it should subscribe
-
Constructor Summary
Constructors Constructor Description Stage(android.content.Context context, java.lang.String token, Stage.Strategy strategy)Create a new Stage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRenderer(StageRenderer renderer)Adds a renderer to the list of renderers that will be notified of updates to the Stage.protected voidfinalize()voidjoin()Joins the Stage session associated with the token provided during initialization.voidleave()Leaves the joined Stage session.voidrefreshStrategy()Triggers theStage.Strategyon this instance to refresh its state.voidrelease()Releases the resources associated with this Stage.voidremoveRenderer(StageRenderer renderer)Removes a renderer from the list of renderers that will be notified of updates to the Stage.voidreplaceStrategy(Stage.Strategy strategy)Whenever strategy is changed and host application wants SDK to honor the change,replaceStrategy(Strategy)needs to be called.
-
-
-
Constructor Detail
-
Stage
public Stage(@NonNull android.content.Context context, @NonNull java.lang.String token, @NonNull Stage.Strategy strategy)Create a new Stage. This is the main interaction point for interacting with the Stage SDK.- Parameters:
context- A DisplayContext or ActivityContext. The ApplicationContext may cause issues for applications compiled against newer SDK versions.token- A token generated by the IVS control plane that will be used to join the Stage whenjoin()is called.strategy- TheStage.Strategyto use for this Stage.
-
-
Method Detail
-
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
join
public void join() throws BroadcastExceptionJoins the Stage session associated with the token provided during initialization.- Throws:
BroadcastException- if this Stage has already calledrelease(), or if the token provided in Stage constructor was invalid or expired.
-
leave
public void leave()
Leaves the joined Stage session. If no Stage session is joined, this call is a no-op
-
addRenderer
public void addRenderer(StageRenderer renderer)
Adds a renderer to the list of renderers that will be notified of updates to the Stage.- Parameters:
renderer- renderer delegate implementation
-
removeRenderer
public void removeRenderer(StageRenderer renderer)
Removes a renderer from the list of renderers that will be notified of updates to the Stage.- Parameters:
renderer- renderer delegate implementation
-
replaceStrategy
public void replaceStrategy(Stage.Strategy strategy)
Whenever strategy is changed and host application wants SDK to honor the change,replaceStrategy(Strategy)needs to be called.- Parameters:
strategy- strategy delegate implementation
-
refreshStrategy
public void refreshStrategy()
Triggers theStage.Strategyon this instance to refresh its state. This is how host applications will make changes to how they are interacting with a Stage.
-
release
public void release()
Releases the resources associated with this Stage. After calling this, the Stage will no longer be useable.- Specified by:
releasein interfaceReleasable
-
-