Skip to content

Instantly share code, notes, and snippets.

@juliendargelos
Last active February 18, 2021 16:09
Show Gist options
  • Save juliendargelos/660831d4b1f964447802f30f538c8aba to your computer and use it in GitHub Desktop.
Save juliendargelos/660831d4b1f964447802f30f538c8aba to your computer and use it in GitHub Desktop.
(() => {
if(!navigator.mediaDevices) {
navigator.mediaDevices = {}
}
if (!navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia = (
navigator.mediaDevices.webkitGetUserMedia ||
navigator.mediaDevices.mozGetUserMedia ||
navigator.mediaDevices.msGetUserMedia ||
(() => Promise.reject('getUserMedia is not supported in this browser'))
)
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment