how to make getUserMedia() work on all browsers

后端 未结 5 442
执念已碎
执念已碎 2020-11-29 22:39

I learn about web-rtc, it says that you can capture video-cam , i used demo , well this worked on chrome only..

when i open it on firefox i get mess

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-29 23:08

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

    In addition, you have to use https instead of http, otherwise Safari for iPadOS won't work.

提交回复
热议问题