Skip to content
Snippets Groups Projects
Commit 11a93e18 authored by Lucas Fialho Zawacki's avatar Lucas Fialho Zawacki
Browse files

Add monotonic timestamp to Start/Stop share events

parent 36ab18f3
No related branches found
No related tags found
No related merge requests found
/*
*
*/
var inherits = require('inherits');
var OutMessage = require('../OutMessage');
var hrTime = require('../../../utils/Utils').hrTime;
module.exports = function (C) {
function StartWebcamShareEvent (meetingId, stream) {
StartWebcamShareEvent.super_.call(this, C.START_WEBCAM_SHARE);
let date = new Date();
let timestamp = hrTime();
this.payload = {};
this.payload[C.MODULE] = C.WEBCAM_MODULE;
this.payload[C.MEETING_ID] = meetingId;
this.payload[C.TIMESTAMP] = timestamp;
this.payload[C.DATE] = date;
this.payload[C.TIMESTAMP_UTC] = date.getTime() ;
this.payload[C.STREAM_URL] = stream;
};
inherits(StartWebcamShareEvent, OutMessage);
return StartWebcamShareEvent;
}
/*
*
*/
var inherits = require('inherits');
var OutMessage = require('../OutMessage');
var hrTime = require('../../../utils/Utils').hrTime;
module.exports = function (C) {
function StopWebcamShareEvent (meetingId, stream) {
StopWebcamShareEvent.super_.call(this, C.STOP_WEBCAM_SHARE);
let date = new Date();
let timestamp = hrTime();
this.payload = {};
this.payload[C.MODULE] = C.WEBCAM_MODULE;
this.payload[C.MEETING_ID] = meetingId;
this.payload[C.TIMESTAMP] = timestamp;
this.payload[C.DATE] = date;
this.payload[C.TIMESTAMP_UTC] = date.getTime() ;
this.payload[C.STREAM_URL] = stream;
this.payload[C.DURATION] = 0;
};
inherits(StopWebcamShareEvent, OutMessage);
return StopWebcamShareEvent;
}
/**
* * @classdesc
* * Utils class for bbb-webrtc-sfu
* * @constructor
* */
/*
* hrTime
* Gets monotonic system time in milliseconds
*/
exports.hrTime = function () {
let t = process.hrtime();
return t[0]*1000 + parseInt(t[1]/1000000);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment