MethodChannelVideoPlayerWin constructor

MethodChannelVideoPlayerWin()

Implementation

MethodChannelVideoPlayerWin() {
  methodChannel.setMethodCallHandler((call) async {
    //log("[videoplayer] native->flutter: $call");
    int? textureId = call.arguments["textureId"];
    assert(textureId != null);
    final player = playerMap[textureId];
    if (player == null) {
      log("player not found: id = $textureId");
      return;
    }

    if (call.method == "OnPlaybackEvent") {
      int state = call.arguments["state"]!;
      player.target?.onPlaybackEvent_(state);
    } else {
      assert(false, "unknown call from native: ${call.method}");
    }
  });
}