mediaPlayerSetPlayerCanvas method

Future<void> mediaPlayerSetPlayerCanvas(
  1. int index,
  2. Map canvas
)

Implementation

Future<void> mediaPlayerSetPlayerCanvas(
    int index, Map<dynamic, dynamic> canvas) async {
  var viewElem = document.getElementById("zego-view-${canvas["view"]}");
  if (_mediaPlayers[index] == null) {
    return Future.value();
  }
  ZegoFlutterEngine.instance.setStyleByCanvas(jsonEncode(canvas));
  await (() {
    Map completerMap = createCompleter();
    ZegoFlutterEngine.instance.mediaPlayerSetPlayerCanvas(
        viewElem,
        canvas,
        _mediaPlayers[index].instance,
        completerMap["success"],
        completerMap["fail"]);
    return completerMap["completer"].future;
  })();
  return Future.value();
}