Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@webex/media-helpers

Package Overview
Dependencies
Maintainers
7
Versions
463
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webex/media-helpers - npm Package Compare versions

Comparing version 3.0.1-next.4 to 3.0.1-next.5

2

dist/index.d.ts

@@ -1,4 +0,4 @@

export { getDevices, LocalStream, LocalDisplayStream, LocalSystemAudioStream, LocalStreamEventNames, StreamEventNames, RemoteStream, type ServerMuteReason, LocalMicrophoneStreamEventNames, LocalCameraStreamEventNames, LocalMicrophoneStream, LocalCameraStream, createMicrophoneStream, createCameraStream, createDisplayStream, createDisplayStreamWithAudio, type VideoContentHint, } from './webrtc-core';
export { getDevices, LocalStream, LocalDisplayStream, LocalSystemAudioStream, LocalStreamEventNames, StreamEventNames, RemoteStream, RemoteStreamEventNames, type ServerMuteReason, LocalMicrophoneStreamEventNames, LocalCameraStreamEventNames, LocalMicrophoneStream, LocalCameraStream, createMicrophoneStream, createCameraStream, createDisplayStream, createDisplayStreamWithAudio, type VideoContentHint, } from './webrtc-core';
export { NoiseReductionEffect, VirtualBackgroundEffect } from '@webex/web-media-effects';
export type { NoiseReductionEffectOptions, VirtualBackgroundEffectOptions, } from '@webex/web-media-effects';
export { FacingMode, DisplaySurface, PresetCameraConstraints } from './constants';

@@ -84,2 +84,8 @@ "use strict";

});
Object.defineProperty(exports, "RemoteStreamEventNames", {
enumerable: true,
get: function () {
return _webrtcCore.RemoteStreamEventNames;
}
});
Object.defineProperty(exports, "StreamEventNames", {

@@ -86,0 +92,0 @@ enumerable: true,

import { AudioDeviceConstraints, LocalDisplayStream, LocalSystemAudioStream, LocalMicrophoneStream as WcmeLocalMicrophoneStream, LocalCameraStream as WcmeLocalCameraStream, VideoDeviceConstraints } from '@webex/internal-media-core';
import { TypedEvent, WithEventsDummyType } from '@webex/ts-events';
export { getDevices, LocalStream, LocalDisplayStream, LocalSystemAudioStream, LocalStreamEventNames, StreamEventNames, RemoteStream, type VideoContentHint, } from '@webex/internal-media-core';
export { getDevices, LocalStream, LocalDisplayStream, LocalSystemAudioStream, LocalStreamEventNames, StreamEventNames, RemoteStream, RemoteStreamEventNames, type VideoContentHint, } from '@webex/internal-media-core';
export type ServerMuteReason = 'remotelyMuted' | 'clientRequestFailed' | 'localUnmuteRequired';

@@ -24,3 +24,3 @@ export declare enum LocalMicrophoneStreamEventNames {

isUnmuteAllowed(): boolean;
setMuted(muted: boolean): void;
setUserMuted(muted: boolean): void;
}

@@ -34,3 +34,3 @@ declare class _LocalCameraStream extends WcmeLocalCameraStream {

isUnmuteAllowed(): boolean;
setMuted(muted: boolean): void;
setUserMuted(muted: boolean): void;
}

@@ -37,0 +37,0 @@ export declare const createMicrophoneStream: (constraints?: AudioDeviceConstraints) => Promise<{

@@ -38,2 +38,8 @@ "use strict";

});
Object.defineProperty(exports, "RemoteStreamEventNames", {
enumerable: true,
get: function () {
return _internalMediaCore.RemoteStreamEventNames;
}
});
Object.defineProperty(exports, "StreamEventNames", {

@@ -84,3 +90,3 @@ enumerable: true,

}
setMuted(muted) {
setUserMuted(muted) {
if (!muted) {

@@ -91,3 +97,3 @@ if (!this.isUnmuteAllowed()) {

}
return super.setMuted(muted);
return super.setUserMuted(muted);
}

@@ -99,4 +105,4 @@

setServerMuted(muted, reason) {
if (muted !== this.muted) {
this.setMuted(muted);
if (muted !== this.userMuted) {
this.setUserMuted(muted);
this[LocalMicrophoneStreamEventNames.ServerMuted].emit(muted, reason);

@@ -123,3 +129,3 @@ }

}
setMuted(muted) {
setUserMuted(muted) {
if (!muted) {

@@ -130,3 +136,3 @@ if (!this.isUnmuteAllowed()) {

}
return super.setMuted(muted);
return super.setUserMuted(muted);
}

@@ -138,4 +144,4 @@

setServerMuted(muted, reason) {
if (muted !== this.muted) {
this.setMuted(muted);
if (muted !== this.userMuted) {
this.setUserMuted(muted);
this[LocalCameraStreamEventNames.ServerMuted].emit(muted, reason);

@@ -142,0 +148,0 @@ }

const config = require('@webex/jest-config-legacy');
module.exports = {
...config,
testEnvironment: 'jsdom',
};
module.exports = config;

@@ -25,3 +25,3 @@ {

"dependencies": {
"@webex/internal-media-core": "2.2.9",
"@webex/internal-media-core": "2.3.0",
"@webex/ts-events": "^1.1.0",

@@ -42,8 +42,9 @@ "@webex/web-media-effects": "^2.15.6"

"@webex/legacy-tools": "0.0.0",
"@webex/test-helper-chai": "3.0.0-next.4",
"@webex/test-helper-mock-webex": "3.0.0-next.4",
"@webex/test-helper-chai": "3.0.0-next.5",
"@webex/test-helper-mock-webex": "3.0.0-next.5",
"eslint": "^8.24.0",
"jsdom-global": "3.0.2",
"sinon": "^9.2.4"
},
"version": "3.0.1-next.4"
"version": "3.0.1-next.5"
}

@@ -9,2 +9,3 @@ export {

RemoteStream,
RemoteStreamEventNames,
type ServerMuteReason,

@@ -11,0 +12,0 @@ LocalMicrophoneStreamEventNames,

@@ -26,2 +26,3 @@ /* eslint-disable @typescript-eslint/no-misused-new */

RemoteStream,
RemoteStreamEventNames,
type VideoContentHint,

@@ -32,3 +33,3 @@ } from '@webex/internal-media-core';

| 'remotelyMuted' // other user has remotely muted us
| 'clientRequestFailed' // client called setMuted() but server request failed
| 'clientRequestFailed' // client called setUserMuted() but server request failed
| 'localUnmuteRequired'; // server forced the client to be unmuted

@@ -79,3 +80,3 @@

setMuted(muted: boolean): void {
setUserMuted(muted: boolean): void {
if (!muted) {

@@ -87,3 +88,3 @@ if (!this.isUnmuteAllowed()) {

return super.setMuted(muted);
return super.setUserMuted(muted);
}

@@ -95,4 +96,4 @@

setServerMuted(muted: boolean, reason: ServerMuteReason) {
if (muted !== this.muted) {
this.setMuted(muted);
if (muted !== this.userMuted) {
this.setUserMuted(muted);
this[LocalMicrophoneStreamEventNames.ServerMuted].emit(muted, reason);

@@ -124,3 +125,3 @@ }

setMuted(muted: boolean): void {
setUserMuted(muted: boolean): void {
if (!muted) {

@@ -132,3 +133,3 @@ if (!this.isUnmuteAllowed()) {

return super.setMuted(muted);
return super.setUserMuted(muted);
}

@@ -140,4 +141,4 @@

setServerMuted(muted: boolean, reason: ServerMuteReason) {
if (muted !== this.muted) {
this.setMuted(muted);
if (muted !== this.userMuted) {
this.setUserMuted(muted);
this[LocalCameraStreamEventNames.ServerMuted].emit(muted, reason);

@@ -144,0 +145,0 @@ }

@@ -0,1 +1,2 @@

import 'jsdom-global/register';
import {assert, expect} from '@webex/test-helper-chai';

@@ -56,18 +57,18 @@ import sinon from 'sinon';

assert.equal(stream.isUnmuteAllowed(), true);
await stream.setMuted(false);
await stream.setUserMuted(false);
});
it('rejects setMute(false) if unmute is not allowed', async () => {
await stream.setUnmuteAllowed(false);
it('rejects setUserMuted(false) if unmute is not allowed', async () => {
stream.setUnmuteAllowed(false);
assert.equal(stream.isUnmuteAllowed(), false);
const fn = () => stream.setMuted(false);
const fn = () => stream.setUserMuted(false);
expect(fn).to.throw(/Unmute is not allowed/);
});
it('resolves setMute(false) if unmute is allowed', async () => {
await stream.setUnmuteAllowed(true);
it('resolves setUserMuted(false) if unmute is allowed', async () => {
stream.setUnmuteAllowed(true);
assert.equal(stream.isUnmuteAllowed(), true);
await stream.setMuted(false);
await stream.setUserMuted(false);
});

@@ -85,5 +86,5 @@

const checkSetServerMuted = async (startMute, setMute, expectedCalled) => {
await stream.setMuted(startMute);
await stream.setUserMuted(startMute);
assert.equal(stream.muted, startMute);
assert.equal(stream.userMuted, startMute);

@@ -95,3 +96,3 @@ const handler = sinon.fake();

assert.equal(stream.muted, setMute);
assert.equal(stream.userMuted, setMute);
if (expectedCalled) {

@@ -98,0 +99,0 @@ assert.calledOnceWithExactly(handler, setMute, 'remotelyMuted');

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc