isWebCanvasCaptureSupported function

bool isWebCanvasCaptureSupported()

Check if web canvas capture is supported.

Implementation

bool isWebCanvasCaptureSupported() {
  if (!kIsWeb) return false;

  try {
    final testCanvas = web.HTMLCanvasElement();
    // captureStream is available on HTMLCanvasElement
    testCanvas.remove();
    return true;
  } catch (e) {
    return false;
  }
}