AI-generated Key Takeaways
-
CastRemoteDisplayClient is a deprecated class for starting Cast Remote Display sessions and will be removed in a future release.
-
CastRemoteDisplayLocalService is generally recommended instead of CastRemoteDisplayClient for managing Cast Remote Display sessions in most use cases.
-
CastRemoteDisplayClient is available for specific use cases where rendering needs to happen in a separate foreground service process.
-
The CastRemoteDisplayClient provides low-level APIs to start and stop a Cast Remote Display session.
This class is deprecated.
The Remote Display feature is deprecated and will be removed in a future release.
The low level API for starting a Cast Remote Display session (see CastRemoteDisplay).
In most use cases CastRemoteDisplayLocalService
should be considered instead as it will simplify managing the Cast Remote Display session
when the main activity goes to background and will provide a customizable default
notification. CastRemoteDisplayClient
is available for the use cases where the Cast Remote Display rendering has to happen in a
foreground service that runs in a separate process.
Public Method Summary
| Task<Display> |
startRemoteDisplay(CastDevice
castDevice, String
applicationId, int configPreset, PendingIntent
sessionEndedPendingIntent)
The low level API for starting a Cast Remote Display session.
|
| Task<Void> |
stopRemoteDisplay()
The low level API for stopping a Cast Remote Display session.
|
Inherited Method Summary
Public Methods
public Task<Display> startRemoteDisplay (CastDevice castDevice, String applicationId, int configPreset, PendingIntent sessionEndedPendingIntent)
The low level API for starting a Cast Remote Display session. Calling this method will terminate any Cast Remote Display session previously started on this Android device.
Parameters
| castDevice | The CastDevice
to start Cast Remote Display. Must not be null. |
|---|---|
| applicationId | The ID of Cast Remote Display application (from the Cast developer portal).
Must not be null. |
| configPreset | The desired streaming preset, which is one of
CastRemoteDisplay.Configuration |
| sessionEndedPendingIntent | An optional PendingIntent.
If provided, it will be fired when the Cast Remote Display session started by this
call is ended. Caller can register a BroadcastReceiver
to receive it. In the received Intent,
an int extra keyed by
CastRemoteDisplay.EXTRA_INT_SESSION_ENDED_STATUS_CODE contains the
CastStatusCodes
indicating the reason that caused the remote display session to end. |
Returns
- A
Taskthat will be successful if the remote display session could be started normally, in this case it will contain the display that can be used with aPresentation.