문제

navigator.getUserMedia = navigator.getUserMedia 
  || navigator.webkitGetUserMedia 
  || navigator.mozGetUserMedia 
  || navigator.msGetUserMedia 
  || false;

I am thinking doing this on the global level will be an elegant way to both reassign that method name and make it return false in the case that it isn't supported. Thoughts?

도움이 되었습니까?

해결책

Thats more or less how the modernizr detect works.

Only thing is you don't need to fallback to false, since it will be undefined (a falsey value) by default.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top