Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 2051a5a

Browse files
committed
Fix trivial ESLint warnings (spacing, unused variables)
Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
1 parent 5d704a0 commit 2051a5a

File tree

11 files changed

+47
-53
lines changed

11 files changed

+47
-53
lines changed

src/sdk/base/logger.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
// This file is borrowed from lynckia/licode with some modifications.
2828

29-
/* global console,window */
29+
/* global window */
3030

3131
'use strict';
3232

src/sdk/base/mediastream-factory.js

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
//
33
// SPDX-License-Identifier: Apache-2.0
44

5-
/* global console, window, Promise, chrome, navigator */
5+
/* global Promise, navigator */
66

77
'use strict';
88
import * as utils from './utils.js';
9-
import Logger from './logger.js';
109
import * as MediaFormatModule from './mediaformat.js';
1110

1211
/**
@@ -52,7 +51,7 @@ export class VideoTrackConstraints {
5251
// eslint-disable-next-line require-jsdoc
5352
constructor(source) {
5453
if (!Object.values(MediaFormatModule.VideoSourceInfo)
55-
.some((v) => v === source)) {
54+
.some((v) => v === source)) {
5655
throw new TypeError('Invalid source.');
5756
}
5857
/**
@@ -130,7 +129,7 @@ export class MediaStreamFactory {
130129
* @static
131130
* @desc Create a MediaStream with given constraints. If you want to create a MediaStream for screen cast, please make sure both audio and video's source are "screen-cast".
132131
* @memberof Owt.Base.MediaStreamFactory
133-
* @returns {Promise<MediaStream, Error>} Return a promise that is resolved when stream is successfully created, or rejected if one of the following error happened:
132+
* @return {Promise<MediaStream, Error>} Return a promise that is resolved when stream is successfully created, or rejected if one of the following error happened:
134133
* - One or more parameters cannot be satisfied.
135134
* - Specified device is busy.
136135
* - Cannot obtain necessary permission or operation is canceled by user.
@@ -167,7 +166,7 @@ export class MediaStreamFactory {
167166
// Check and convert constraints.
168167
if (!constraints.audio && !constraints.video) {
169168
return Promise.reject(new TypeError(
170-
'At least one of audio and video must be requested.'));
169+
'At least one of audio and video must be requested.'));
171170
}
172171
const mediaConstraints = Object.create({});
173172
if (typeof constraints.audio === 'object' &&
@@ -181,7 +180,8 @@ export class MediaStreamFactory {
181180
};
182181
}
183182
} else {
184-
if (constraints.audio.source === MediaFormatModule.AudioSourceInfo.SCREENCAST) {
183+
if (constraints.audio.source ===
184+
MediaFormatModule.AudioSourceInfo.SCREENCAST) {
185185
mediaConstraints.audio = true;
186186
} else {
187187
mediaConstraints.audio = constraints.audio;
@@ -195,24 +195,21 @@ export class MediaStreamFactory {
195195
if (constraints.video.resolution &&
196196
constraints.video.resolution.width &&
197197
constraints.video.resolution.height) {
198-
if (constraints.video.source ===
198+
if (constraints.video.source ===
199199
MediaFormatModule.VideoSourceInfo.SCREENCAST) {
200-
mediaConstraints.video.width =
201-
constraints.video.resolution.width;
202-
mediaConstraints.video.height =
203-
constraints.video.resolution.height;
204-
} else {
205-
mediaConstraints.video.width = Object.create({});
206-
mediaConstraints.video.width.exact =
207-
constraints.video.resolution.width;
208-
mediaConstraints.video.height = Object.create({});
209-
mediaConstraints.video.height.exact =
210-
constraints.video.resolution.height;
211-
212-
}
200+
mediaConstraints.video.width = constraints.video.resolution.width;
201+
mediaConstraints.video.height = constraints.video.resolution.height;
202+
} else {
203+
mediaConstraints.video.width = Object.create({});
204+
mediaConstraints.video.width.exact =
205+
constraints.video.resolution.width;
206+
mediaConstraints.video.height = Object.create({});
207+
mediaConstraints.video.height.exact =
208+
constraints.video.resolution.height;
209+
}
213210
}
214211
if (typeof constraints.video.deviceId === 'string') {
215-
mediaConstraints.video.deviceId = { exact: constraints.video.deviceId };
212+
mediaConstraints.video.deviceId = {exact: constraints.video.deviceId};
216213
}
217214
if (utils.isFirefox() &&
218215
constraints.video.source ===

src/sdk/base/publication.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
'use strict';
66

77
import * as Utils from './utils.js';
8-
import * as MediaFormat from './mediaformat.js';
98
import {EventDispatcher} from '../base/event.js';
109

1110
/**

src/sdk/base/stream.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
'use strict';
6-
import Logger from './logger.js'
7-
import {OwtEvent} from './event.js'
8-
import * as Utils from './utils.js'
9-
import { EventDispatcher} from './event.js';
6+
import {OwtEvent} from './event.js';
7+
import * as Utils from './utils.js';
8+
import {EventDispatcher} from './event.js';
109

1110
// eslint-disable-next-line require-jsdoc
1211
function isAllowedValue(obj, allowedValues) {

src/sdk/base/utils.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ export function sysInfo() {
4343
};
4444
// Runtime info.
4545
const userAgent = navigator.userAgent;
46-
const firefoxRegex = /Firefox\/([0-9\.]+)/;
47-
const chromeRegex = /Chrome\/([0-9\.]+)/;
48-
const edgeRegex = /Edge\/([0-9\.]+)/;
49-
const safariVersionRegex = /Version\/([0-9\.]+) Safari/;
46+
const firefoxRegex = /Firefox\/([0-9.]+)/;
47+
const chromeRegex = /Chrome\/([0-9.]+)/;
48+
const edgeRegex = /Edge\/([0-9.]+)/;
49+
const safariVersionRegex = /Version\/([0-9.]+) Safari/;
5050
let result = chromeRegex.exec(userAgent);
5151
if (result) {
5252
info.runtime = {
@@ -76,11 +76,11 @@ export function sysInfo() {
7676
};
7777
}
7878
// OS info.
79-
const windowsRegex = /Windows NT ([0-9\.]+)/;
80-
const macRegex = /Intel Mac OS X ([0-9_\.]+)/;
81-
const iPhoneRegex = /iPhone OS ([0-9_\.]+)/;
79+
const windowsRegex = /Windows NT ([0-9.]+)/;
80+
const macRegex = /Intel Mac OS X ([0-9_.]+)/;
81+
const iPhoneRegex = /iPhone OS ([0-9_.]+)/;
8282
const linuxRegex = /X11; Linux/;
83-
const androidRegex = /Android( ([0-9\.]+))?/;
83+
const androidRegex = /Android( ([0-9.]+))?/;
8484
const chromiumOsRegex = /CrOS/;
8585
if (result = windowsRegex.exec(userAgent)) {
8686
info.os = {

src/sdk/conference/channel.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ import {
1313
MessageEvent,
1414
OwtEvent,
1515
ErrorEvent,
16-
MuteEvent
16+
MuteEvent,
1717
} from '../base/event.js';
18-
import { TrackKind } from '../base/mediaformat.js'
19-
import { Publication } from '../base/publication.js';
20-
import { Subscription } from './subscription.js'
21-
import { ConferenceError } from './error.js'
18+
import {TrackKind} from '../base/mediaformat.js';
19+
import {Publication} from '../base/publication.js';
20+
import {Subscription} from './subscription.js';
21+
import {ConferenceError} from './error.js';
2222
import * as Utils from '../base/utils.js';
2323
import * as SdpUtils from '../base/sdputils.js';
2424

@@ -587,7 +587,7 @@ export class ConferencePeerConnectionChannel extends EventDispatcher {
587587
return this._handleError(errorMessage);
588588
}
589589

590-
_handleError(errorMessage){
590+
_handleError(errorMessage) {
591591
const error = new ConferenceError(errorMessage);
592592
const p = this._publishPromise || this._subscribePromise;
593593
if (p) {

src/sdk/conference/client.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ export const ConferenceClient = function(config, signalingImpl) {
329329
* @instance
330330
* @desc Join a conference.
331331
* @memberof Owt.Conference.ConferenceClient
332-
* @returns {Promise<ConferenceInfo, Error>} Return a promise resolved with current conference's information if successfully join the conference. Or return a promise rejected with a newly created Owt.Error if failed to join the conference.
332+
* @return {Promise<ConferenceInfo, Error>} Return a promise resolved with current conference's information if successfully join the conference. Or return a promise rejected with a newly created Owt.Error if failed to join the conference.
333333
* @param {string} tokenString Token is issued by conference server(nuve).
334334
*/
335335
this.join = function(tokenString) {
@@ -392,7 +392,7 @@ export const ConferenceClient = function(config, signalingImpl) {
392392
* @desc Publish a LocalStream to conference server. Other participants will be able to subscribe this stream when it is successfully published.
393393
* @param {Owt.Base.LocalStream} stream The stream to be published.
394394
* @param {Owt.Base.PublishOptions} options Options for publication.
395-
* @returns {Promise<Publication, Error>} Returned promise will be resolved with a newly created Publication once specific stream is successfully published, or rejected with a newly created Error if stream is invalid or options cannot be satisfied. Successfully published means PeerConnection is established and server is able to process media data.
395+
* @return {Promise<Publication, Error>} Returned promise will be resolved with a newly created Publication once specific stream is successfully published, or rejected with a newly created Error if stream is invalid or options cannot be satisfied. Successfully published means PeerConnection is established and server is able to process media data.
396396
*/
397397
this.publish = function(stream, options) {
398398
if (!(stream instanceof StreamModule.LocalStream)) {
@@ -413,7 +413,7 @@ export const ConferenceClient = function(config, signalingImpl) {
413413
* @desc Subscribe a RemoteStream from conference server.
414414
* @param {Owt.Base.RemoteStream} stream The stream to be subscribed.
415415
* @param {Owt.Conference.SubscribeOptions} options Options for subscription.
416-
* @returns {Promise<Subscription, Error>} Returned promise will be resolved with a newly created Subscription once specific stream is successfully subscribed, or rejected with a newly created Error if stream is invalid or options cannot be satisfied. Successfully subscribed means PeerConnection is established and server was started to send media data.
416+
* @return {Promise<Subscription, Error>} Returned promise will be resolved with a newly created Subscription once specific stream is successfully subscribed, or rejected with a newly created Error if stream is invalid or options cannot be satisfied. Successfully subscribed means PeerConnection is established and server was started to send media data.
417417
*/
418418
this.subscribe = function(stream, options) {
419419
if (!(stream instanceof StreamModule.RemoteStream)) {

src/sdk/conference/signaling.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// SPDX-License-Identifier: Apache-2.0
44

5-
/* global io, Promise */
5+
/* global io, Promise, setTimeout, clearTimeout */
66
import Logger from '../base/logger.js';
77
import * as EventModule from '../base/event.js';
88
import {ConferenceError} from './error.js';

src/sdk/conference/subscription.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
'use strict';
66

7-
import * as MediaFormatModule from '../base/mediaformat.js';
8-
import * as CodecModule from '../base/codec.js';
97
import {EventDispatcher} from '../base/event.js';
108

119
/**

src/sdk/p2p/p2pclient.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
'use strict';
88
import Logger from '../base/logger.js';
99
import {EventDispatcher, OwtEvent} from '../base/event.js';
10-
import * as Utils from '../base/utils.js';
1110
import * as ErrorModule from './error.js';
1211
import P2PPeerConnectionChannel from './peerconnection-channel.js';
1312

0 commit comments

Comments
 (0)