# ByteArk Lighthouse
ByteArk Player SDK for Android supports analytics through ByteArk Lighthouse (opens new window), configured via lighthouseSetting on ByteArkPlayerConfigBuilder.
# Configure
val lighthouseSetting = ByteArkPlayerFragment.createLighthouseSetting(
true, // enabled
"PROJECT_ID", // Lighthouse Project ID
true // debug
)
1
2
3
4
5
2
3
4
5
Or via builder:
val lighthouseSetting = ByteArkLighthouseSettingBuilder.Builder()
.withProjectId("PROJECT_ID")
.withLighthouseUrl("https://lighthouse.byteark.com") // optional, for self-hosted
.build()
1
2
3
4
2
3
4
| Builder method | Type | Description |
|---|---|---|
withProjectId(projectId: String) | String | Lighthouse Project ID (contact ByteArk to obtain) |
withLighthouseUrl(url: String?) | String | Self-hosted Lighthouse server URL |
# Send additional metadata
For each video, you can attach Lighthouse metadata through ByteArkPlayerItem:
val lighthouseMetaData = ByteArkLightHouseMetaData(
// ... fields
)
val playerItem = ByteArkPlayerItemBuilder.Builder()
.withMediaId("VIDEO_ID")
.withTitle("Big Buck Bunny")
.withUrl("https://example.com/playlist.m3u8")
.withByteArkLighthouseMetaData(lighthouseMetaData)
.build()
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
Note
Using Lighthouse always requires withMediaId(...) and withTitle(...) on ByteArkPlayerItem.
# Pass the setting to the player
mPlayerFragment = ByteArkPlayerFragment.createInstance(
playerBuilder,
mFragmentListener,
companionAdSlot,
nielsenSetting,
playbackSetting,
lighthouseSetting,
chromeCastSetting
)
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9