16 lines
575 B
JavaScript
16 lines
575 B
JavaScript
var isCanvasSupportsStreamCapturing = false;
|
|
var isVideoSupportsStreamCapturing = false;
|
|
['captureStream', 'mozCaptureStream', 'webkitCaptureStream'].forEach(function(item) {
|
|
if (typeof document === 'undefined' || typeof document.createElement !== 'function') {
|
|
return;
|
|
}
|
|
|
|
if (!isCanvasSupportsStreamCapturing && item in document.createElement('canvas')) {
|
|
isCanvasSupportsStreamCapturing = true;
|
|
}
|
|
|
|
if (!isVideoSupportsStreamCapturing && item in document.createElement('video')) {
|
|
isVideoSupportsStreamCapturing = true;
|
|
}
|
|
});
|