enterPip method

  1. @override
Future<bool> enterPip({
  1. int? width,
  2. int? height,
})
override

Requests system PiP with an optional width/height aspect hint. Returns whether PiP was entered.

请求系统画中画,可选传入 width/height 作为宽高比提示。返回是否成功进入。

  • width, height: aspect-ratio hint / 宽高比提示

Example / 示例:

final ok = await MovaPlatform.instance.enterPip(width: 16, height: 9);

Implementation

@override
Future<bool> enterPip({int? width, int? height}) async {
  try {
    final ok = await methodChannel.invokeMethod<bool>(
      'enterPip',
      {'width': width, 'height': height},
    );
    return ok ?? false;
  } on PlatformException {
    return false;
  } on MissingPluginException {
    return false;
  }
}