Skip to content

Commit

Permalink
Merge pull request #244 from binbat/fix/web-debugger-audio-only-stream
Browse files Browse the repository at this point in the history
fix(web): avoid assigning srcObject of debug-player repeatedly
  • Loading branch information
a-wing authored Oct 24, 2024
2 parents eefd155 + 06f41b0 commit 518aa13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/shared/tools/debugger/debugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,13 @@ async function startWhep() {
pc.addTransceiver("audio", { "direction": "recvonly" })

const ms = new MediaStream();
document.getElementById("whep-video-player").srcObject = ms;
pc.ontrack = ev => {
logWhep(num, `track: ${ev.track.kind}`)
ms.addTrack(ev.track);
// addtrack removetrack events won't fire when calling addTrack/removeTrack in javascript
// https://github.com/w3c/mediacapture-main/issues/517
document.getElementById("whep-video-player").srcObject = ms;
document.getElementById("whep-video-player").setShowTrackCount(ms);
}
const whep = new WHEPClient()
const url = location.origin + "/whep/" + streamId
Expand Down

0 comments on commit 518aa13

Please sign in to comment.