setup static method
setup PIP is used to setup PIP in Android devices. parameters:
autoEnterPip - Enable autoEnterPip
will start pip mode automatically when app minimized. Default value is true
aspectRatio - Ratio for PIP window. List of int indicating ratio for PIP window as width,height
. For example: 16, 9
, 9, 16
,1, 1
. Default value is [16, 9]
Refer PIP mode guide here
Implementation
static Future<HMSException?> setup({
bool? autoEnterPip,
List<int>? aspectRatio,
}) async {
var result =
await PlatformService.invokeMethod(PlatformMethod.setupPIP, arguments: {
"auto_enter_pip": autoEnterPip ?? true,
"ratio": (aspectRatio != null && aspectRatio.length == 2)
? aspectRatio
: [16, 9],
});
if (result != null) {
return HMSException.fromMap(result["error"]);
}
return null;
}