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 (seeCastRemoteDisplay
).
In most use casesCastRemoteDisplayLocalService
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(CastDevicecastDevice, StringapplicationId, 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 | TheCastDevice
to start Cast Remote Display. Must not benull . |
---|---|
applicationId | The ID of Cast Remote Display application (from the Cast developer portal).
Must not benull . |
configPreset | The desired streaming preset, which is one of
CastRemoteDisplay.Configuration |
sessionEndedPendingIntent | An optionalPendingIntent .
If provided, it will be fired when the Cast Remote Display session started by this
call is ended. Caller can register aBroadcastReceiver
to receive it. In the receivedIntent ,
anint 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
Task
that 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
.