Package com.castlabs.sdk.broadpeak
Class BroadpeakPlugin
java.lang.Object
com.castlabs.android.Plugin
com.castlabs.sdk.broadpeak.BroadpeakPlugin
- All Implemented Interfaces:
AdProvider,ServerAdProvider
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA helper class to buildAnalyticsMetaDataobjects for the Broadpeak plugin. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringIdentifier used to register Broadpeak as an ad provider withAdverts.static booleanIndicates whether to enable Broadpeak's advertising.static booleanWhether to enable Broadpeak precaching as default when creating a Session.static intNumber of retries to start a session. -
Constructor Summary
ConstructorsConstructorDescriptionBroadpeakPlugin(String analyticsUrl, String nanoCDNHost, String broadpeakDomainNames) Creates a new instance ofBroadpeakPlugin. -
Method Summary
Modifier and TypeMethodDescriptioncreateAdLoader(PlayerConfig config) static AnalyticsMetaDatacreateMetadata(boolean live, String assetId, Bundle customParameters, SparseArray<Object> options) Deprecated.static AnalyticsMetaDatacreateMetadata(AnalyticsMetaData analyticsMetaData, Bundle customParameters, SparseArray<Object> options) Deprecated.UseBroadpeakPlugin.MetadataBuilderinstead.getId()getName()voidvoidsetEnabled(boolean enabled) Enables or disables the BroadpeakPlugin.Methods inherited from class com.castlabs.android.Plugin
onRemotePlay
-
Field Details
-
AD_PROVIDER_NAME
Identifier used to register Broadpeak as an ad provider withAdverts.- See Also:
-
SESSION_START_RETRIES
public static int SESSION_START_RETRIESNumber of retries to start a session. Default is 3. -
DEFAULT_PRECACHE
public static boolean DEFAULT_PRECACHEWhether to enable Broadpeak precaching as default when creating a Session.Note that if
BroadpeakPlugin.MetadataBuilder.precache(boolean)is informed, it will override this default value. -
adTracking
public static boolean adTrackingIndicates whether to enable Broadpeak's advertising. Default is false.
-
-
Constructor Details
-
BroadpeakPlugin
public BroadpeakPlugin(@Nullable String analyticsUrl, @Nullable String nanoCDNHost, @Nullable String broadpeakDomainNames) Creates a new instance ofBroadpeakPlugin.- 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* thePlayerControllercreation. Default is true.- Parameters:
enabled- whether to enable the plugin or not.
-
init
-
createAdLoader
- Specified by:
createAdLoaderin interfaceServerAdProvider
-
getName
- Specified by:
getNamein interfaceAdProvider
-
createMetadata
@NonNull @Deprecated public static AnalyticsMetaData createMetadata(boolean live, @NonNull String assetId, @Nullable Bundle customParameters, @Nullable SparseArray<Object> options) Deprecated.UseBroadpeakPlugin.MetadataBuilderinstead.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 @Deprecated public static AnalyticsMetaData createMetadata(@NonNull AnalyticsMetaData analyticsMetaData, @Nullable Bundle customParameters, @Nullable SparseArray<Object> options) Deprecated.UseBroadpeakPlugin.MetadataBuilderinstead.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
-
BroadpeakPlugin.MetadataBuilderinstead.