Browse Source

Coding style: sorting, formatting, consistency

dev1
Lyubo Marinov 7 years ago
parent
commit
21b07deabc
1 changed files with 28 additions and 17 deletions
  1. 28
    17
      modules/RTC/JitsiLocalTrack.js

+ 28
- 17
modules/RTC/JitsiLocalTrack.js View File

1
 /* global __filename, Promise */
1
 /* global __filename, Promise */
2
 
2
 
3
-import {
4
-    _NO_DATA_FROM_SOURCE,
5
-    _TRACK_UNMUTE
6
-} from '../../service/statistics/AnalyticsEvents';
7
-import CameraFacingMode from '../../service/RTC/CameraFacingMode';
8
 import { getLogger } from 'jitsi-meet-logger';
3
 import { getLogger } from 'jitsi-meet-logger';
9
 import JitsiTrack from './JitsiTrack';
4
 import JitsiTrack from './JitsiTrack';
10
 import JitsiTrackError from '../../JitsiTrackError';
5
 import JitsiTrackError from '../../JitsiTrackError';
17
     NO_DATA_FROM_SOURCE,
12
     NO_DATA_FROM_SOURCE,
18
     TRACK_MUTE_CHANGED
13
     TRACK_MUTE_CHANGED
19
 } from '../../JitsiTrackEvents';
14
 } from '../../JitsiTrackEvents';
20
-import * as MediaType from '../../service/RTC/MediaType';
21
 import RTCBrowserType from './RTCBrowserType';
15
 import RTCBrowserType from './RTCBrowserType';
22
-import RTCEvents from '../../service/RTC/RTCEvents';
23
 import RTCUtils from './RTCUtils';
16
 import RTCUtils from './RTCUtils';
24
-import Statistics from '../statistics/statistics';
17
+import CameraFacingMode from '../../service/RTC/CameraFacingMode';
18
+import * as MediaType from '../../service/RTC/MediaType';
19
+import RTCEvents from '../../service/RTC/RTCEvents';
25
 import VideoType from '../../service/RTC/VideoType';
20
 import VideoType from '../../service/RTC/VideoType';
21
+import {
22
+    _NO_DATA_FROM_SOURCE,
23
+    _TRACK_UNMUTE
24
+} from '../../service/statistics/AnalyticsEvents';
25
+import Statistics from '../statistics/statistics';
26
 
26
 
27
 const logger = getLogger(__filename);
27
 const logger = getLogger(__filename);
28
 
28
 
33
 export default class JitsiLocalTrack extends JitsiTrack {
33
 export default class JitsiLocalTrack extends JitsiTrack {
34
     /**
34
     /**
35
      * Constructs new JitsiLocalTrack instanse.
35
      * Constructs new JitsiLocalTrack instanse.
36
+     *
37
+     * @constructor
36
      * @param {Object} trackInfo
38
      * @param {Object} trackInfo
37
      * @param {number} trackInfo.rtcId the ID assigned by the RTC module
39
      * @param {number} trackInfo.rtcId the ID assigned by the RTC module
38
      * @param trackInfo.stream WebRTC MediaStream, parent of the track
40
      * @param trackInfo.stream WebRTC MediaStream, parent of the track
46
      * call
48
      * call
47
      * @param {sourceId} trackInfo.sourceId - The id of the desktop sharing
49
      * @param {sourceId} trackInfo.sourceId - The id of the desktop sharing
48
      * source. NOTE: defined for desktop sharing tracks only.
50
      * source. NOTE: defined for desktop sharing tracks only.
49
-     * @constructor
50
      */
51
      */
51
     constructor({
52
     constructor({
52
         deviceId,
53
         deviceId,
70
 
71
 
71
         /**
72
         /**
72
          * The ID assigned by the RTC module on instance creation.
73
          * The ID assigned by the RTC module on instance creation.
74
+         *
73
          * @type {number}
75
          * @type {number}
74
          */
76
          */
75
         this.rtcId = rtcId;
77
         this.rtcId = rtcId;
176
 
178
 
177
     /**
179
     /**
178
      * Returns if associated MediaStreamTrack is in the 'ended' state
180
      * Returns if associated MediaStreamTrack is in the 'ended' state
181
+     *
179
      * @returns {boolean}
182
      * @returns {boolean}
180
      */
183
      */
181
     isEnded() {
184
     isEnded() {
253
      * Sets real device ID by comparing track information with device
256
      * Sets real device ID by comparing track information with device
254
      * information. This is temporary solution until getConstraints() method
257
      * information. This is temporary solution until getConstraints() method
255
      * will be implemented in browsers.
258
      * will be implemented in browsers.
259
+     *
256
      * @param {MediaDeviceInfo[]} devices - list of devices obtained from
260
      * @param {MediaDeviceInfo[]} devices - list of devices obtained from
257
-     *  enumerateDevices() call
261
+     * enumerateDevices() call
258
      */
262
      */
259
     _setRealDeviceIdFromDeviceList(devices) {
263
     _setRealDeviceIdFromDeviceList(devices) {
260
         const track = this.getTrack();
264
         const track = this.getTrack();
392
                     = RTCUtils.obtainAudioAndVideoPermissions(streamOptions);
396
                     = RTCUtils.obtainAudioAndVideoPermissions(streamOptions);
393
             }
397
             }
394
 
398
 
395
-
396
             promise.then(streamsInfo => {
399
             promise.then(streamsInfo => {
397
                 const mediaType = this.getType();
400
                 const mediaType = this.getType();
398
                 const streamInfo
401
                 const streamInfo
459
 
462
 
460
     /**
463
     /**
461
      * Removes stream from conference and marks it as "mute" operation.
464
      * Removes stream from conference and marks it as "mute" operation.
465
+     *
462
      * @param {Function} successCallback will be called on success
466
      * @param {Function} successCallback will be called on success
463
      * @param {Function} errorCallback will be called on error
467
      * @param {Function} errorCallback will be called on error
464
      * @private
468
      * @private
527
     }
531
     }
528
 
532
 
529
     /**
533
     /**
530
-     * Returns <tt>true</tt> - if the stream is muted
531
-     * and <tt>false</tt> otherwise.
532
-     * @returns {boolean} <tt>true</tt> - if the stream is muted
533
-     * and <tt>false</tt> otherwise.
534
+     * Returns <tt>true</tt> - if the stream is muted and <tt>false</tt>
535
+     * otherwise.
536
+     *
537
+     * @returns {boolean} <tt>true</tt> - if the stream is muted and
538
+     * <tt>false</tt> otherwise.
534
      */
539
      */
535
     isMuted() {
540
     isMuted() {
536
         // this.stream will be null when we mute local video on Chrome
541
         // this.stream will be null when we mute local video on Chrome
542
         }
547
         }
543
 
548
 
544
         return !this.track || !this.track.enabled;
549
         return !this.track || !this.track.enabled;
545
-
546
     }
550
     }
547
 
551
 
548
     /**
552
     /**
549
      * Sets the JitsiConference object associated with the track. This is temp
553
      * Sets the JitsiConference object associated with the track. This is temp
550
      * solution.
554
      * solution.
555
+     *
551
      * @param conference the JitsiConference object
556
      * @param conference the JitsiConference object
552
      */
557
      */
553
     _setConference(conference) {
558
     _setConference(conference) {
564
 
569
 
565
     /**
570
     /**
566
      * Returns <tt>true</tt>.
571
      * Returns <tt>true</tt>.
572
+     *
567
      * @returns {boolean} <tt>true</tt>
573
      * @returns {boolean} <tt>true</tt>
568
      */
574
      */
569
     isLocal() {
575
     isLocal() {
572
 
578
 
573
     /**
579
     /**
574
      * Returns device id associated with track.
580
      * Returns device id associated with track.
581
+     *
575
      * @returns {string}
582
      * @returns {string}
576
      */
583
      */
577
     getDeviceId() {
584
     getDeviceId() {
580
 
587
 
581
     /**
588
     /**
582
      * Returns the participant id which owns the track.
589
      * Returns the participant id which owns the track.
590
+     *
583
      * @returns {string} the id of the participants. It corresponds to the
591
      * @returns {string} the id of the participants. It corresponds to the
584
      * Colibri endpoint id/MUC nickname in case of Jitsi-meet.
592
      * Colibri endpoint id/MUC nickname in case of Jitsi-meet.
585
      */
593
      */
589
 
597
 
590
     /**
598
     /**
591
      * Handles bytes sent statistics.
599
      * Handles bytes sent statistics.
600
+     *
592
      * @param {TraceablePeerConnection} tpc the source of the "bytes sent" stat
601
      * @param {TraceablePeerConnection} tpc the source of the "bytes sent" stat
593
      * @param {number} bytesSent the new value
602
      * @param {number} bytesSent the new value
594
      * NOTE: used only for audio tracks to detect audio issues.
603
      * NOTE: used only for audio tracks to detect audio issues.
704
 
713
 
705
     /**
714
     /**
706
      * Detects camera issues on ended and mute events from MediaStreamTrack.
715
      * Detects camera issues on ended and mute events from MediaStreamTrack.
716
+     *
707
      * @returns {boolean} true if an issue is detected and false otherwise
717
      * @returns {boolean} true if an issue is detected and false otherwise
708
      */
718
      */
709
     _checkForCameraIssues() {
719
     _checkForCameraIssues() {
723
      * NOTE: This method doesn't indicate problem with the streams directly.
733
      * NOTE: This method doesn't indicate problem with the streams directly.
724
      * For example in case of video mute the method will return false or if the
734
      * For example in case of video mute the method will return false or if the
725
      * user has disposed the track.
735
      * user has disposed the track.
736
+     *
726
      * @returns {boolean} true if the stream is receiving data and false
737
      * @returns {boolean} true if the stream is receiving data and false
727
      * this otherwise.
738
      * this otherwise.
728
      */
739
      */
745
 
756
 
746
     /**
757
     /**
747
      * Creates a text representation of this local track instance.
758
      * Creates a text representation of this local track instance.
759
+     *
748
      * @return {string}
760
      * @return {string}
749
      */
761
      */
750
     toString() {
762
     toString() {
751
         return `LocalTrack[${this.rtcId},${this.getType()}]`;
763
         return `LocalTrack[${this.rtcId},${this.getType()}]`;
752
     }
764
     }
753
-
754
 }
765
 }

Loading…
Cancel
Save