Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(package.json) Replace 'module' field with 'export' in package.json #2090

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions modules/RTC/RTC.js
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,7 @@ export default class RTC extends Listenable {
* @returns {boolean}
*/
static isUserStreamById(streamId) {
return streamId && streamId !== 'mixedmslabel'
&& streamId !== 'default';
return RTCUtils.isUserStreamById(streamId);
}

/**
Expand Down
13 changes: 12 additions & 1 deletion modules/RTC/RTCUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ class RTCUtils extends Listenable {
/**
* Returns true if changing the input (camera / microphone) or output
* (audio) device is supported and false if not.
* @params {string} [deviceType] - type of device to change. Default is
* @param {string} [deviceType] - type of device to change. Default is
* undefined or 'input', 'output' - for audio output device change.
* @returns {boolean} true if available, false otherwise.
*/
Expand Down Expand Up @@ -846,6 +846,17 @@ class RTCUtils extends Listenable {

return { deviceList };
}


/**
* Returns boolean value indicating whether given stream ID
* indicates user stream or not
* @param {string} [streamId] - ID of a stream
* @returns {boolean}
*/
isUserStreamById(streamId) {
return streamId && streamId !== 'mixedmslabel' && streamId !== 'default';
}
}

const rtcUtils = new RTCUtils();
Expand Down
10 changes: 5 additions & 5 deletions modules/RTC/TraceablePeerConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { SdpTransformWrap } from '../sdp/SdpTransformUtil';
import * as GlobalOnErrorHandler from '../util/GlobalOnErrorHandler';

import JitsiRemoteTrack from './JitsiRemoteTrack';
import RTC from './RTC';
import RTCUtils from './RTCUtils';
import {
HD_BITRATE,
HD_SCALE_FACTOR,
Expand Down Expand Up @@ -819,7 +819,7 @@ TraceablePeerConnection.prototype.getSsrcByTrackId = function(id) {
TraceablePeerConnection.prototype._remoteStreamAdded = function(stream) {
const streamId = stream.id;

if (!RTC.isUserStreamById(streamId)) {
if (!RTCUtils.isUserStreamById(streamId)) {
logger.info(`${this} ignored remote 'stream added' event for non-user stream[id=${streamId}]`);

return;
Expand Down Expand Up @@ -864,7 +864,7 @@ TraceablePeerConnection.prototype._remoteTrackAdded = function(stream, track, tr
const streamId = stream.id;
const mediaType = track.kind;

if (!this.isP2P && !RTC.isUserStreamById(streamId)) {
if (!this.isP2P && !RTCUtils.isUserStreamById(streamId)) {
logger.info(`${this} ignored remote 'stream added' event for non-user stream[id=${streamId}]`);

return;
Expand Down Expand Up @@ -1059,7 +1059,7 @@ TraceablePeerConnection.prototype._createRemoteTrack = function(
* PeerConnection
*/
TraceablePeerConnection.prototype._remoteStreamRemoved = function(stream) {
if (!RTC.isUserStream(stream)) {
if (!RTCUtils.isUserStreamById(stream.id)) {
logger.info(`Ignored remote 'stream removed' event for stream[id=${stream.id}]`);

return;
Expand Down Expand Up @@ -1089,7 +1089,7 @@ TraceablePeerConnection.prototype._remoteTrackRemoved = function(stream, track)
const streamId = stream.id;
const trackId = track?.id;

if (!RTC.isUserStreamById(streamId)) {
if (!RTCUtils.isUserStreamById(streamId)) {
logger.info(`${this} ignored remote 'stream removed' event for non-user stream[id=${streamId}]`);

return;
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,11 @@
"validate": "npm ls",
"watch": "webpack --config webpack.config.js --watch --mode development"
},
"browser": "dist/umd/lib-jitsi-meet.min.js",
"module": "dist/esm/JitsiMeetJS.js",
"react-native": "./dist/esm/JitsiMeetJS.js",
"exports": {
"import": "./dist/esm/JitsiMeetJS.js",
"default": "./dist/umd/lib-jitsi-meet.min.js"
},
"files": [
"dist",
"types",
Expand Down
11 changes: 9 additions & 2 deletions types/auto/modules/RTC/RTCUtils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ declare class RTCUtils extends Listenable {
/**
* Returns true if changing the input (camera / microphone) or output
* (audio) device is supported and false if not.
* @params {string} [deviceType] - type of device to change. Default is
* @param {string} [deviceType] - type of device to change. Default is
* undefined or 'input', 'output' - for audio output device change.
* @returns {boolean} true if available, false otherwise.
*/
isDeviceChangeAvailable(deviceType: any): boolean;
isDeviceChangeAvailable(deviceType?: string): boolean;
/**
* A method to handle stopping of the stream.
* One point to handle the differences in various implementations.
Expand Down Expand Up @@ -147,5 +147,12 @@ declare class RTCUtils extends Listenable {
* @returns {MediaDeviceInfo} device.
*/
getEventDataForActiveDevice(device: any): MediaDeviceInfo;
/**
* Returns boolean value indicating whether given stream ID
* indicates user stream or not
* @param {string} [streamId] - ID of a stream
* @returns {boolean}
*/
isUserStreamById(streamId?: string): boolean;
}
import Listenable from "../util/Listenable";
7 changes: 3 additions & 4 deletions types/auto/modules/RTC/TraceablePeerConnection.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
* @constructor
*/
export default function TraceablePeerConnection(rtc: RTC, id: number, signalingLayer: any, pcConfig: object, constraints: object, isP2P: boolean, options: {
export default function TraceablePeerConnection(rtc: any, id: number, signalingLayer: any, pcConfig: object, constraints: object, isP2P: boolean, options: {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing RTC import from TraceablePeerConnection.js results in missing type here.. not sure if we can do something about that right now, thoughts?

disableSimulcast: boolean;
disableRtx: boolean;
disabledCodec: string;
Expand Down Expand Up @@ -57,7 +57,7 @@ export default class TraceablePeerConnection {
*
* @constructor
*/
constructor(rtc: RTC, id: number, signalingLayer: any, pcConfig: object, constraints: object, isP2P: boolean, options: {
constructor(rtc: any, id: number, signalingLayer: any, pcConfig: object, constraints: object, isP2P: boolean, options: {
disableSimulcast: boolean;
disableRtx: boolean;
disabledCodec: string;
Expand Down Expand Up @@ -112,7 +112,7 @@ export default class TraceablePeerConnection {
* <tt>TracablePeerConnection</tt>.
* @type {RTC}
*/
rtc: RTC;
rtc: any;
/**
* The peer connection identifier assigned by the RTC module.
* @type {number}
Expand Down Expand Up @@ -801,7 +801,6 @@ export default class TraceablePeerConnection {
*/
toString(): string;
}
import RTC from "./RTC";
import { MediaType } from "../../service/RTC/MediaType";
import JitsiRemoteTrack from "./JitsiRemoteTrack";
import { TPCUtils } from "./TPCUtils";
Expand Down