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.
문제
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.