Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@snowplow/browser-plugin-media-tracking",
"comment": "Add a default 0 value for start and end in the media_element entity time ranges",
"type": "none"
}
],
"packageName": "@snowplow/browser-plugin-media-tracking"
}
2 changes: 1 addition & 1 deletion common/config/rush/version-policies.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
*
* Valid values are: "prerelease", "release", "minor", "patch", "major"
*/
"nextBump": "minor"
"nextBump": "patch"
}
]
6 changes: 5 additions & 1 deletion plugins/browser-plugin-media-tracking/src/helperFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ type TimeRange = { start: number; end: number };
export function timeRangesToObjectArray(t: TimeRanges): TimeRange[] {
const out: TimeRange[] = [];
for (let i = 0; i < t.length; i++) {
out.push({ start: t.start(i), end: t.end(i) });
const start = t.start(i);
const end = t.end(i);
if (isFinite(start) && isFinite(end)) {
out.push({ start: start || 0, end: end || 0 });
}
}
return out;
}
Expand Down
Loading