admin管理员组文章数量:1336178
I am trying to implement a bug reporter on my website. My goal is that the user will be able to describe the problem audibly and record the browser tab while walking through the problem. The bug report will then just be a video file, which can be emailed to me.
It appears that the proposed navigator.mediaDevices.getDisplayMedia is exactly what I want, but it appears no browser has implemented it, nor have I found any plans for implementation on roadmaps.
Use of
var constraints = {video: {'mandatory' {'chromeMediaSource':'screen'}},
audio: true };
navigator.mediaDevices.getUserMedia(constraints)
did in fact work, but only after passing mand line flags to Chrome on startup. I think essentially zero users will go through this hassle to do me a favor of submitting a bug report.
Are there any alternatives to achieving my goal?
I am trying to implement a bug reporter on my website. My goal is that the user will be able to describe the problem audibly and record the browser tab while walking through the problem. The bug report will then just be a video file, which can be emailed to me.
It appears that the proposed navigator.mediaDevices.getDisplayMedia is exactly what I want, but it appears no browser has implemented it, nor have I found any plans for implementation on roadmaps.
Use of
var constraints = {video: {'mandatory' {'chromeMediaSource':'screen'}},
audio: true };
navigator.mediaDevices.getUserMedia(constraints)
did in fact work, but only after passing mand line flags to Chrome on startup. I think essentially zero users will go through this hassle to do me a favor of submitting a bug report.
Are there any alternatives to achieving my goal?
Share edited Dec 24, 2018 at 14:38 jib 42.5k17 gold badges108 silver badges165 bronze badges asked Jan 26, 2017 at 19:29 user14717user14717 5,1914 gold badges48 silver badges79 bronze badges4 Answers
Reset to default 4As you've noticed, Chrome and Firefox currently implement an outdated unofficial draft. The bug tracker for getDisplayMedia
in Firefox is here.
If it helps, you no longer need an extension in Firefox, but you do need to use https (so you must open this page in https first):
var constraints = {video: {mediaSource: "screen", width: 320, height: 200}};
navigator.mediaDevices.getUserMedia(constraints)
.then(stream => video.srcObject = stream)
.catch(e => console.log(e.message));
<video id="video" height="240" width="320" autoplay></video>
However, please be aware of unique security risks of sharing your screen with a browser window on it.
You have to develop an extension (at least on chrome) using https://developer.chrome./extensions/desktopCapture APIs. As this poses a security concern, its not available without an extension. There is a talk to add this in next version of webrtc spec (https://w3c.github.io/mediacapture-screen-share/). You may want to keep an eye on it and track the progress.
There are older versions of the API currently implemented. See this module which includes example extensions for Chrome and Firefox (note: Firefox will soon no longer require an extension for whitelisting)
getDisplayMedia()
has now been rolled out in Edge 17 and 18 and it is under a flag in Chrome 70
The code required to capture the screen is as follows:
navigator.getDisplayMedia({ video: true }).then(stream => {
console.log("Awesome");
}, error => {
console.log("Unable to acquire screen capture", error);
});
Chrome will ask whether you want to share your screen, an app window or a Chrome tab:
本文标签: javascriptBug reporter Alternatives to getDisplayMediaStack Overflow
版权声明:本文标题:javascript - Bug reporter: Alternatives to getDisplayMedia? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742402141a2468098.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论