SlotType class
插槽类型定义
Slot type definition for identifying and ordering player UI slots.
每个插槽类型由 key(唯一标识)和 defaultOrder(默认层级顺序)组成。 内置插槽使用预定义的常量,间距为 10,便于外部插入自定义插槽。
Each slot type consists of a key (unique identifier) and defaultOrder (default stacking order). Built-in slots use predefined constants with gaps of 10, making it easy to insert custom slots at any position.
内置插槽使用示例 / Built-in slot usage:
AliPlayerWidget(
controller,
slotBuilders: {
SlotType.topBar: (context) => MyCustomTopBar(),
},
)
自定义插槽使用示例 / Custom slot usage:
// 定义自定义插槽,order=35 自动落在 coverImage(30) 和 playControl(40) 之间
const watermark = SlotType('watermark', defaultOrder: 35);
AliPlayerWidget(
controller,
slotBuilders: {
watermark: (context) => WatermarkWidget(),
},
// 按 defaultOrder 自动排序
)
Properties
- defaultOrder → int
-
默认层级顺序
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → String
-
插槽唯一标识
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- bottomBar → const SlotType
- 底部栏插槽
-
builtInSlots
→ const List<
SlotType> - 所有内置插槽列表,按 defaultOrder 排序。
- centerDisplay → const SlotType
- 中心显示插槽(大播放按钮、错误提示等)
- coverImage → const SlotType
- 封面图插槽
- overlays → const SlotType
- 浮层插槽(提示弹层、交互反馈等)
- playControl → const SlotType
- 播放控制插槽(手势交互层)
- playerSurface → const SlotType
- 播放器表面插槽(视频渲染层)
- playState → const SlotType
- 播放状态插槽(加载中、暂停图标等)
- seekThumbnail → const SlotType
- seek 缩略图插槽
- settingMenu → const SlotType
- 设置菜单插槽
- subtitle → const SlotType
- 字幕插槽
- topBar → const SlotType
- 顶部栏插槽