# ByteArk Lighthouse
ByteArk Player integrates with ByteArk Lighthouse (opens new window) to send playback analytics.
# Enable
Enable Lighthouse via the bytearkLighthouse plugin in options:
var player = bytearkPlayer('video-player', {
fluid: true,
plugins: {
bytearkLighthouse: {
projectId: '<LIGHTHOUSE_PROJECT_ID>',
}
},
sources: [{
title: 'Big Buck Bunny',
videoId: '<VIDEO_ID>',
src: '<MEDIA_URL>',
type: 'application/x-mpegURL'
}]
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
# Options
| Name | Type | Required | Description |
|---|---|---|---|
| projectId | String | Yes | Lighthouse Project ID (contact ByteArk to obtain) |
| lighthouseUrl | String | No | URL of a self-hosted Lighthouse server |
Note
The Source Object must include both title and videoId for Lighthouse tracking to work.
# Metadata that ByteArk Lighthouse supports
Each source can include extra Lighthouse metadata via the lighthouse field:
sources: [{
title: 'Big Buck Bunny',
videoId: '<VIDEO_ID>',
src: '<MEDIA_URL>',
type: 'application/x-mpegURL',
lighthouse: {
video: {
videoTitle: 'Big Buck Bunny',
genres: ['animation', 'short'],
duration: 596,
},
user: {
userId: '<USER_ID>',
country: 'TH',
city: 'Bangkok',
gender: 'male',
// ... other user fields
},
},
}]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Video metadata
| Field | Type | Description |
|---|---|---|
| videoTitle | String | Video title |
| genres | Array | Genres of the video |
| duration | Number | Duration in seconds |
# User metadata
| Field | Type | Description |
|---|---|---|
| user | object | User metadata object |
| user.userId | String | User ID |
| user.age | String | User age |
| user.country | String | User country |
| user.city | String | User city or province |
| user.lat | String | User latitude |
| user.long | String | User longitude |
| user.gender | String | User gender |
| user.nationality | String | User nationality |
| user.subscriptionPlan | String | Subscription plan |
| user.accountCreationDate | String | Account creation date |