Skip to content

Commit

Permalink
Update version of the player schema used in the media plugin to 2-0-0 (
Browse files Browse the repository at this point in the history
…close #1222)
  • Loading branch information
matus-tomlein committed Aug 7, 2023
1 parent f9e5845 commit bca3dde
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions plugins/browser-plugin-media/src/schemata.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { MediaEventType } from './types';

const MEDIA_SCHEMA_PREFIX = 'iglu:com.snowplowanalytics.snowplow.media/';
const MEDIA_SCHEMA_SUFFIX = '/jsonschema/1-0-0';
export const MEDIA_PLAYER_SCHEMA = MEDIA_SCHEMA_PREFIX + 'player' + MEDIA_SCHEMA_SUFFIX;
export const MEDIA_SESSION_SCHEMA = MEDIA_SCHEMA_PREFIX + 'session' + MEDIA_SCHEMA_SUFFIX;
export const MEDIA_AD_SCHEMA = MEDIA_SCHEMA_PREFIX + 'ad' + MEDIA_SCHEMA_SUFFIX;
export const MEDIA_AD_BREAK_SCHEMA = MEDIA_SCHEMA_PREFIX + 'ad_break' + MEDIA_SCHEMA_SUFFIX;
const MEDIA_SCHEMA_SUFFIX_V1 = '/jsonschema/1-0-0';
const MEDIA_SCHEMA_SUFFIX_V2 = '/jsonschema/2-0-0';
export const MEDIA_PLAYER_SCHEMA = MEDIA_SCHEMA_PREFIX + 'player' + MEDIA_SCHEMA_SUFFIX_V2;
export const MEDIA_SESSION_SCHEMA = MEDIA_SCHEMA_PREFIX + 'session' + MEDIA_SCHEMA_SUFFIX_V1;
export const MEDIA_AD_SCHEMA = MEDIA_SCHEMA_PREFIX + 'ad' + MEDIA_SCHEMA_SUFFIX_V1;
export const MEDIA_AD_BREAK_SCHEMA = MEDIA_SCHEMA_PREFIX + 'ad_break' + MEDIA_SCHEMA_SUFFIX_V1;

function eventNameForEventType(eventType: MediaEventType): string {
/// ad first quartile, midpoint, and third quartile events share the same schema
Expand All @@ -23,5 +24,5 @@ function eventNameForEventType(eventType: MediaEventType): string {

export function getMediaEventSchema(eventType: MediaEventType): string {
const eventName = eventNameForEventType(eventType);
return MEDIA_SCHEMA_PREFIX + eventName + '_event' + MEDIA_SCHEMA_SUFFIX;
return MEDIA_SCHEMA_PREFIX + eventName + '_event' + MEDIA_SCHEMA_SUFFIX_V1;
}

0 comments on commit bca3dde

Please sign in to comment.