@newgameplusinc/odyssey-audio-video-sdk-dev 1.0.45 → 1.0.47
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.
- package/dist/MediasoupManager.js +3 -20
- package/package.json +1 -1
package/dist/MediasoupManager.js
CHANGED
|
@@ -104,16 +104,6 @@ class MediasoupManager {
|
|
|
104
104
|
async produce(track, appData) {
|
|
105
105
|
if (!this.sendTransport)
|
|
106
106
|
throw new Error("Send transport not initialized");
|
|
107
|
-
// Check if transport is closed or failed
|
|
108
|
-
if (this.sendTransport.closed) {
|
|
109
|
-
throw new Error("Send transport is closed");
|
|
110
|
-
}
|
|
111
|
-
// Check if this track is already being produced
|
|
112
|
-
const existingProducer = Array.from(this.producers.values()).find(p => p.track?.id === track.id);
|
|
113
|
-
if (existingProducer) {
|
|
114
|
-
console.log(`ℹ️ [MediaSoup] Track ${track.id} already being produced, returning existing producer`);
|
|
115
|
-
return existingProducer;
|
|
116
|
-
}
|
|
117
107
|
// Configure simulcast for video tracks for adaptive bitrate
|
|
118
108
|
const produceOptions = { track, appData };
|
|
119
109
|
if (track.kind === 'video') {
|
|
@@ -130,16 +120,9 @@ class MediasoupManager {
|
|
|
130
120
|
videoGoogleStartBitrate: 1000
|
|
131
121
|
};
|
|
132
122
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
console.log(`✅ [MediaSoup] Successfully produced ${track.kind} track`);
|
|
137
|
-
return producer;
|
|
138
|
-
}
|
|
139
|
-
catch (error) {
|
|
140
|
-
console.error(`❌ [MediaSoup] Failed to produce ${track.kind} track:`, error);
|
|
141
|
-
throw error;
|
|
142
|
-
}
|
|
123
|
+
const producer = await this.sendTransport.produce(produceOptions);
|
|
124
|
+
this.producers.set(producer.id, producer);
|
|
125
|
+
return producer;
|
|
143
126
|
}
|
|
144
127
|
async consume(data) {
|
|
145
128
|
if (!this.recvTransport)
|
package/package.json
CHANGED