lib/media/user_media.js
function getUserMedia (constraints) {
  if (props('navigator.mediaDevices.getUserMedia').hadBy(window)) {
    let medias = props('navigator.mediaDevices').from(window)
    return medias.getUserMedia(constraints)
  }
  let userMediaGetter = navigator.getUserMedia ||
                        navigator.webkitGetUserMedia ||
                        navigator.mozGetUserMedia ||
                        navigator.msGetUserMedia
  if (!userMediaGetter) {
    throw new Error('getUserMedia is not supported by this browser')
  }
  return new Promise((resolve, reject) => {
    userMediaGetter(constraints, resolve, reject)
  })
}
function getUserMedia (constraints) {
  if (props('navigator.mediaDevices.getUserMedia').hadBy(window)) {
    let medias = props('navigator.mediaDevices').from(window)
    return medias.getUserMedia(constraints)
  }
  let userMediaGetter = navigator.getUserMedia ||
                        navigator.webkitGetUserMedia ||
                        navigator.mozGetUserMedia ||
                        navigator.msGetUserMedia
  if (!userMediaGetter) {
    throw new Error('getUserMedia is not supported by this browser')
  }
  return new Promise((resolve, reject) => {
    userMediaGetter(constraints, resolve, reject)
  })
}
function getUserMedia ( constraints ) { if ( props ( 'navigator.mediaDevices.getUserMedia' ) . hadBy ( window ) ) { let medias = props ( 'navigator.mediaDevices' ) . from ( window ) return medias . getUserMedia ( constraints ) } let userMediaGetter = navigator . getUserMedia || navigator . webkitGetUserMedia || navigator . mozGetUserMedia || navigator . msGetUserMedia if ( ! userMediaGetter ) { throw new Error ( 'getUserMedia is not supported by this browser' ) } return new Promise ( ( resolve , reject ) => { userMediaGetter ( constraints , resolve , reject ) } ) }
Shim for MediaDevices#getUserMedia method
@param {object} constraints - The user media constraints
Shim for MediaDevices#getUserMedia method