AI-generated Key Takeaways
-
Annotations like CastReasonCodes.CastReasonType and SessionTransferCallback types provide information about casting reasons and session transfer failures or types.
-
Interfaces such as CastStateListener, IntroductoryOverlay, OptionsProvider, and SessionManagerListener are used for monitoring casting states, displaying introductory overlays, providing CastContext options, and managing session events.
-
Classes like CastButtonFactory, CastContext, CastOptions, CastSession, SessionManager, and SessionTransferCallback manage Cast button setup, provide a global Cast SDK context, configure Cast initialization, represent casting sessions, manage sessions, and monitor session transfers.
-
The ModuleUnavailableException is thrown if the internal Cast module fails to load.
Annotations
| CastReasonCodes.CastReasonType | Annotation used for the CastReasonCodes. |
| SessionTransferCallback.TransferFailedReason | The failure reason of transferring to the new endpoint. |
| SessionTransferCallback.TransferType | The transfer type of switching endpoints. |
Interfaces
| AppVisibilityListener | This interface is deprecated. Don't use the
SDK to listen to app visibility changes. Use alternative ways for watching activity
lifecycle changes such as by overriding Activity
lifecycle change methods, or by using
Application.ActivityLifecycleCallbacks. |
| CastStateListener | A listener interface for monitoring the current
CastState. |
| IntroductoryOverlay | A simple overlay view that highlights the Cast button to the user. |
| IntroductoryOverlay.OnOverlayDismissedListener | An interface to notify the clients when the overlay is dismissed explicitly when the user taps on the confirmation button. |
| OptionsProvider | Developers should implement this interface to
provide options needed to create and initialize CastContext. |
| SessionManagerListener<T extends Session> | A listener interface for monitoring events of a
particular type of Session
instance. |
Classes
| CastButtonFactory | A factory class to set up a MenuItem or a
MediaRouteButton
to be used as a Cast button. |
| CastContext | A singleton class containing global context for the Cast SDK. |
| CastOptions | Configuration parameters for initializing the
CastContext. |
| CastOptions.Builder | A builder to create an instance of CastOptions
which is used to initialize the CastContext. |
| CastReasonCodes | A class containing developer-friendly error codes
mapped from CastStatusCodes. |
| CastSession | An implementation of Session
for managing connections to a Cast receiver device. |
| CastState | The possible casting states. |
| IntroductoryOverlay.Builder | The builder class that creates an instance of
IntroductoryOverlay. |
| MediaNotificationManager | A class that manages the media notification. |
| PrecacheManager | The entry point of pre-cache APIs. |
| ReconnectionService | A service to run in the background when the playback of a media starts, to help with reconnection if needed. |
| Session | An abstract base class representing a session with a receiver application. |
| SessionManager | A class that manages Session
instances. |
| SessionProvider | An abstract base class for performing session construction. |
| SessionTransferCallback | Callbacks to monitor the transfer of the Cast session to another endpoint. |
Exceptions
| ModuleUnavailableException | An exception thrown when the internal Cast module fails to load. |