Package com.castlabs.sdk.broadpeak
Class BroadpeakPlugin
java.lang.Object
com.castlabs.android.Plugin
com.castlabs.sdk.broadpeak.BroadpeakPlugin
This plugin integrates Broadpeak Analytics with the castLabs Player SDK.
You can enable and register the plugin before you initialize the SDK:
private static final String ANALYTICS_URL = "http://48.15.16.23";
public class MyApp extends Application {
@
Override
public void onCreate() {
super.onCreate();
BroadpeakPlugin broadpeak = new BroadpeakPlugin(ANALYTICS_URL, NANO_CDN_HOST, DOMAIN_NAMES);
PlayerSDK.register(broadpeak);
PlayerSDK.init(getApplicationContext());
}
}
- Since:
- 4.1.8
-
Field Summary
-
Constructor Summary
ConstructorDescriptionBroadpeakPlugin
(String analyticsUrl, String nanoCDNHost, String broadpeakDomainNames) -
Method Summary
Modifier and TypeMethodDescriptionstatic AnalyticsMetaData
createMetadata
(boolean live, String assetId, Bundle customParameters, SparseArray<Object> options) Create analytics metadata based on provided datastatic AnalyticsMetaData
createMetadata
(AnalyticsMetaData analyticsMetaData, Bundle customParameters, SparseArray<Object> options) Update provided analytics metadata with extra Broadpeak metadatagetId()
void
void
setEnabled
(boolean enabled) Enables or disables the BroadpeakPlugin.Methods inherited from class com.castlabs.android.Plugin
onRemotePlay
-
Field Details
-
SESSION_START_RETRIES
public static int SESSION_START_RETRIES
-
-
Constructor Details
-
BroadpeakPlugin
public BroadpeakPlugin(@Nullable String analyticsUrl, @Nullable String nanoCDNHost, @Nullable String broadpeakDomainNames) - Parameters:
analyticsUrl
- Host where to send analytics. Can be null if the analytics service is not to be used.nanoCDNHost
- Broadpeak's Nano CDN Host. Can be null.broadpeakDomainNames
- Broadpeak Domain Names. If null, the default ("*") will be used.
-
-
Method Details
-
setEnabled
public void setEnabled(boolean enabled) Enables or disables the BroadpeakPlugin. Note that this has to be set to the desired value *before* thePlayerController
creation. Default is true.- Parameters:
enabled
- whether to enable the plugin or not.
-
init
-
createMetadata
@NonNull public static AnalyticsMetaData createMetadata(boolean live, @NonNull String assetId, @Nullable Bundle customParameters, @Nullable SparseArray<Object> options) Create analytics metadata based on provided data- Parameters:
live
- true if the current content is a live stream and false otherwiseassetId
- The asset ID uniquely identifies the contentcustomParameters
- Custom Broadpeak parameters, which will be added to theStreamingSession
. The params must be String values. Can be null.options
- Custom Broadpeak options, which will be added to theStreamingSession
. Keys for these options are declared inStreamingSessionOptions
. Values must be boolean, int or String. Can be null.- Returns:
- Created analytics metadata
-
createMetadata
@NonNull public static AnalyticsMetaData createMetadata(@NonNull AnalyticsMetaData analyticsMetaData, @Nullable Bundle customParameters, @Nullable SparseArray<Object> options) Update provided analytics metadata with extra Broadpeak metadata- Parameters:
analyticsMetaData
- Existing AnalyticsMetadata where to add Broadpeak metadatacustomParameters
- Custom Broadpeak parameters, which will be added to theStreamingSession
. The params must be String values. Can be null.options
- Custom Broadpeak options, which will be added to theStreamingSession
. Keys for these options are declared inStreamingSessionOptions
. Values must be boolean, int or String. Can be null.- Returns:
- Updated analytics metadata
-
getId
-