Procházet zdrojové kódy

Remove unused connectionquality module

master
yanas před 9 roky
rodič
revize
ddb597357d
2 změnil soubory, kde provedl 0 přidání a 158 odebrání
  1. 0
    1
      .jshintignore
  2. 0
    157
      modules/connectionquality/connectionquality.js

+ 0
- 1
.jshintignore Zobrazit soubor

@@ -18,7 +18,6 @@ modules/xmpp/ChatRoom.js
18 18
 modules/xmpp/ChatRoom.js
19 19
 modules/statistics/RTPStatsCollector.js
20 20
 modules/statistics/LocalStatsCollector.js
21
-modules/connectionquality/connectionquality.js
22 21
 modules/RTC/adapter.screenshare.js
23 22
 modules/statistics/statistics.js
24 23
 modules/RTC/RTC.js

+ 0
- 157
modules/connectionquality/connectionquality.js Zobrazit soubor

@@ -1,157 +0,0 @@
1
-/* global APP, require */
2
-var EventEmitter = require("events");
3
-var eventEmitter = new EventEmitter();
4
-var CQEvents = require("../../service/connectionquality/CQEvents");
5
-var XMPPEvents = require("../../service/xmpp/XMPPEvents");
6
-var StatisticsEvents = require("../../service/statistics/Events");
7
-
8
-/**
9
- * local stats
10
- * @type {{}}
11
- */
12
-var stats = {};
13
-
14
-/**
15
- * remote stats
16
- * @type {{}}
17
- */
18
-var remoteStats = {};
19
-
20
-/**
21
- * Interval for sending statistics to other participants
22
- * @type {null}
23
- */
24
-var sendIntervalId = null;
25
-
26
-
27
-/**
28
- * Start statistics sending.
29
- */
30
-function startSendingStats() {
31
-    sendStats();
32
-    sendIntervalId = setInterval(sendStats, 10000);
33
-}
34
-
35
-/**
36
- * Sends statistics to other participants
37
- */
38
-function sendStats() {
39
-    APP.xmpp.addToPresence("stats", convertToMUCStats(stats));
40
-}
41
-
42
-/**
43
- * Converts statistics to format for sending through XMPP
44
- * @param stats the statistics
45
- * @returns {{bitrate_donwload: *, bitrate_uplpoad: *, packetLoss_total: *, packetLoss_download: *, packetLoss_upload: *}}
46
- */
47
-function convertToMUCStats(stats) {
48
-    return {
49
-        tagName: "stats",
50
-        attributes: {
51
-            xmlns: 'http://jitsi.org/jitmeet/stats'
52
-        },
53
-        children: [
54
-            {
55
-                tagName: "stat",
56
-                attributes: {name: "bitrate_download", value: stats.bitrate.download}
57
-            },
58
-            {
59
-                tagName: "stat",
60
-                attributes: {name: "bitrate_upload", value: stats.bitrate.upload}
61
-            },
62
-            {
63
-                tagName: "stat",
64
-                attributes: {name: "packetLoss_total", value: stats.packetLoss.total}
65
-            },
66
-            {
67
-                tagName: "stat",
68
-                attributes: {name: "packetLoss_download", value: stats.packetLoss.download}
69
-            },
70
-            {
71
-                tagName: "stat",
72
-                attributes: {name: "packetLoss_upload", value: stats.packetLoss.upload}
73
-            }
74
-        ]
75
-    };
76
-}
77
-
78
-/**
79
- * Converts statistics to format used by VideoLayout
80
- * @param stats
81
- * @returns {{bitrate: {download: *, upload: *}, packetLoss: {total: *, download: *, upload: *}}}
82
- */
83
-function parseMUCStats(stats) {
84
-    return {
85
-        bitrate: {
86
-            download: stats.bitrate_download,
87
-            upload: stats.bitrate_upload
88
-        },
89
-        packetLoss: {
90
-            total: stats.packetLoss_total,
91
-            download: stats.packetLoss_download,
92
-            upload: stats.packetLoss_upload
93
-        }
94
-    };
95
-}
96
-
97
-var ConnectionQuality = {
98
-    init: function () {
99
-        APP.xmpp.addListener(XMPPEvents.REMOTE_STATS, this.updateRemoteStats);
100
-        APP.statistics.addListener(StatisticsEvents.CONNECTION_STATS,
101
-                                   this.updateLocalStats);
102
-        APP.statistics.addListener(StatisticsEvents.STOP,
103
-                                   this.stopSendingStats);
104
-    },
105
-
106
-    /**
107
-     * Updates the local statistics
108
-     * @param data new statistics
109
-     */
110
-    updateLocalStats: function (data) {
111
-        stats = data;
112
-        eventEmitter.emit(CQEvents.LOCALSTATS_UPDATED, 100 - stats.packetLoss.total, stats);
113
-        if (!sendIntervalId) {
114
-            startSendingStats();
115
-        }
116
-    },
117
-
118
-    /**
119
-     * Updates remote statistics
120
-     * @param jid the jid associated with the statistics
121
-     * @param data the statistics
122
-     */
123
-    updateRemoteStats: function (jid, data) {
124
-        if (!data || !data.packetLoss_total) {
125
-            eventEmitter.emit(CQEvents.REMOTESTATS_UPDATED, jid, null, null);
126
-            return;
127
-        }
128
-        remoteStats[jid] = parseMUCStats(data);
129
-
130
-        eventEmitter.emit(CQEvents.REMOTESTATS_UPDATED,
131
-            jid, 100 - data.packetLoss_total, remoteStats[jid]);
132
-    },
133
-
134
-    /**
135
-     * Stops statistics sending.
136
-     */
137
-    stopSendingStats: function () {
138
-        clearInterval(sendIntervalId);
139
-        sendIntervalId = null;
140
-        //notify UI about stopping statistics gathering
141
-        eventEmitter.emit(CQEvents.STOP);
142
-    },
143
-
144
-    /**
145
-     * Returns the local statistics.
146
-     */
147
-    getStats: function () {
148
-        return stats;
149
-    },
150
-    
151
-    addListener: function (type, listener) {
152
-        eventEmitter.on(type, listener);
153
-    }
154
-
155
-};
156
-
157
-module.exports = ConnectionQuality;

Načítá se…
Zrušit
Uložit