Published
Edited
Feb 4, 2020
Insert cell
md`# ScreenShare by getDisplayMedia`
Insert cell
_startScreenCapture()
Insert cell
function _startScreenCapture() {
if (navigator.getDisplayMedia) {
console.log(1);
return navigator.getDisplayMedia({ video: true });
} else if (navigator.mediaDevices.getDisplayMedia) {
console.log(2);
return navigator.mediaDevices.getDisplayMedia({ video: true });
} else {
console.log(3);
return navigator.mediaDevices.getUserMedia({
video: { mediaSource: 'screen' }
});
}
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more