使用HTML5记录屏幕(截屏),例如getUserMedia什么? [英] Record screen (screencast) using HTML5, e.g. getUserMedia or something?
问题描述
有一些HTML5 API,可以帮助我记录屏幕(截屏)?我知道录制的摄像头等等,但我需要在屏幕它的自我。这将有助于甚至更多,如果这个API是在一些跨平台的浏览器实际执行。
Is there some HTML5 API that can help me record the screen (screencast)? I know about recording webcams etc, but I need the screen it self. It would help even more if this API was actually implemented in some cross-platform browser.
推荐答案
抓屏可作为Chrome的实验性功能,并且必须在浏览器设置(铬启用它://标志/#使-usermedia屏-捕获)。此外,它似乎只HTTPS连接上工作。
Screen capture is available as an experimental feature in Chrome, and you must enable it in your browser settings (chrome://flags/#enable-usermedia-screen-capture). Also, it seems to only work on an https connection.
navigator.getUserMedia({
video: {
mandatory: {
chromeMediaSource: 'screen'
// maxWidth: 640,
// maxHeight: 480
}
}
},
function (stream) {
//success! Now set up the video
var video = document.createElement('video');
video.src = window.URL.createObjectURL(stream);
video.autoplay = true;
//you can choose to display the video here or not.
},
function () {
//failure. browser is unable or permission denied
}
);
一旦你的视频设置,可以记录它。有起草了媒体录制一个标准,但它不是在任何浏览器中实现呢。然而,它仍然是可能的。请参阅此演示和样本code 为一种解决方法。
不幸的是,就目前而言,该解决方案适用于Chrome只。
Unfortunately, for now, this solution is available for Chrome only.
这篇关于使用HTML5记录屏幕(截屏),例如getUserMedia什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!