Bläddra i källkod

Prepare for webpack 2

Webpack 2 defines module.exports as a read-only property in ES6 modules.
dev1
Lyubo Marinov 8 år sedan
förälder
incheckning
45a5f64326

+ 8
- 9
JitsiMeetJS.js Visa fil

85
 }
85
 }
86
 
86
 
87
 /**
87
 /**
88
- * Namespace for the interface of Jitsi Meet Library.
88
+ * The public API of the Jitsi Meet library (a.k.a. JitsiMeetJS).
89
  */
89
  */
90
-const LibJitsiMeet = {
90
+export default {
91
 
91
 
92
     version: '{#COMMIT_HASH#}',
92
     version: '{#COMMIT_HASH#}',
93
 
93
 
308
                     if (newResolution !== null) {
308
                     if (newResolution !== null) {
309
                         options.resolution = newResolution;
309
                         options.resolution = newResolution;
310
 
310
 
311
-                        logger.debug('Retry createLocalTracks with resolution',
311
+                        logger.debug(
312
+                            'Retry createLocalTracks with resolution',
312
                             newResolution);
313
                             newResolution);
313
 
314
 
314
                         Statistics.analytics.sendEvent(
315
                         Statistics.analytics.sendEvent(
315
                             `getUserMedia.fail.resolution.${oldResolution}`);
316
                             `getUserMedia.fail.resolution.${oldResolution}`);
316
 
317
 
317
-                        return LibJitsiMeet.createLocalTracks(options);
318
+                        return this.createLocalTracks(options);
318
                     }
319
                     }
319
                 }
320
                 }
320
 
321
 
453
 
454
 
454
     /**
455
     /**
455
      * Represents a hub/namespace for utility functionality which may be of
456
      * Represents a hub/namespace for utility functionality which may be of
456
-     * interest to LibJitsiMeet clients.
457
+     * interest to lib-jitsi-meet clients.
457
      */
458
      */
458
     util: {
459
     util: {
459
-        ScriptUtil,
460
+        AuthUtil,
460
         RTCUIHelper,
461
         RTCUIHelper,
461
-        AuthUtil
462
+        ScriptUtil
462
     }
463
     }
463
 };
464
 };
464
-
465
-module.exports = LibJitsiMeet;

+ 3
- 0
index.js Visa fil

1
+// For legacy purposes, preserve the UMD of the public API of the Jitsi Meet
2
+// library (a.k.a. JitsiMeetJS).
3
+module.exports = require('./JitsiMeetJS').default;

+ 2
- 2
karma.conf.js Visa fil

15
 
15
 
16
     // list of files / patterns to load in the browser
16
     // list of files / patterns to load in the browser
17
         files: [
17
         files: [
18
-            './JitsiMeetJS.js',
18
+            './index.js',
19
             './modules/**/*.spec.js'
19
             './modules/**/*.spec.js'
20
         ],
20
         ],
21
 
21
 
29
     // available preprocessors:
29
     // available preprocessors:
30
     //  https://npmjs.org/browse/keyword/karma-preprocessor
30
     //  https://npmjs.org/browse/keyword/karma-preprocessor
31
         preprocessors: {
31
         preprocessors: {
32
-            './JitsiMeetJS.js': [ 'webpack' ],
32
+            './index.js': [ 'webpack' ],
33
             './**/*.spec.js': [ 'webpack' ]
33
             './**/*.spec.js': [ 'webpack' ]
34
         },
34
         },
35
 
35
 

+ 8
- 9
modules/statistics/RTPStatsCollector.js Visa fil

10
         || RTCBrowserType.isNWJS() || RTCBrowserType.isElectron();
10
         || RTCBrowserType.isNWJS() || RTCBrowserType.isElectron();
11
 
11
 
12
 /**
12
 /**
13
- * The LibJitsiMeet browser-agnostic names of the browser-specific keys reported
14
- * by RTCPeerConnection#getStats mapped by RTCBrowserType.
13
+ * The lib-jitsi-meet browser-agnostic names of the browser-specific keys
14
+ * reported by RTCPeerConnection#getStats mapped by RTCBrowserType.
15
  */
15
  */
16
 const KEYS_BY_BROWSER_TYPE = {};
16
 const KEYS_BY_BROWSER_TYPE = {};
17
 
17
 
207
 
207
 
208
     /**
208
     /**
209
      * The function which is to be used to retrieve the value associated in a
209
      * The function which is to be used to retrieve the value associated in a
210
-     * report returned by RTCPeerConnection#getStats with a LibJitsiMeet
210
+     * report returned by RTCPeerConnection#getStats with a lib-jitsi-meet
211
      * browser-agnostic name/key.
211
      * browser-agnostic name/key.
212
+     *
212
      * @function
213
      * @function
213
      * @private
214
      * @private
214
      */
215
      */
329
 /**
330
 /**
330
  * Defines a function which (1) is to be used as a StatsCollector method and (2)
331
  * Defines a function which (1) is to be used as a StatsCollector method and (2)
331
  * gets the value from a specific report returned by RTCPeerConnection#getStats
332
  * gets the value from a specific report returned by RTCPeerConnection#getStats
332
- * associated with a LibJitsiMeet browser-agnostic name.
333
+ * associated with a lib-jitsi-meet browser-agnostic name.
333
  *
334
  *
334
  * @param {Object.<string,string>} keys the map of LibJitsi browser-agnostic
335
  * @param {Object.<string,string>} keys the map of LibJitsi browser-agnostic
335
  * names to RTCPeerConnection#getStats browser-specific keys
336
  * names to RTCPeerConnection#getStats browser-specific keys
336
  */
337
  */
337
 StatsCollector.prototype._defineGetStatValueMethod = function(keys) {
338
 StatsCollector.prototype._defineGetStatValueMethod = function(keys) {
338
-    // Define the function which converts a LibJitsiMeet browser-asnostic name
339
+    // Define the function which converts a lib-jitsi-meet browser-asnostic name
339
     // to a browser-specific key of a report returned by
340
     // to a browser-specific key of a report returned by
340
     // RTCPeerConnection#getStats.
341
     // RTCPeerConnection#getStats.
341
     const keyFromName = function(name) {
342
     const keyFromName = function(name) {
395
 
396
 
396
     // Compose the 2 functions defined above to get a function which retrieves
397
     // Compose the 2 functions defined above to get a function which retrieves
397
     // the value from a specific report returned by RTCPeerConnection#getStats
398
     // the value from a specific report returned by RTCPeerConnection#getStats
398
-    // associated with a specific LibJitsiMeet browser-agnostic name.
399
-    return function(item, name) {
400
-        return itemStatByKey(item, keyFromName(name));
401
-    };
399
+    // associated with a specific lib-jitsi-meet browser-agnostic name.
400
+    return (item, name) => itemStatByKey(item, keyFromName(name));
402
 };
401
 };
403
 
402
 
404
 /* eslint-disable no-continue */
403
 /* eslint-disable no-continue */

+ 1
- 3
modules/version/ComponentsVersions.js Visa fil

28
  *        listen for focus presence updates.
28
  *        listen for focus presence updates.
29
  * @constructor
29
  * @constructor
30
  */
30
  */
31
-function ComponentsVersions(conference) {
31
+export default function ComponentsVersions(conference) {
32
 
32
 
33
     this.versions = {};
33
     this.versions = {};
34
 
34
 
99
 ComponentsVersions.prototype.getComponentVersion = function(componentName) {
99
 ComponentsVersions.prototype.getComponentVersion = function(componentName) {
100
     return this.versions[componentName];
100
     return this.versions[componentName];
101
 };
101
 };
102
-
103
-module.exports = ComponentsVersions;

+ 1
- 3
modules/xmpp/SDP.js Visa fil

6
  *
6
  *
7
  * @param sdp
7
  * @param sdp
8
  */
8
  */
9
-function SDP(sdp) {
9
+export default function SDP(sdp) {
10
     const media = sdp.split('\r\nm=');
10
     const media = sdp.split('\r\nm=');
11
 
11
 
12
     for (let i = 1, length = media.length; i < length; i++) {
12
     for (let i = 1, length = media.length; i < length; i++) {
852
 
852
 
853
     return media;
853
     return media;
854
 };
854
 };
855
-
856
-module.exports = SDP;

+ 1
- 3
modules/xmpp/SDPDiffer.js Visa fil

39
  * @param mySDP
39
  * @param mySDP
40
  * @param otherSDP
40
  * @param otherSDP
41
  */
41
  */
42
-function SDPDiffer(mySDP, otherSDP) {
42
+export default function SDPDiffer(mySDP, otherSDP) {
43
     this.mySDP = mySDP;
43
     this.mySDP = mySDP;
44
     this.otherSDP = otherSDP;
44
     this.otherSDP = otherSDP;
45
 }
45
 }
190
 
190
 
191
     return modified;
191
     return modified;
192
 };
192
 };
193
-
194
-module.exports = SDPDiffer;

+ 1
- 1
package.json Visa fil

57
   "pre-commit": [
57
   "pre-commit": [
58
     "lint"
58
     "lint"
59
   ],
59
   ],
60
-  "main": "./JitsiMeetJS.js",
60
+  "main": "./index.js",
61
   "license": "Apache-2.0"
61
   "license": "Apache-2.0"
62
 }
62
 }

+ 1
- 1
webpack.config.js Visa fil

31
 module.exports = {
31
 module.exports = {
32
     devtool: 'source-map',
32
     devtool: 'source-map',
33
     entry: {
33
     entry: {
34
-        'lib-jitsi-meet': './JitsiMeetJS.js'
34
+        'lib-jitsi-meet': './index.js'
35
     },
35
     },
36
     module: {
36
     module: {
37
         loaders: [ {
37
         loaders: [ {

Laddar…
Avbryt
Spara