@livedigital/client 3.0.7 → 3.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,20 @@
1
+ import { LogLevel } from '../types/common';
2
+
3
+ export const LOG_LEVEL_ERROR: LogLevel = 3;
4
+ export const LOG_LEVEL_WARN: LogLevel = 4;
5
+ export const LOG_LEVEL_INFO: LogLevel = 6;
6
+ export const LOG_LEVEL_DEBUG: LogLevel = 7;
7
+
8
+ export const LogLevels = {
9
+ Error: LOG_LEVEL_ERROR,
10
+ Warn: LOG_LEVEL_WARN,
11
+ Info: LOG_LEVEL_INFO,
12
+ Debug: LOG_LEVEL_DEBUG,
13
+ };
14
+
15
+ export const CONSUMER_CHECK_STATE_TIMEOUT = 4500;
16
+ export const PRODUCER_CHECK_STATE_TIMEOUT = 3000;
17
+
18
+ export const PEER_APP_DATA_MAX_SIZE_BYTES = 1024;
19
+
20
+ export const SOCKET_ERROR_CODE_UNAUTHORIZED = 'unauthorized';
@@ -0,0 +1,26 @@
1
+ export const WEBCAM_SIMULCAST_ENCODINGS = [
2
+ {
3
+ scaleResolutionDownBy: 4, // 320x180 0.15mbps 12fps by default
4
+ maxBitrate: 150000,
5
+ maxFramerate: 12,
6
+ },
7
+ {
8
+ scaleResolutionDownBy: 2, // 640x360 0.35mbps 18fps by default
9
+ maxBitrate: 350000,
10
+ maxFramerate: 18,
11
+ },
12
+ {
13
+ scaleResolutionDownBy: 1, // 1280x720 0.9mbps 24fps by default
14
+ maxBitrate: 900000,
15
+ maxFramerate: 24,
16
+ },
17
+ ];
18
+
19
+ export const SCREEN_SHARING_SIMULCAST_ENCODINGS = [
20
+ {
21
+ maxBitrate: 1000000, // 1920x1080 1mbps 30fps by default
22
+ dtx: true,
23
+ },
24
+ ];
25
+
26
+ export const AUDIO_ENCODINGS = [{ maxBitrate: 40_000, dtx: true }];
@@ -48,14 +48,6 @@ export declare const PEER_EVENTS: {
48
48
  trackFailed: string;
49
49
  appDataUpdated: string;
50
50
  };
51
- export declare enum SocketIOEvents {
52
- Connected = "connected",
53
- Reconnecting = "reconnecting",
54
- Reconnected = "reconnected",
55
- Disconnected = "disconnected",
56
- Reconnect = "reconnect",
57
- Error = "error"
58
- }
59
51
  export declare const MEDIASOUP_EVENTS: {
60
52
  newProducer: string;
61
53
  producerClose: string;
@@ -0,0 +1,83 @@
1
+ export const CHANNEL_EVENTS = {
2
+ channelEvent: 'channel.event',
3
+ channelJoin: 'channel.join',
4
+ channelGetPeers: 'channel.getPeers',
5
+ channelLeave: 'peer.disconnected',
6
+ updatePeerAppData: 'peer.updateAppData',
7
+ activityConfirm: 'channel.confirmActivity',
8
+ activityConfirmationAcquired: 'channel.activityConfirmationAcquired',
9
+ activityConfirmationRequired: 'channel.activityConfirmationRequired',
10
+ activityConfirmationExpired: 'channel.activityConfirmationExpired',
11
+ getAudioObserverProducer: 'channel.getAudioObserverProducer',
12
+ };
13
+
14
+ export const CLIENT_EVENTS = {
15
+ channelEvent: 'channel-event',
16
+ peerJoined: 'peer-joined',
17
+ peerLeft: 'peer-left',
18
+ activityConfirmationRequired: 'channel-activity-confirmation-required',
19
+ activityConfirmationAcquired: 'channel-activity-confirmation-acquired',
20
+ activityConfirmationExpired: 'channel-activity-confirmation-expired',
21
+ channelRejoinRequired: 'channel-rejoin-required',
22
+ devicesListUpdated: 'devices-list-updated',
23
+ transportConnectionTimeout: 'transport-connection-timeout',
24
+ trackPublishingFailed: 'track-publishing-failed',
25
+ trackForceClosed: 'track-force-closed',
26
+ activeSpeakerChanged: 'active-speaker-changed',
27
+ };
28
+
29
+ export const TRACK_EVENTS = {
30
+ volumeChanged: 'volume-changed',
31
+ };
32
+
33
+ export const INTERNAL_CLIENT_EVENTS = {
34
+ trackProduced: 'track-produced',
35
+ trackUnproduced: 'track-unproduced',
36
+ trackPaused: 'track-paused',
37
+ trackResumed: 'track-resumed',
38
+ trackClosed: 'track-closed',
39
+ trackReopened: 'track-reopened',
40
+ };
41
+
42
+ export const PEER_EVENTS = {
43
+ mediaPublished: 'media-published',
44
+ mediaUnPublished: 'media-unpublished',
45
+ publisherPaused: 'publisher-paused',
46
+ publisherResumed: 'publisher-resumed',
47
+ connectionQualityChanged: 'connection-quality-changed',
48
+ trackStart: 'track-start',
49
+ trackEnd: 'track-end',
50
+ trackPaused: 'track-paused',
51
+ trackResumed: 'track-resumed',
52
+ trackFailed: 'track-failed',
53
+ appDataUpdated: 'app-data-updated',
54
+ };
55
+
56
+ export const MEDIASOUP_EVENTS = {
57
+ newProducer: 'peer.newProducer',
58
+ producerClose: 'producer.close',
59
+ producerPause: 'producer.pause',
60
+ producerResume: 'producer.resume',
61
+ producerPaused: 'producer.paused',
62
+ producerResumed: 'producer.resumed',
63
+ producerForceClosed: 'producer.forceClosed',
64
+ producerScoreChanged: 'producer.scoreChanged',
65
+ producerSetMaxSpatialLayer: 'producer.setMaxSpatialLayer',
66
+ producerRequestMaxSpatialLayer: 'producer.requestMaxSpatialLayer',
67
+ createConsumer: 'consumer.create',
68
+ createDataConsumer: 'dataConsumer.create',
69
+ closeConsumer: 'consumer.close',
70
+ pauseConsumer: 'consumer.pause',
71
+ resumeConsumer: 'consumer.resume',
72
+ consumerScoreChanged: 'consumer.scoreChanged',
73
+ consumerChangePreferredLayers: 'consumer.changeConsumerPreferredLayers',
74
+ consumerRequestKeyFrame: 'consumer.requestKeyFrame',
75
+ setConsumerPriority: 'consumer.setConsumerPriority',
76
+ transportCreate: 'transport.create',
77
+ transportClose: 'transport.close',
78
+ transportConnect: 'transport.connect',
79
+ transportProduce: 'transport.produce',
80
+ transportConnectionTimeout: 'transport.connectionTimeout',
81
+ transportStateChange: 'connectionstatechange',
82
+ transportGetIceParameters: 'transport.getIceParameters',
83
+ };
@@ -0,0 +1,10 @@
1
+ // eslint-disable-next-line import/prefer-default-export
2
+ export const VIDEO_CONSTRAINS = {
3
+ qvga: { width: 320, height: 240 },
4
+ vga: { width: 640, height: 480 },
5
+ hd: {
6
+ width: 1280,
7
+ height: 720,
8
+ },
9
+ fullhd: { width: 1920, height: 1080 },
10
+ };
@@ -49,6 +49,7 @@ declare class Peer {
49
49
  getInfo(): Promise<PeerInfo>;
50
50
  private handleNewProducer;
51
51
  private handlePeerEvents;
52
+ reset(): void;
52
53
  private emitConnectionQuality;
53
54
  static getConnectionQualityByScore(score: number): ConnectionQuality;
54
55
  private getAllConsumers;
@@ -8,5 +8,7 @@ declare class ChannelEventHandler {
8
8
  onLogMessage?: LogMessageHandler;
9
9
  });
10
10
  subscribeToEvents(): void;
11
+ private removeEventListeners;
12
+ reset(): void;
11
13
  }
12
14
  export default ChannelEventHandler;
@@ -9,6 +9,8 @@ declare class MediaSoupEventHandler {
9
9
  onLogMessage?: LogMessageHandler;
10
10
  });
11
11
  subscribeToEvents(): void;
12
+ private removeEventListeners;
13
+ reset(): void;
12
14
  private handleProducerSetMaxSpatialLayer;
13
15
  }
14
16
  export default MediaSoupEventHandler;
@@ -46,6 +46,7 @@ declare class Engine {
46
46
  constructor(params: EngineParams);
47
47
  private initialize;
48
48
  release(): Promise<void>;
49
+ private removeClientEventEmitterListeners;
49
50
  private watchSocketState;
50
51
  get activeSpeaker(): Peer | undefined;
51
52
  get peers(): Peer[];
@@ -20,6 +20,8 @@ declare class Network {
20
20
  receiveTransport?: Transport;
21
21
  private readonly logger;
22
22
  constructor(params: NetworkParams);
23
+ private removeEventListeners;
24
+ reset(): void;
23
25
  closeRemoteProducer(producerId: string): Promise<void>;
24
26
  closeSendTransport(): Promise<void>;
25
27
  closeReceiveTransport(): Promise<void>;