CastRemoteDisplayLocalService.Callbacks
Stay organized with collections
Save and categorize content based on your preferences.
Public Method Summary
abstract void |
|
abstract void |
|
abstract void |
|
abstract void |
|
abstract void |
|
Public Methods
public abstract void onRemoteDisplayMuteStateChanged (boolean isMuted)
Called when the Cast Remote Display session's audio mute state is changed. The
Remote Display session might be muted when the app is backgrounded.
Parameters
isMuted |
the value true indicating that the Cast Remote Display is
muted |
public abstract void onRemoteDisplaySessionEnded (CastRemoteDisplayLocalService
service)
Called when the Cast Remote Display session has been ended. It will be called to
provide session information and trigger detections when the session stops.
Parameters
service |
This instance of the service. |
public abstract void onRemoteDisplaySessionError (Status
status)
Called when the Cast Remote Display session could not be successfully created.
Called when the local service has been created. In most scenarios applications can
simply ignore this callback. However, for optimization reasons, some applications may
want to start some initialization in the context of the local service as soon as it is
created, while the Cast Remote Display session is still starting. Another possible use
case is updating the custom notification with a notification that uses the service
context.
Parameters
service |
This instance of the service. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eCastRemoteDisplayLocalService.Callbacks\u003c/code\u003e provides a set of callback methods to monitor the lifecycle and state changes of a Cast Remote Display session.\u003c/p\u003e\n"],["\u003cp\u003eThese callbacks inform the application about session start and end, mute state changes, errors, and service creation.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eonRemoteDisplaySessionStarted\u003c/code\u003e and \u003ccode\u003eonRemoteDisplaySessionEnded\u003c/code\u003e signal the beginning and termination of a remote display session respectively.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eonRemoteDisplayMuteStateChanged\u003c/code\u003e is triggered when the audio mute state of the remote display session is altered.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eonRemoteDisplaySessionError\u003c/code\u003e is invoked if the Cast Remote Display session encounters an error during creation or operation, providing details about the failure through a \u003ccode\u003eStatus\u003c/code\u003e object.\u003c/p\u003e\n"]]],[],null,["# CastRemoteDisplayLocalService.Callbacks\n\npublic static interface **CastRemoteDisplayLocalService.Callbacks** \nCallbacks for the Cast Remote Display session initiated using [CastRemoteDisplayLocalService](/android/reference/com/google/android/gms/cast/CastRemoteDisplayLocalService). \n\n### Public Method Summary\n\n|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract void | [onRemoteDisplayMuteStateChanged](/android/reference/com/google/android/gms/cast/CastRemoteDisplayLocalService.Callbacks#onRemoteDisplayMuteStateChanged(boolean))(boolean isMuted) Called when the Cast Remote Display session's audio mute state is changed. |\n| abstract void | [onRemoteDisplaySessionEnded](/android/reference/com/google/android/gms/cast/CastRemoteDisplayLocalService.Callbacks#onRemoteDisplaySessionEnded(com.google.android.gms.cast.CastRemoteDisplayLocalService))([CastRemoteDisplayLocalService](/android/reference/com/google/android/gms/cast/CastRemoteDisplayLocalService) service) Called when the Cast Remote Display session has been ended. |\n| abstract void | [onRemoteDisplaySessionError](/android/reference/com/google/android/gms/cast/CastRemoteDisplayLocalService.Callbacks#onRemoteDisplaySessionError(com.google.android.gms.common.api.Status))([Status](/android/reference/com/google/android/gms/common/api/Status) status) Called when the Cast Remote Display session could not be successfully created. |\n| abstract void | [onRemoteDisplaySessionStarted](/android/reference/com/google/android/gms/cast/CastRemoteDisplayLocalService.Callbacks#onRemoteDisplaySessionStarted(com.google.android.gms.cast.CastRemoteDisplayLocalService))([CastRemoteDisplayLocalService](/android/reference/com/google/android/gms/cast/CastRemoteDisplayLocalService) service) Called when the Cast Remote Display session has been successfully created. |\n| abstract void | [onServiceCreated](/android/reference/com/google/android/gms/cast/CastRemoteDisplayLocalService.Callbacks#onServiceCreated(com.google.android.gms.cast.CastRemoteDisplayLocalService))([CastRemoteDisplayLocalService](/android/reference/com/google/android/gms/cast/CastRemoteDisplayLocalService) service) Called when the local service has been created. |\n\nPublic Methods\n--------------\n\n#### public abstract void **onRemoteDisplayMuteStateChanged** (boolean isMuted)\n\nCalled when the Cast Remote Display session's audio mute state is changed. The\nRemote Display session might be muted when the app is backgrounded. \n\n##### Parameters\n\n| isMuted | the value `true` indicating that the Cast Remote Display is muted |\n|---------|-------------------------------------------------------------------|\n\n#### public abstract void **onRemoteDisplaySessionEnded** ([CastRemoteDisplayLocalService](/android/reference/com/google/android/gms/cast/CastRemoteDisplayLocalService) service)\n\nCalled when the Cast Remote Display session has been ended. It will be called to\nprovide session information and trigger detections when the session stops. \n\n##### Parameters\n\n| service | This instance of the service. |\n|---------|-------------------------------|\n\n#### public abstract void **onRemoteDisplaySessionError** ([Status](/android/reference/com/google/android/gms/common/api/Status) status)\n\nCalled when the Cast Remote Display session could not be successfully created. \n\n##### Parameters\n\n| status | The reason why an error occurred establishing the Cast Remote Display session. The possible set of error codes are [CastStatusCodes.ERROR_SERVICE_CREATION_FAILED](/android/reference/com/google/android/gms/cast/CastStatusCodes#ERROR_SERVICE_CREATION_FAILED) and [CastStatusCodes.ERROR_SERVICE_DISCONNECTED](/android/reference/com/google/android/gms/cast/CastStatusCodes#ERROR_SERVICE_DISCONNECTED). |\n|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n#### public abstract void **onRemoteDisplaySessionStarted** ([CastRemoteDisplayLocalService](/android/reference/com/google/android/gms/cast/CastRemoteDisplayLocalService) service)\n\nCalled when the Cast Remote Display session has been successfully created. It will\nbe called before the invoking [CastRemoteDisplayLocalService.onCreatePresentation(Display)](/android/reference/com/google/android/gms/cast/CastRemoteDisplayLocalService#onCreatePresentation(android.view.Display)). In this way,\nthe service could be configured (if needed) before the [CastPresentation](/android/reference/com/google/android/gms/cast/CastPresentation)\nis started. \n\n##### Parameters\n\n| service | This instance of the service. |\n|---------|-------------------------------|\n\n#### public abstract void **onServiceCreated** ([CastRemoteDisplayLocalService](/android/reference/com/google/android/gms/cast/CastRemoteDisplayLocalService) service)\n\nCalled when the local service has been created. In most scenarios applications can\nsimply ignore this callback. However, for optimization reasons, some applications may\nwant to start some initialization in the context of the local service as soon as it is\ncreated, while the Cast Remote Display session is still starting. Another possible use\ncase is updating the custom notification with a notification that uses the service\ncontext. \n\n##### Parameters\n\n| service | This instance of the service. |\n|---------|-------------------------------|"]]