webrtc-streamer 0.8.4-9-g093e8b2 → 0.8.5
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/.vscode/settings.json +10 -0
- package/html/webrtcstreamer.js +6 -15
- package/package.json +1 -1
package/html/webrtcstreamer.js
CHANGED
|
@@ -108,12 +108,14 @@ WebRtcStreamer.prototype.onReceiveGetIceServers = function(iceServers, videourl,
|
|
|
108
108
|
this.pc.createOffer(this.mediaConstraints).then((sessionDescription) => {
|
|
109
109
|
console.log("Create offer:" + JSON.stringify(sessionDescription));
|
|
110
110
|
|
|
111
|
+
console.log(`video codecs:${Array.from(new Set(RTCRtpReceiver.getCapabilities("video")?.codecs?.map(codec => codec.mimeType)))}`)
|
|
112
|
+
console.log(`audio codecs:${Array.from(new Set(RTCRtpReceiver.getCapabilities("audio")?.codecs?.map(codec => codec.mimeType)))}`)
|
|
113
|
+
|
|
111
114
|
if (prefmime != undefined) {
|
|
112
115
|
//set prefered codec
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
let preferedCodecs = codecs.filter(codec => codec.mimeType === prefmime);
|
|
116
|
+
const [prefkind] = prefmime.split('/');
|
|
117
|
+
const codecs = RTCRtpReceiver.getCapabilities(prefkind).codecs;
|
|
118
|
+
const preferedCodecs = codecs.filter(codec => codec.mimeType === prefmime);
|
|
117
119
|
|
|
118
120
|
console.log(`preferedCodecs:${JSON.stringify(preferedCodecs)}`);
|
|
119
121
|
this.pc.getTransceivers().filter(transceiver => transceiver.receiver.track.kind === prefkind).forEach(tcvr => {
|
|
@@ -194,17 +196,6 @@ WebRtcStreamer.prototype.createPeerConnection = function() {
|
|
|
194
196
|
console.log("remote datachannel recv:"+JSON.stringify(event.data));
|
|
195
197
|
}
|
|
196
198
|
}
|
|
197
|
-
pc.onicegatheringstatechange = function() {
|
|
198
|
-
if (pc.iceGatheringState === "complete") {
|
|
199
|
-
const recvs = pc.getReceivers();
|
|
200
|
-
|
|
201
|
-
recvs.forEach((recv) => {
|
|
202
|
-
if (recv.track && recv.track.kind === "video") {
|
|
203
|
-
console.log("codecs:" + JSON.stringify(recv.getParameters().codecs))
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
199
|
|
|
209
200
|
try {
|
|
210
201
|
var dataChannel = pc.createDataChannel("ClientDataChannel");
|