This article describes on how to integrate Conviva pre-integration included inside THEOplayer SDK. A demo can be found at http://demo.theoplayer.com/conviva-analytics-test-page-20171024.
Web SDK | Android SDK | iOS SDK | tvOS SDK | Android TV SDK | Chromecast SDK |
---|---|---|---|---|---|
Yes | Yes | Yes | No | Yes | Unverified |
//Latest Conviva Library
<script
type="text/javascript"
src="//cdn.theoplayer.com/conviva/conviva-4.0.15.js"
></script>
The snippets below explain how you can pass on Conviva settings to a THEOplayer configuration object.
A code example can be found at http://demo.theoplayer.com/conviva-analytics-test-page-20171024.
var convivaConfiguration = {
integration: "conviva",
customerKey: "<CUSTOMER_KEY>",
gatewayUrl: "<GATEWAY_URL>",
contentMetadata: {
assetName: "<ASSET_NAME>",
live: isLive,
// "viewerId": "<VIEWER_ID>",
// "defaultBitRateKbps": "<DEFAULT_BITRATE_KBPS>",
// "defaultResource": "<DEFAULT_RESOURCE>",
// "duration": 1000,
// "encodedFrameRate": 30,
// "applicationName": "<APPLICATION_NAME>"
// "custom": {
// "<KEY>": "<VALUE>",
// }
},
};
player.source = {
analytics: [convivaConfiguration],
sources: [typedSource],
};
The snippet below is an example configuration for Conviva.
HashMap<String, String> customConvivaMetadata = new HashMap<>();
int defaultBitRateKbps = 1000,
duration = 1000,
encodedFrameRate = 30,
heartbeatInterval = 5;
boolean isLive = false,
isManualSessionControl = false;
customConvivaMetadata.put("<KEY>", "<VALUE>");
ConvivaConfiguration convivaConfiguration = new ConvivaConfiguration.Builder("customerKey",
new ConvivaContentMetadata.Builder("<ASSET_NAME>")
.applicationName("<APPLICATION_NAME>")
.defaultBitrateKbps(defaultBitRateKbps)
.defaultResource("<DEFAULT_RESOURCE>")
.duration(duration)
.encodedFrameRate(encodedFrameRate)
.live(isLive)
.viewerId("<VIEWER_ID>")
.custom(customConvivaMetadata)
.build())
.gatewayUrl("<GATEWAY_URL>")
.heartbeatInterval(heartbeatInterval)
.manualSessionControl(isManualSessionControl)
.build();
SourceDescription sourceDescription = SourceDescription.Builder.sourceDescription()
.sources(typedSource)
.analytics(convivaConfiguration)
.build();
The snippet below is an example configuration for Conviva.
let isLive = false
let contentMetadata = ConvivaContentMetadata(
assetName: "<ASSET_NAME>",
live: isLive,
// defaultBitrateKbps: defaultBitrateKbps,
// defaultResource: "<DEFAULT_RESOURCE>",
// duration: duration,
// encodedFrameRate: encodedFrameRate,
// applicationName: "<APPLICATION_NAME>",
viewerId: "<VIEWER_ID>"
// , custom: [:]
)
let convivaConfiguration = ConvivaConfiguration(
customerKey: "876a2328cc34e791190d855daf389567c96d1e86",
// heartbeatInterval: heartbeatInterval,
gatewayURL: "https://theoplayer-test.testonly.conviva.com",
contentMetadata: contentMetadata
// , manualSessionControl: isManualSessionControl
)
let sourceDescription = SourceDescription(
source: TypedSource(
src: "https://cdn.theoplayer.com/video/elephants-dream/playlist.m3u8",
type: "application/x-mpegurl"
),
analytics: [convivaConfiguration]
)
The pre-integration inside the SDK has limited support for Video Anaytics Product only offered by Conviva. It is also not tested with every version of the conviva library released and thus could be broken with future releases. (Support only validated for library stated in the documentation)