BitmovinCastManager

BitmovinCastManager

open class BitmovinCastManager

Singleton providing access to GoogleCast related features. The BitmovinCastManager needs to be initialized in the Application, if casting should be used.

Note: Make sure to call updateContext on every Activitys switch. On devices where casting is unavailable, Cast operations are no-ops and return false when applicable.

Properties

NameSummary
applicationIdopen val applicationId: String
instanceopen val instance: BitmovinCastManager
messageNamespaceopen val messageNamespace: String

Functions

NameSummary
addMessageReceivedCallbackopen fun addMessageReceivedCallback(callback: Cast.MessageReceivedCallback)
Adds a MessageReceivedCallback to the BitmovinCastManager.
disconnectopen fun disconnect()
Disconnects from the current cast session.
getCastControllerActivityClassopen fun getCastControllerActivityClass(): Class
Returns the class of the expanded controller activity, used at initialization.
initializeopen fun initialize()
open fun initialize(castControllerActivity: Class)
open fun initialize(applicationId: String, messageNamespace: String)
open fun initialize(@NullableapplicationId: String, messageNamespace: String, castControllerActivity: Class)
Initializes the BitmovinCastManager.
isCastAvailableopen fun isCastAvailable(): Boolean
Indicates whether Google Cast has been initialized and is available.
isConnectedopen fun isConnected(): Boolean
Returns true if currently connected to a cast session.
isConnectingopen fun isConnecting(): Boolean
Returns true if currently connecting to a cast session.
isInitializedopen fun isInitialized(): Boolean
removeMessageReceivedCallbackopen fun removeMessageReceivedCallback(callback: Cast.MessageReceivedCallback)
Removes a MessageReceivedCallback from the BitmovinCastManager.
sendMessageopen fun sendMessage(message: String): Boolean
Sends the given message to the cast receiver.
open fun sendMessage(message: String, @NullablemessageNamespace: String): Boolean
Sends the given message to the cast receiver on the provided messageNamespace.
sendMetadataopen fun sendMetadata(@NonNullmetadata: Map<String, out Any>): Boolean
Sends the given metadata wrapped in a metadata message object to the cast receiver on the configured message namespace.
showDialogopen fun showDialog(): Boolean
Opens the cast dialog, for selecting and starting a cast session.
updateContextopen fun updateContext(context: Context)
Must be called in every Activity to update the context.