Skip to content

Commit

Permalink
Fix detection webrtc without audio #1106
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed May 24, 2024
1 parent d9d2bdf commit 8749562
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion www/video-rtc.js
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,9 @@ export class VideoRTC extends HTMLElement {

pc.addEventListener('connectionstatechange', () => {
if (pc.connectionState === 'connected') {
const tracks = pc.getReceivers().map(receiver => receiver.track);
const tracks = pc.getTransceivers()
.filter(tr => tr.currentDirection === 'recvonly') // skip inactive
.map(tr => tr.receiver.track);
/** @type {HTMLVideoElement} */
const video2 = document.createElement('video');
video2.addEventListener('loadeddata', () => this.onpcvideo(video2), {once: true});
Expand Down

0 comments on commit 8749562

Please sign in to comment.