enterPictureInPictureMode method
Future<int>
enterPictureInPictureMode({
- String? backIconForAndroid,
- String? playIconForAndroid,
- String? pauseIconForAndroid,
- String? forwardIconForAndroid,
override
To enter Picture-in-Picture mode, you need to adapt the interface for Picture-in-Picture mode. On Android, this feature is only supported on devices running Android 7.0 or higher.
Due to Android system limitations, the size of the icon passed cannot exceed 1MB, otherwise it will not be displayed.
@param backIcon playIcon pauseIcon forwardIcon :The icons for rewind, play, pause, and fast-forward can be passed as local resource images in Flutter. If not passed, the system default icons will be used. The image path should be consistent with how Flutter uses image resources, for example: images/back_icon.png.进入画中画模式,进入画中画模式,需要适配画中画模式的界面,安卓只支持7.0以上机型
由于android系统限制,传递的图标大小不得超过1M,否则无法显示
@param backIcon playIcon pauseIcon forwardIcon 为播放后退、播放、暂停、前进的图标,如果赋值的话,将会使用传递的图标,否则 使用系统默认图标,只支持flutter本地资源图片,传递的时候,与flutter使用图片资源一致,例如: images/back_icon.pngImplementation
@override
Future<int> enterPictureInPictureMode(
{String? backIconForAndroid, String? playIconForAndroid, String? pauseIconForAndroid, String? forwardIconForAndroid}) async {
if (_isNeedDisposed) return -1;
await _initPlayer.future;
IntMsg intMsg = await _vodPlayerApi.enterPictureInPictureMode(PipParamsPlayerMsg()
..backIconForAndroid = backIconForAndroid
..playIconForAndroid = playIconForAndroid
..pauseIconForAndroid = pauseIconForAndroid
..forwardIconForAndroid = forwardIconForAndroid
..playerId = _playerId);
return intMsg.value ?? -1;
}