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.

Functions

Link copied to clipboard
open fun addMessageReceivedCallback(callback: Cast.MessageReceivedCallback)
Adds a MessageReceivedCallback to the BitmovinCastManager.
Link copied to clipboard
open fun disconnect()
Disconnects from the current cast session.
Link copied to clipboard
open fun getCastControllerActivityClass(): Class
Returns the class of the expanded controller activity, used at initialization.
Link copied to clipboard
open fun initialize()
open fun initialize(castControllerActivity: Class)
open fun initialize(applicationId: String, messageNamespace: String)
open fun initialize(@Nullable applicationId: String, messageNamespace: String, castControllerActivity: Class)
Initializes the BitmovinCastManager.
Link copied to clipboard
open fun isCastAvailable(): Boolean
Returns true if there are cast devices nearby and available for casting.
Link copied to clipboard
open fun isConnected(): Boolean
Returns true if currently connected to a cast session.
Link copied to clipboard
open fun isConnecting(): Boolean
Returns true if currently connecting to a cast session.
Link copied to clipboard
open fun isInitialized(): Boolean
Link copied to clipboard
open fun removeMessageReceivedCallback(callback: Cast.MessageReceivedCallback)
Removes a MessageReceivedCallback from the BitmovinCastManager.
Link copied to clipboard
open fun sendMessage(message: String): Boolean
Sends the given message to the cast receiver.
open fun sendMessage(message: String, @Nullable messageNamespace: String): Boolean
Sends the given message to the cast receiver on the provided messageNamespace.
Link copied to clipboard
open fun sendMetadata(@NonNull metadata: Map<String, out Any>): Boolean
Sends the given metadata wrapped in a metadata message object to the cast receiver on the configured message namespace.
Link copied to clipboard
open fun showDialog(): Boolean
Opens the cast dialog, for selecting and starting a cast session.
Link copied to clipboard
open fun updateContext(context: Context)
Must be called in every Activity to update the context.

Properties

Link copied to clipboard
private open val applicationId: String
Link copied to clipboard
private open val instance: BitmovinCastManager
Link copied to clipboard
private open val messageNamespace: String