Class Plugin

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

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 Details

    • Plugin

      public 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 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