startPreview method

Future<void> startPreview(
  1. dynamic canvas,
  2. int channel
)

Implementation

Future<void> startPreview(dynamic canvas, int channel) async {
  previewView = document.getElementById("zego-view-${canvas["view"]}");
  previewView?.muted = true;
  ZegoFlutterEngine.instance.setStyleByCanvas(jsonEncode(canvas));

  await (() {
    Map completerMap = createCompleter();
    ZegoFlutterEngine.instance.startPreview(
        previewView,
        getPublishChannel(channel),
        false,
        completerMap["success"],
        completerMap["fail"]);
    return completerMap["completer"].future;
  })();
  return Future.value();
}