chrome.desktopCapture throws an error on “tab” as DesktopCaptureSourceType

白昼怎懂夜的黑 提交于 2019-12-11 12:37:54

问题


I am developing a chrome extension, and my point here is to record a browser tab , like Screencastify chrome extension records the browser tab. I referred desktopCapture , a chrome API which works perfectly for "screen" and "window" as DesktopCaptureSourceType, whereas for "tab" as DesktopCaptureSourceType, it throws an error as

desktopCapture.chooseDesktopMedia: Tab capture is not supported yet.

I have configured the required permissions in manifest.json of my extension. Could anyone suggest me a solution?

P.S : I need to record the chrome browser tab only, am not asking for a screen or window recording


回答1:


This is a known issue: https://crbug.com/488262

However, you can use the chrome.tabCapture api instead. The downside is that you will have to split your interface between capturing tabs and screens/windows, as chrome.tabCapture doesn't provide an equivalent picker.

Why does Google have two separate screen capture apis? Good question.




回答2:


The stream object generated by the chrome.tabCapture cant be shared outside the plugin code.

You will have to write the code to share the stream to server within the chrome plugin.



来源:https://stackoverflow.com/questions/34656673/chrome-desktopcapture-throws-an-error-on-tab-as-desktopcapturesourcetype

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!