Class Plugin

java.lang.Object
com.castlabs.android.Plugin
Direct Known Subclasses:
DefaultPlayerPlugin, HlsInterstitialPlugin

public abstract class Plugin extends Object
Simple plugin interface that is used to register components with the castLabs SDK.

Implementations of this interface can be registered using PlayerSDK.register(Plugin).

Since:
3.0.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor for the plugin.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract String
    Returns the ID of the plugin.
    void
    init(Context context)
    This method is called on registered plugins after the player SDK was successfully initialized.
    void
    onRemotePlay(Bundle localConfiguration, JSONObject remoteConfiguration)
    Invoked whenever starting remote play (ie.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Plugin

      public Plugin()
      Default constructor for the plugin.
  • Method Details

    • init

      public void init(Context context)
      This method is called on registered plugins after the player SDK was successfully initialized.

      Note that if this method fails to initialize, the plugin should un-register itself cleanly.

      Parameters:
      context - The application context
    • getId

      @NonNull public abstract String getId()
      Returns the ID of the plugin. This ID is used to identify the plugin
      Returns:
      The plugin ID or null
    • onRemotePlay

      public void onRemotePlay(@NonNull Bundle localConfiguration, @NonNull JSONObject remoteConfiguration)
      Invoked whenever starting remote play (ie. Chromecast). Concrete Plugins which have relevant data should override this method and map the appropriate data.
      Parameters:
      localConfiguration - the local (SDK) configuration
      remoteConfiguration - the remote configuration