Class VimondPlugin
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic AnalyticsMetaData
createMetadata
(JSONObject vimondRequest, String token) Create anAnalyticsMetaData
object from a Vimond configurationJSONObject
.static AnalyticsMetaData
createMetadata
(JSONObject vimondRequest, String token, AnalyticsMetaData analyticsMetaData) Populate or create anAnalyticsMetaData
object from a Vimond configurationJSONObject
.getId()
void
onRemotePlay
(Bundle localConfiguration, JSONObject remoteConfiguration)
-
Constructor Details
-
VimondPlugin
public VimondPlugin()
-
-
Method Details
-
getId
-
createMetadata
@Nullable public static AnalyticsMetaData createMetadata(@NonNull JSONObject vimondRequest, @NonNull String token) Create anAnalyticsMetaData
object from a Vimond configurationJSONObject
.- Parameters:
vimondRequest
- JSONObject with Vimond configurationtoken
- 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 anAnalyticsMetaData
object from a Vimond configurationJSONObject
.- Parameters:
vimondRequest
- JSONObject with Vimond configurationtoken
- The token to use for authenticationanalyticsMetaData
- 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.
-
onRemotePlay
public void onRemotePlay(@NonNull Bundle localConfiguration, @NonNull JSONObject remoteConfiguration) - Overrides:
onRemotePlay
in classPlugin
-