Interface CastSession
- All Superinterfaces:
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.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the description of the session.boolean
isAlive()
Returnstrue
if the session is alive.boolean
isLocal()
Returnstrue
if the cast session is initiated and managed by the current profile.Returns the media receiver of this session.mode()
Returns the mode of the session.profile()
Returns the profile that discovered this cast session.void
stop()
Stops this cast session.Methods inherited from interface com.teamdev.jxbrowser.event.Observable
on
-
Method Details
-
mediaReceiver
MediaReceiver mediaReceiver()Returns the media receiver of this session.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.
- Throws:
ObjectClosedException
- when the profile is deleted or its engine is closedReceiverNotDiscoveredException
- when the receiver has not been discovered within 45 seconds
-
mode
CastMode mode()Returns the mode of the session.- Throws:
ObjectClosedException
- when the profile is deleted or its engine is closed
-
description
String description()Returns the description of the session. Examples: "Mirroring tab (www.example.com)", "Casting media", "Casting YouTube".The description may be empty when the session just started and Chromium didn't define the cast content yet.
- Throws:
ObjectClosedException
- when the profile is deleted or its engine is closed
-
stop
void stop()Stops this cast session.Does nothing if the cast session is already stopped.
- Throws:
ObjectClosedException
- when the profile is deleted or its engine is closed
-
isAlive
boolean isAlive()Returnstrue
if the session is alive.- Throws:
ObjectClosedException
- when the profile is deleted or its engine is closed
-
isLocal
boolean isLocal()Returnstrue
if the cast session is initiated and managed by the current profile.- Throws:
ObjectClosedException
- when the profile is deleted or its engine is closed
-
profile
Profile profile()Returns the profile that discovered this cast session.If the session is not local then this is not the profile that started the session.
-