Class VimondPlugin


  • public class VimondPlugin
    extends Plugin
    Vimond Player Session API Plugin

    This plugin integrates Vimond's Player Session API. Such API allows provides some basic analytics capabilities, alongside with an implementation of concurrent stream limiting.

    In order for this plugin to operate, a JSONObject must be provided with the player event template. This template should follow Vimond's structure, and is returned by their "play" request.

    The plugin will not override the following values, so it's up to the consumer of this plugin to provide a value for them:

    • originator
    • client.envPlatform
    • client.envVersion
    • viewingSession

    In addition, the an authentication token must also be provided. This token will be used for the authentication header. A new token can be provided to the Plugin at runtime. Check the documentation for VimondComponent for more details on how to do this.

    Basic usage of the plugin:

    
      public class MyApp extends Application {
         @Override
          public void onCreate() {
              super.onCreate();
              // ...
              VimondPlugin vimond = new VimondPlugin();
              PlayerSDK.register(vimond);
              // ...
              PlayerSDK.init(getApplicationContext());
          }
     }
     

    When starting playback, the template and token must be provided in the AnalyticsMetaData class passed to the PlayerController.open(Bundle) method:

    
      bundle.putParcelable(SdkConsts.INTENT_ANALYTICS_DATA,
             VimondPlugin.createMetadata(templateObject, "token"));
      // ...
      playerController.open(bundle);
     
    Since:
    4.2.34
    • Constructor Detail

      • VimondPlugin

        public VimondPlugin()
    • Method Detail

      • createMetadata

        @Nullable
        public static AnalyticsMetaData createMetadata​(@NonNull
                                                       JSONObject vimondRequest,
                                                       @NonNull
                                                       String token)
        Create an AnalyticsMetaData object from a Vimond configuration JSONObject.
        Parameters:
        vimondRequest - JSONObject with Vimond configuration
        token - The token to use for authentication
        Returns:
        instance of AnalyticsMetaData. Can be null if the request object does not have the expected structure.
      • createMetadata

        @Nullable
        public static AnalyticsMetaData createMetadata​(@NonNull
                                                       JSONObject vimondRequest,
                                                       @NonNull
                                                       String token,
                                                       @Nullable
                                                       AnalyticsMetaData analyticsMetaData)
        Populate or create an AnalyticsMetaData object from a Vimond configuration JSONObject.
        Parameters:
        vimondRequest - JSONObject with Vimond configuration
        token - The token to use for authentication
        analyticsMetaData - AnalyticsMetadata which will be used to save the Vimond config. If null, a new AnalyticsMetadata will be created.
        Returns:
        instance of AnalyticsMetaData. Can be null if the request object does not have the expected structure.