tuya: fix crlf in candidate, fix empty stream name in rebroadcast, webrtc logging

This commit is contained in:
Koushik Dutta
2022-09-04 13:16:26 -05:00
parent bf4a192024
commit 2841fa01d1
5 changed files with 8 additions and 6 deletions

View File

@@ -7,7 +7,6 @@
"": {
"name": "@scrypted/prebuffer-mixin",
"version": "0.9.34",
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
"@scrypted/common": "file:../../common",
@@ -35,7 +34,7 @@
},
"../../sdk": {
"name": "@scrypted/sdk",
"version": "0.0.199",
"version": "0.0.206",
"license": "ISC",
"dependencies": {
"@babel/preset-typescript": "^7.16.7",

View File

@@ -194,7 +194,7 @@ class PrebufferSession {
}
get streamName() {
return this.advertisedMediaStreamOptions.name;
return this.advertisedMediaStreamOptions.name || `Stream ${this.streamId}`;
}
clearPrebuffers() {
@@ -301,7 +301,7 @@ class PrebufferSession {
const elapsed = Date.now() - start;
const bitrate = Math.round(total / elapsed * 8);
const group = this.streamName ? `Stream: ${this.streamName}` : 'Stream';
const group = `Stream: ${this.streamName}`;
settings.push(
{

View File

@@ -204,7 +204,7 @@ export function createStreamSettings(device: MixinDeviceBase<VideoCamera>) {
enabledStreams = {
defaultValue: getDefaultPrebufferedStreams(msos)?.map(mso => mso.name),
choices: msos.map(mso => mso.name),
choices: msos.map((mso, index) => mso.name || `Stream ${index}`),
hide: false,
};

View File

@@ -129,7 +129,7 @@ class TuyaRTCSignalingSesion implements RTCSignalingSession {
}
sendIceCandidate({
candidate: candidate.candidate,
candidate: candidate.candidate.trim(),
sdpMid: '0',
sdpMLineIndex: 0
});

View File

@@ -80,6 +80,9 @@ export async function createRTCPeerConnectionSource(options: {
pc.iceConnectionStateChange.subscribe(() => {
console.log('iceConnectionState', pc.iceConnectionState);
});
pc.connectionStateChange.subscribe(() => {
console.log('connectionState', pc.connectionState);
});
audioTransceiver = pc.addTransceiver("audio", setup.audio as any);
audioTransceiver.mid = '0';
audioTransceiver.onTrack.subscribe((track) => {