forked from snowplow/snowplow-javascript-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheventGroups.ts
More file actions
29 lines (25 loc) · 814 Bytes
/
Copy patheventGroups.ts
File metadata and controls
29 lines (25 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { EventGroup } from './types';
import { DocumentEvent, MediaEvent, SnowplowEvent, TextTrackEvent, VideoEvent } from './mediaEvents';
const enumValues = (enumType: any) => Object.keys(enumType).map((key) => enumType[key]);
export const AllEvents: EventGroup = [
...enumValues(MediaEvent),
...enumValues(SnowplowEvent),
...enumValues(VideoEvent),
...enumValues(TextTrackEvent),
...enumValues(DocumentEvent),
];
export const DefaultEvents: EventGroup = [
SnowplowEvent.READY,
MediaEvent.PAUSE,
MediaEvent.PLAY,
MediaEvent.SEEKED,
MediaEvent.RATECHANGE,
MediaEvent.VOLUMECHANGE,
MediaEvent.ENDED,
DocumentEvent.FULLSCREENCHANGE,
SnowplowEvent.PERCENTPROGRESS,
];
export const EventGroups: Record<string, EventGroup> = {
AllEvents: AllEvents,
DefaultEvents: DefaultEvents,
};