@folklore/tracking
Advanced tools
Comparing version 0.0.24 to 0.0.25
@@ -127,3 +127,4 @@ 'use strict'; | ||
currentTime = null, | ||
thumbnail = null | ||
thumbnail = null, | ||
...data | ||
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
@@ -141,3 +142,4 @@ this.pushEvent('eventInteraction', { | ||
videoProgress: currentTime !== null && duration !== null && duration > 0 ? Math.round(currentTime / duration * 100) : null, | ||
videoThumbnail: thumbnail | ||
videoThumbnail: thumbnail, | ||
...data | ||
}); | ||
@@ -280,4 +282,5 @@ } | ||
// ); | ||
tracking.trackVideo(`progress ${Math.round(step * 100, 10)}%`, getVideoMetadata({ | ||
currentTime | ||
tracking.trackVideo('progress', getVideoMetadata({ | ||
currentTime, | ||
videoProgress: Math.round(step * 100, 10) | ||
})); | ||
@@ -284,0 +287,0 @@ if (onProgress !== null) { |
@@ -118,3 +118,4 @@ import { v4 } from 'uuid'; | ||
currentTime = null, | ||
thumbnail = null | ||
thumbnail = null, | ||
...data | ||
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
@@ -132,3 +133,4 @@ this.pushEvent('eventInteraction', { | ||
videoProgress: currentTime !== null && duration !== null && duration > 0 ? Math.round(currentTime / duration * 100) : null, | ||
videoThumbnail: thumbnail | ||
videoThumbnail: thumbnail, | ||
...data | ||
}); | ||
@@ -271,4 +273,5 @@ } | ||
// ); | ||
tracking.trackVideo(`progress ${Math.round(step * 100, 10)}%`, getVideoMetadata({ | ||
currentTime | ||
tracking.trackVideo('progress', getVideoMetadata({ | ||
currentTime, | ||
videoProgress: Math.round(step * 100, 10) | ||
})); | ||
@@ -275,0 +278,0 @@ if (onProgress !== null) { |
{ | ||
"name": "@folklore/tracking", | ||
"version": "0.0.24", | ||
"version": "0.0.25", | ||
"description": "Tracking utilities", | ||
@@ -54,3 +54,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "df836ad45cb4ebccaa3f66a825c67719f35eddb3" | ||
"gitHead": "4c607d1f1a031278d3cf2249a84452a214af57b0" | ||
} |
18648
585