Class YospacePlugin

java.lang.Object
com.castlabs.android.Plugin
com.castlabs.sdk.yospace.YospacePlugin
All Implemented Interfaces:
AdProvider, ServerAdProvider

public final class YospacePlugin extends Plugin implements ServerAdProvider
PRESTOplay integration for Yospace server-side ad insertion.
Since:
4.5.3
  • Field Details

    • AD_PROVIDER_NAME

      public static final String AD_PROVIDER_NAME
      Name used by the server-side ad provider registry.
      See Also:
    • SESSION_START_TIMEOUT_MS

      public static int SESSION_START_TIMEOUT_MS
      Maximum time spent waiting for Yospace to return the playback URL.
    • ERROR_DATA_RESULT_CODE

      public static final String ERROR_DATA_RESULT_CODE
      Key in CastlabsPlayerException.getErrorData() carrying the Yospace result code of a failed session initialization. The entry is only present when a result code was reported.
      See Also:
  • Constructor Details

    • YospacePlugin

      public YospacePlugin()
      Creates a plugin with playback-preserving error defaults.
    • YospacePlugin

      public YospacePlugin(@NonNull YospacePlugin.NoAnalyticsBehavior noAnalyticsBehavior, @NonNull YospacePlugin.TimeoutBehavior timeoutBehavior)
      Creates a plugin with explicit session error behavior.
      Parameters:
      noAnalyticsBehavior - behavior for sessions without analytics
      timeoutBehavior - behavior for mid-playback session timeouts
  • Method Details

    • setEnabled

      public void setEnabled(boolean enabled)
      Enables or disables components created after this call.
      Parameters:
      enabled - whether new controller components are enabled
    • setDefaultPlaybackPolicyHandler

      public void setDefaultPlaybackPolicyHandler(@Nullable com.yospace.yospacefeatures.PlaybackPolicyHandler handler)
      Sets the default policy used by new controller components.
      Parameters:
      handler - default handler, or null for the built-in policy
    • setDebugFlags

      public static void setDebugFlags(int flags)
      Enables Yospace diagnostic flags, including YoLog.DEBUG_VALIDATION.
      Parameters:
      flags - bitwise combination of YoLog debug flags
    • init

      public void init(@NonNull Context context)
      Overrides:
      init in class Plugin
    • getId

      @NonNull public String getId()
      Specified by:
      getId in class Plugin
    • getName

      @NonNull public String getName()
      Specified by:
      getName in interface AdProvider
    • createAdLoader

      @Nullable public ServerAdLoader createAdLoader(@NonNull PlayerConfig config)
      Specified by:
      createAdLoader in interface ServerAdProvider