Skip to content

Commit 820ff44

Browse files
committed
Fix initialization of the HTML5 media tracking plugin so that it initializes the parent media plugin (#1369)
1 parent cdbaf50 commit 820ff44

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@snowplow/browser-plugin-media-tracking",
5+
"comment": "Fix initialization of the HTML5 media tracking plugin so that it initializes the parent media plugin (#1369)",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@snowplow/browser-plugin-media-tracking"
10+
}

plugins/browser-plugin-media-tracking/src/api.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Logger } from '@snowplow/tracker-core';
2-
import { BrowserPlugin, BrowserTracker } from '@snowplow/browser-tracker-core';
2+
import { BrowserPlugin } from '@snowplow/browser-tracker-core';
33
import { waitForElement } from './findElem';
44
import { Config, isElementConfig, isStringConfig } from './config';
55
import { setUpListeners } from './player';
@@ -14,16 +14,13 @@ import { HTML5MediaEventTypes } from './config';
1414
// @ts-ignore: TS6133
1515
import { FilterOutRepeatedEvents } from '@snowplow/browser-plugin-media/src/types';
1616

17-
import { endMediaTracking } from '@snowplow/browser-plugin-media';
17+
import { endMediaTracking, SnowplowMediaPlugin } from '@snowplow/browser-plugin-media';
1818

1919
let LOG: Logger;
20-
const _trackers: Record<string, BrowserTracker> = {};
2120

2221
export function MediaTrackingPlugin(): BrowserPlugin {
2322
return {
24-
activateBrowserPlugin: (tracker: BrowserTracker) => {
25-
_trackers[tracker.id] = tracker;
26-
},
23+
...SnowplowMediaPlugin(),
2724
logger: (logger) => {
2825
LOG = logger;
2926
},

0 commit comments

Comments
 (0)