Skip to content

Commit

Permalink
Merge pull request #18 from peermetrics/feat/17
Browse files Browse the repository at this point in the history
destroy() should not unrap getUserMedia if wrapGetUserMedia was not passed initially
  • Loading branch information
onel authored Feb 8, 2024
2 parents 2eeb72b + 8b59a52 commit 13de702
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,11 @@ export class WebRTCStats extends EventEmitter {

localTracks = []

// put back the original gUM native method
navigator.mediaDevices.getUserMedia = origGetUserMedia
// if we wrapped gUM initially
if (this.shouldWrapGetUserMedia && origGetUserMedia) {
// put back the original
navigator.mediaDevices.getUserMedia = origGetUserMedia
}
}

/**
Expand Down

0 comments on commit 13de702

Please sign in to comment.