fPanelBuilder function
FPanelWidgetBuilder
fPanelBuilder({
- Key? key,
- bool fill = false,
- bool isVideos = false,
- List<
VideoItem> ? videoList, - int videoIndex = 0,
- void playNextVideoFun()?,
- String title = '',
- String subTitle = '',
- int duration = 5000,
- bool doubleTap = true,
- bool isRightButton = false,
- List<
Widget> ? rightButtonList, - bool isSnapShot = false,
- bool isCaption = false,
- Map<
String, double> ? speedList, - bool isResolution = false,
- Map<
String, ResolutionItem> ? resolutionList, - IconData settingIcon = Icons.settings,
- void settingFun()?,
- void onError()?,
- void onVideoEnd()?,
- void onVideoPrepared()?,
- void onVideoTimeChange()?,
- int onVideoTimeChangeInterval = 50,
- void onVideoStateChange()?,
- int tipTime = -1,
- Widget? tipWidget,
- void onTipShow()?,
Implementation
FPanelWidgetBuilder fPanelBuilder({
Key? key,
final bool fill = false,
/// 是否展示视频列表
final bool isVideos = false,
/// 视频列表
final List<VideoItem>? videoList,
final int videoIndex = 0,
/// 全屏点击下一集按钮事件
final void Function()? playNextVideoFun,
/// 视频标题
final String title = '',
/// 视频副标题
final String subTitle = '',
final int duration = 5000,
final bool doubleTap = true,
/// 中间区域右上方按钮是否展示
final bool isRightButton = false,
/// 中间区域右上方按钮Widget集合
final List<Widget>? rightButtonList,
/// 截屏按钮是否展示
final bool isSnapShot = false,
/// 字幕按钮是否展示
final bool isCaption = false,
/// 倍速列表,注意这里一定要包含1倍速
final Map<String, double>? speedList,
/// 清晰度按钮是否展示
final bool isResolution = false,
/// 清晰度列表
final Map<String, ResolutionItem>? resolutionList,
/// 设置图标
final IconData settingIcon = Icons.settings,
/// 设置点击事件
final void Function()? settingFun,
/// 视频错误点击刷新
final void Function()? onError,
/// 视频结束
final void Function()? onVideoEnd,
/// 视频完成后台任务到稳定期
final void Function()? onVideoPrepared,
/// 视频时间更新
final void Function(Duration)? onVideoTimeChange,
/// 视频时间更新回调触发间隔(单位:次,每多少次位置更新触发一次回调)
/// 默认值为50,即每50次位置更新触发一次回调
/// 值越小回调越频繁,但会增加性能消耗
final int onVideoTimeChangeInterval = 50,
/// 视频状态变更
final void Function(FState, bool)? onVideoStateChange,
/// 试看时间(秒),0表示无需试看,-1表示免费(无限制),大于0表示试看秒数
final int tipTime = -1,
/// 试看结束提示Widget
final Widget? tipWidget,
/// 试看结束回调
final void Function()? onTipShow,
}) {
return (FPlayer player, FData data, BuildContext context, Size viewSize,
Rect texturePos, Color color) {
return _FPanel2(
key: key,
player: player,
data: data,
isVideos: isVideos,
title: title,
subTitle: subTitle,
videoList: videoList,
videoIndex: videoIndex,
playNextVideoFun: playNextVideoFun,
isRightButton: isRightButton,
rightButtonList: rightButtonList,
viewSize: viewSize,
texPos: texturePos,
fill: fill,
color: color,
doubleTap: doubleTap,
isSnapShot: isSnapShot,
hideDuration: duration,
isCaption: isCaption,
speedList: speedList,
isResolution: isResolution,
resolutionList: resolutionList,
settingIcon: settingIcon,
settingFun: settingFun,
onError: onError,
onVideoEnd: onVideoEnd,
onVideoPrepared: onVideoPrepared,
onVideoTimeChange: onVideoTimeChange,
onVideoTimeChangeInterval: onVideoTimeChangeInterval,
onVideoStateChange: onVideoStateChange,
tipTime: tipTime,
tipWidget: tipWidget,
onTipShow: onTipShow,
);
};
}