@4players/odin-plugin-web 1.0.0-alpha.17 → 1.0.0-alpha.18

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.
@@ -99,7 +99,9 @@ export class ConnectionPool {
99
99
  });
100
100
  }
101
101
  releaseConnection(connection) {
102
+ logger.log(['Connection'], 'ConnectionPool.releaseConnection()');
102
103
  const entry = this._ConnectionsById.get(connection.id);
104
+ logger.log(['Connection'], 'ConnectionPool.releaseConnection() entry refs', entry === null || entry === void 0 ? void 0 : entry.references);
103
105
  if (entry === undefined)
104
106
  return;
105
107
  if (entry.status === 'init') {
@@ -117,6 +117,7 @@ export class Room {
117
117
  link(media) {
118
118
  return __awaiter(this, void 0, void 0, function* () {
119
119
  var _a, _b, _c, _d;
120
+ logger.debug(['Audio'], 'Room.link() media', media);
120
121
  if (media instanceof AudioPlayback) {
121
122
  const entry = (_a = this._Playbacks.get(media.uid)) !== null && _a !== void 0 ? _a : {
122
123
  media: undefined,
@@ -199,6 +200,7 @@ export class Room {
199
200
  }
200
201
  unlink(media) {
201
202
  var _a, _b;
203
+ logger.debug(['Audio'], 'Room.unlink() media', media);
202
204
  if (media instanceof AudioPlayback || media instanceof VideoPlayback) {
203
205
  const entry = this._Playbacks.get(media.uid);
204
206
  if ((entry === null || entry === void 0 ? void 0 : entry.playback) !== media)
@@ -61,6 +61,7 @@ export class AudioCapture {
61
61
  this._Volume = 1;
62
62
  this._DeviceCb = () => __awaiter(this, void 0, void 0, function* () {
63
63
  var _a, _b;
64
+ logger.debug(['Audio'], 'AudioCapture._DeviceCb()');
64
65
  const devices = yield enumerateDevices();
65
66
  const isListed = devices.some((device) => {
66
67
  var _a, _b;
@@ -84,6 +85,7 @@ export class AudioCapture {
84
85
  }
85
86
  start(room, media, uid) {
86
87
  var _a;
88
+ logger.debug(['Audio'], 'AudioCapture.start()', media);
87
89
  let entry = this._Medias.get(media.connectionId);
88
90
  if (entry === undefined) {
89
91
  this._Medias.set(media.connectionId, (entry = new Set()));
@@ -103,6 +105,7 @@ export class AudioCapture {
103
105
  }
104
106
  stop(room, media) {
105
107
  var _a;
108
+ logger.debug(['Audio'], 'AudioCapture.stop()', media);
106
109
  const entry = this._Medias.get(media.connectionId);
107
110
  if (!(entry === null || entry === void 0 ? void 0 : entry.delete(media.mediaId)))
108
111
  return;
@@ -114,6 +117,7 @@ export class AudioCapture {
114
117
  this._UpdateMedias();
115
118
  }
116
119
  setVad(value) {
120
+ logger.debug(['Audio'], 'AudioCapture.setVad() config', value);
117
121
  this._Vad = value;
118
122
  if (this._Capture) {
119
123
  this._Capture.worker.setVad(value);
@@ -121,6 +125,7 @@ export class AudioCapture {
121
125
  }
122
126
  setApm(config) {
123
127
  return __awaiter(this, void 0, void 0, function* () {
128
+ logger.debug(['Audio'], 'AudioCapture.setApm() config', config);
124
129
  this._Apm = config;
125
130
  if (this._DeviceParameters) {
126
131
  yield this.setDevice(this._DeviceParameters);
@@ -172,6 +177,7 @@ export class AudioCapture {
172
177
  }
173
178
  setVolume(value) {
174
179
  var _a;
180
+ logger.debug(['Audio'], 'AudioCapture.setVolume()', value);
175
181
  this._Volume = value;
176
182
  if (value === 'muted') {
177
183
  this.close();
@@ -184,6 +190,7 @@ export class AudioCapture {
184
190
  }
185
191
  }
186
192
  close() {
193
+ logger.debug(['Audio'], 'AudioCapture.close()');
187
194
  if (this._Capture !== undefined) {
188
195
  this._Capture.worker.close();
189
196
  stopMediaStream(this._Capture.source.mediaStream);
@@ -195,6 +202,7 @@ export class AudioCapture {
195
202
  }
196
203
  _UpdateMedias() {
197
204
  return __awaiter(this, void 0, void 0, function* () {
205
+ logger.debug(['Audio'], 'AudioCapture._UpdateMedias()');
198
206
  if (this._Capture !== undefined) {
199
207
  const connections = Array.from(this._Medias).map(([key, value]) => {
200
208
  return { id: key, mediaIds: Array.from(value) };
@@ -1,3 +1,4 @@
1
+ import { logger } from '../config';
1
2
  export class AudioPlayback {
2
3
  get volume() {
3
4
  return this.controller.playbackGetVolume(this.uid);
@@ -10,15 +11,19 @@ export class AudioPlayback {
10
11
  this.uid = uid;
11
12
  }
12
13
  start(id) {
14
+ logger.debug(['Audio'], 'AudioPlayback.start()', id);
13
15
  this.controller.playbackStart(this.uid, id);
14
16
  }
15
17
  stop(id) {
18
+ logger.debug(['Audio'], 'AudioPlayback.stop()', id);
16
19
  this.controller.playbackStop(this.uid, id);
17
20
  }
18
21
  setVolume(value) {
22
+ logger.debug(['Audio'], 'AudioPlayback.setVolume()', value);
19
23
  this.controller.playbackSetVolume(this.uid, value);
20
24
  }
21
25
  close() {
26
+ logger.debug(['Audio'], 'AudioPlayback.close()');
22
27
  this.controller.closePlayback(this.uid);
23
28
  }
24
29
  }
@@ -215,6 +215,7 @@ export class RoomConnection {
215
215
  case 'closed':
216
216
  logger.debug(['Connection'], 'RoomConnection._HandleConnection: closed');
217
217
  (_a = this._RoomConnection) === null || _a === void 0 ? void 0 : _a.close();
218
+ this.connectionPool.releaseConnection(main);
218
219
  return;
219
220
  case 'renewToken':
220
221
  this._RenewToken();
package/lib/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "1.0.0-alpha.17";
1
+ export declare const version = "1.0.0-alpha.18";
package/lib/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '1.0.0-alpha.17';
2
+ export const version = '1.0.0-alpha.18';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@4players/odin-plugin-web",
3
- "version": "1.0.0-alpha.17",
3
+ "version": "1.0.0-alpha.18",
4
4
  "description": "A backend plugin providing the custom WebAssembly audio processing module for ODIN web clients",
5
5
  "homepage": "https://www.4players.io",
6
6
  "repository": {