How to use webrtc insde google chrome extension?

前端 未结 1 1055
情深已故
情深已故 2020-12-10 21:26

I have developped a google chrome extension.

I am trying now to integrate webRTC feature inside:

navigator.getUserMedia = navigator.getUserMedia ||          


        
相关标签:
1条回答
  • In order to use WebRTC or the speech recognition API in the background page of a Chrome extension, you need to open a page from your extension in a tab, (popup) window or iframe (within a tab) (if you use an iframe, don't forget to list the page in web_accessible_resources). In this page, invoke navigator.webkitGetUserMedia to trigger the permission prompt. After the user approves the permission, your extension (in particular the background page) can request access to the microphone / camera again, and the request will automatically be approved.

    Whether silent approval after a one-time prompt is desirable is debated, and this is also the reason that audioCapture and videoCapture permissions cannot be used in extensions yet. The audioCapture and videoCapture permissions will become available in the future though, so I recommend putting these permissions in your manifest file if your extension needs it, even when the current versions of Chrome do not recognize the permission for extensions.

    0 讨论(0)
提交回复
热议问题