@newgameplusinc/odyssey-audio-video-sdk-dev 1.0.261 → 1.0.262
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.
|
@@ -95,28 +95,45 @@ class MediasoupManager {
|
|
|
95
95
|
}
|
|
96
96
|
connectSendTransport() {
|
|
97
97
|
this.sendTransport?.on('connect', async ({ dtlsParameters }, callback, errback) => {
|
|
98
|
+
console.log(`🎤 [MediasoupManager] Send transport connecting, DTLS params:`, {
|
|
99
|
+
transportId: this.sendTransport.id.substring(0, 8),
|
|
100
|
+
});
|
|
98
101
|
this.socket.emit('connect-transport', { transportId: this.sendTransport.id, dtlsParameters }, (response) => {
|
|
99
|
-
if (response.error)
|
|
102
|
+
if (response.error) {
|
|
103
|
+
console.error(`🎤 [MediasoupManager] ❌ Send transport connect failed:`, response.error);
|
|
100
104
|
errback(new Error(response.error));
|
|
101
|
-
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
console.log(`🎤 [MediasoupManager] ✅ Send transport connected`);
|
|
102
108
|
callback();
|
|
109
|
+
}
|
|
103
110
|
});
|
|
104
111
|
});
|
|
105
112
|
this.sendTransport?.on('produce', async ({ kind, rtpParameters, appData, }, callback, errback) => {
|
|
113
|
+
console.log(`🎤 [MediasoupManager] Producing ${kind} track via socket...`);
|
|
106
114
|
this.socket.emit('produce', {
|
|
107
115
|
transportId: this.sendTransport.id,
|
|
108
116
|
kind,
|
|
109
117
|
rtpParameters,
|
|
110
118
|
appData,
|
|
111
119
|
}, (response) => {
|
|
112
|
-
if (response.error)
|
|
120
|
+
if (response.error) {
|
|
121
|
+
console.error(`🎤 [MediasoupManager] ❌ Produce failed:`, response.error);
|
|
113
122
|
errback(new Error(response.error));
|
|
114
|
-
|
|
123
|
+
}
|
|
124
|
+
else if (response.producerId) {
|
|
125
|
+
console.log(`🎤 [MediasoupManager] ✅ Produce success, producerId:`, response.producerId.substring(0, 8));
|
|
115
126
|
callback({ id: response.producerId });
|
|
127
|
+
}
|
|
116
128
|
});
|
|
117
129
|
});
|
|
118
130
|
this.sendTransport?.on('connectionstatechange', (state) => {
|
|
131
|
+
console.log(`🎤 [MediasoupManager] Send transport connection state changed: ${state}`);
|
|
132
|
+
if (state === 'connected') {
|
|
133
|
+
console.log(`🎤 [MediasoupManager] ✅ Send transport fully connected!`);
|
|
134
|
+
}
|
|
119
135
|
if (state === 'failed' || state === 'closed') {
|
|
136
|
+
console.error(`🎤 [MediasoupManager] ❌ Send transport ${state}`);
|
|
120
137
|
this.producers.clear();
|
|
121
138
|
this.socket.emit('transport-failed', {
|
|
122
139
|
participantId: this.participantId,
|
|
@@ -124,6 +141,10 @@ class MediasoupManager {
|
|
|
124
141
|
});
|
|
125
142
|
}
|
|
126
143
|
});
|
|
144
|
+
// Also monitor ICE state separately
|
|
145
|
+
this.sendTransport?.on('icegatheringstatechange', (state) => {
|
|
146
|
+
console.log(`🎤 [MediasoupManager] Send transport ICE gathering state: ${state}`);
|
|
147
|
+
});
|
|
127
148
|
}
|
|
128
149
|
connectRecvTransport() {
|
|
129
150
|
this.recvTransport?.on('connect', async ({ dtlsParameters }, callback, errback) => {
|
|
@@ -158,6 +179,15 @@ class MediasoupManager {
|
|
|
158
179
|
async produce(track, appData) {
|
|
159
180
|
if (!this.sendTransport)
|
|
160
181
|
throw new Error('Send transport not initialized');
|
|
182
|
+
// Debug: Log track state BEFORE producing
|
|
183
|
+
console.log(`🎤 [MediasoupManager] Producing ${track.kind} track:`, {
|
|
184
|
+
trackId: track.id.substring(0, 8),
|
|
185
|
+
enabled: track.enabled,
|
|
186
|
+
muted: track.muted,
|
|
187
|
+
readyState: track.readyState,
|
|
188
|
+
label: track.label,
|
|
189
|
+
sendTransportState: this.sendTransport.connectionState,
|
|
190
|
+
});
|
|
161
191
|
const produceOptions = { track, appData };
|
|
162
192
|
if (track.kind === 'video') {
|
|
163
193
|
produceOptions.encodings = [
|
|
@@ -170,6 +200,12 @@ class MediasoupManager {
|
|
|
170
200
|
};
|
|
171
201
|
}
|
|
172
202
|
const producer = await this.sendTransport.produce(produceOptions);
|
|
203
|
+
console.log(`🎤 [MediasoupManager] Producer created:`, {
|
|
204
|
+
producerId: producer.id.substring(0, 8),
|
|
205
|
+
kind: producer.kind,
|
|
206
|
+
paused: producer.paused,
|
|
207
|
+
closed: producer.closed,
|
|
208
|
+
});
|
|
173
209
|
producer.on('transportclose', () => {
|
|
174
210
|
this.producers.delete(producer.id);
|
|
175
211
|
});
|
package/package.json
CHANGED