buffer id
This commit is contained in:
parent
f538ab3670
commit
65d524dfdf
2 changed files with 4 additions and 6 deletions
|
@ -45,7 +45,7 @@ type Analytics = {
|
||||||
bufferDuration: number,
|
bufferDuration: number,
|
||||||
bitRate: number,
|
bitRate: number,
|
||||||
duration: number,
|
duration: number,
|
||||||
userIdHash: string,
|
userId: string,
|
||||||
playerPoweredBy: string,
|
playerPoweredBy: string,
|
||||||
readyState: number,
|
readyState: number,
|
||||||
}
|
}
|
||||||
|
@ -217,7 +217,7 @@ const analytics: Analytics = {
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
device: 'web',
|
device: 'web',
|
||||||
type: 'buffering',
|
type: 'buffering',
|
||||||
client: data.userIdHash,
|
client: data.userId,
|
||||||
data: {
|
data: {
|
||||||
url: claim.canonical_url,
|
url: claim.canonical_url,
|
||||||
position: data.timeAtBuffer,
|
position: data.timeAtBuffer,
|
||||||
|
|
|
@ -55,8 +55,6 @@ import analytics, { SHARE_INTERNAL } from 'analytics';
|
||||||
import { doSignOutCleanup } from 'util/saved-passwords';
|
import { doSignOutCleanup } from 'util/saved-passwords';
|
||||||
import { doSocketConnect } from 'redux/actions/websocket';
|
import { doSocketConnect } from 'redux/actions/websocket';
|
||||||
import { stringifyServerParam, shouldSetSetting } from 'util/sync-settings';
|
import { stringifyServerParam, shouldSetSetting } from 'util/sync-settings';
|
||||||
import sha256 from 'crypto-js/sha256';
|
|
||||||
import Base64 from 'crypto-js/enc-base64';
|
|
||||||
|
|
||||||
// @if TARGET='app'
|
// @if TARGET='app'
|
||||||
const { autoUpdater } = remote.require('electron-updater');
|
const { autoUpdater } = remote.require('electron-updater');
|
||||||
|
@ -502,13 +500,13 @@ export function doAnalyticsBuffer(uri, bufferData) {
|
||||||
const fileSize = source.size; // size in bytes
|
const fileSize = source.size; // size in bytes
|
||||||
const fileSizeInBits = fileSize * 8;
|
const fileSizeInBits = fileSize * 8;
|
||||||
const bitRate = parseInt(fileSizeInBits / fileDurationInSeconds);
|
const bitRate = parseInt(fileSizeInBits / fileDurationInSeconds);
|
||||||
const userIdHash = Base64.stringify(sha256(user.id));
|
const userId = user.id;
|
||||||
|
|
||||||
analytics.videoBufferEvent(claim, {
|
analytics.videoBufferEvent(claim, {
|
||||||
timeAtBuffer,
|
timeAtBuffer,
|
||||||
bufferDuration,
|
bufferDuration,
|
||||||
bitRate,
|
bitRate,
|
||||||
userIdHash,
|
userId,
|
||||||
duration: fileDurationInSeconds,
|
duration: fileDurationInSeconds,
|
||||||
playerPoweredBy: bufferData.playerPoweredBy,
|
playerPoweredBy: bufferData.playerPoweredBy,
|
||||||
readyState: bufferData.readyState,
|
readyState: bufferData.readyState,
|
||||||
|
|
Loading…
Add table
Reference in a new issue