public interface CastSession extends Observable<CastSessionStopped>
The session is discovered when the user starts casting
the browser/screen content or a presentation of media content via the JxBrowser API, or another
application, i.e. Google Chrome. To indicate that the cast session has been started by another
profile and, accordingly, a Chromium instance the isLocal() method is provided.
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
description()
Returns the description of the session.
|
boolean |
isAlive()
Returns
true if the session is alive. |
boolean |
isLocal()
Returns
true if the cast session is initiated and managed by the current
profile. |
MediaReceiver |
mediaReceiver()
Returns the media receiver of this session.
|
CastMode |
mode()
Returns the mode of the session.
|
Profile |
profile()
Returns the profile that discovered this cast session.
|
void |
stop()
Stops this cast session.
|
onMediaReceiver mediaReceiver()
The method may block the current thread if the receiver is not discovered yet. It may happen when the cast session is not isLocal() local} and started on the receiver not yet discovered by the current instance of Chromium.
ObjectClosedException - when the profile is deleted or its engine is closedReceiverNotDiscoveredException - when the receiver has not been discovered within 45 secondsCastMode mode()
ObjectClosedException - when the profile is deleted or its engine is closedjava.lang.String description()
The description may be empty when the session just started and Chromium didn't define the cast content yet.
ObjectClosedException - when the profile is deleted or its engine is closedvoid stop()
Does nothing if the cast session is already stopped.
ObjectClosedException - when the profile is deleted or its engine is closedboolean isAlive()
true if the session is alive.ObjectClosedException - when the profile is deleted or its engine is closedboolean isLocal()
true if the cast session is initiated and managed by the current
profile.ObjectClosedException - when the profile is deleted or its engine is closed