UNPKG

@aller/blink

Version:

A library for tracking user behaviour.

32 lines 1.6 kB
"use strict"; var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var general_data_1 = __importDefault(require("../utils/general-data")); /** * Prepares video load data selecting the right * fields to send to the server * Video load event fired when video viewbox is loaded * on the page */ function prepareVideoLoadForSending(input) { var videoId = input.videoId, duration = input.duration, position = input.position, title = input.title, width = input.width, height = input.height, viewable = input.viewable, muted = input.muted, quality = input.quality, withAdBlock = input.withAdBlock; return __assign({}, general_data_1.default(input.page.state), { type: 'videoLoad', id: videoId, videoId: videoId, title: title, width: width, height: height, videoDuration: duration, videoPlayPosition: position, videoViewable: viewable, videoPlayMuted: muted, videoQuality: quality, withAdBlock: withAdBlock, time: input.time || new Date() }); } exports.default = prepareVideoLoadForSending; //# sourceMappingURL=prepare-video-load-event.js.map