mirror of
https://github.com/koush/scrypted.git
synced 2026-02-12 18:12:04 +00:00
webrtc: add some debug code
This commit is contained in:
@@ -167,6 +167,7 @@ export class WebRTCPlugin extends AutoenableMixinProvider implements DeviceCreat
|
||||
if (interfaces.includes(ScryptedInterface.RTCSignalingChannel)) {
|
||||
const ret = [
|
||||
ScryptedInterface.RTCSignalingChannel,
|
||||
// ScryptedInterface.Settings,
|
||||
];
|
||||
if (type === ScryptedDeviceType.Speaker) {
|
||||
ret.push(ScryptedInterface.Intercom);
|
||||
|
||||
@@ -110,13 +110,16 @@ export async function createRTCPeerConnectionSource(options: {
|
||||
let audioTrack: string;
|
||||
let videoTrack: string;
|
||||
let audioTransceiver: RTCRtpTransceiver;
|
||||
|
||||
const useRtspJitterBuffer = false;
|
||||
|
||||
const doSetup = async (setup: RTCAVSignalingSetup) => {
|
||||
let gotAudio = false;
|
||||
let gotVideo = false;
|
||||
|
||||
audioTransceiver = pc.addTransceiver("audio", setup.audio as any);
|
||||
audioTransceiver.onTrack.subscribe((track) => {
|
||||
if (useUdp) {
|
||||
if (useUdp || !useRtspJitterBuffer) {
|
||||
track.onReceiveRtp.subscribe(rtp => {
|
||||
if (!gotAudio) {
|
||||
gotAudio = true;
|
||||
@@ -147,13 +150,13 @@ export async function createRTCPeerConnectionSource(options: {
|
||||
}
|
||||
}
|
||||
}
|
||||
jitter.pipe(new RtspOutput())
|
||||
jitter.pipe(new RtspOutput());
|
||||
}
|
||||
});
|
||||
|
||||
const videoTransceiver = pc.addTransceiver("video", setup.video as any);
|
||||
videoTransceiver.onTrack.subscribe((track) => {
|
||||
if (useUdp) {
|
||||
if (useUdp || !useRtspJitterBuffer) {
|
||||
track.onReceiveRtp.subscribe(rtp => {
|
||||
if (!gotVideo) {
|
||||
gotVideo = true;
|
||||
@@ -184,7 +187,7 @@ export async function createRTCPeerConnectionSource(options: {
|
||||
}
|
||||
}
|
||||
}
|
||||
jitter.pipe(new RtspOutput())
|
||||
jitter.pipe(new RtspOutput());
|
||||
}
|
||||
|
||||
track.onReceiveRtp.once(() => {
|
||||
@@ -397,7 +400,7 @@ export async function createRTCPeerConnectionSource(options: {
|
||||
}
|
||||
else {
|
||||
const url = `rtsp://127.0.0.1:${port}`;
|
||||
const mediaStreamUrl : MediaStreamUrl = {
|
||||
const mediaStreamUrl: MediaStreamUrl = {
|
||||
url,
|
||||
mediaStreamOptions,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user