PlayBackControlPanel class

回放控制面板:进度、播放/暂停、倍速、交换等。与具体播放器解耦,由外部传入当前状态与回调(可绑定主时间轴或单路视频)。

拖拽进度条时使用本地滑块值并合并 onSeek 调用,避免主时钟 Obx 每 tick 与连续 seek 抢同一帧导致卡顿。

Inheritance

Constructors

PlayBackControlPanel({Key? key, required int positionSec, required int totalDurationSec, double? progressPositionSec, required bool isPlaying, required double playbackSpeed, List<double> playbackSpeedOptions = const [], bool speedMenuVisible = false, bool useBottomSafeArea = true, required VoidCallback onPlayPause, required void onSeek(int positionSec), required VoidCallback onSeekStart, required VoidCallback onSeekEnd, void onSeekEndedAtPosition(int positionSec)?, required VoidCallback onSpeedTap, ValueChanged<double>? onSpeedSelected, VoidCallback? onSwapTap, VoidCallback? onFullscreen, VoidCallback? onPreviewPageTap, VoidCallback? onOrientationTap, bool sliderEnabled = true, bool playButtonSnapshotLoading = false})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
isPlaying bool
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onFullscreen VoidCallback?
全屏(为 null 时隐藏,信令回放主时间轴不展示)
final
onOrientationTap VoidCallback?
横竖屏切换(为 null 时隐藏按钮)
final
onPlayPause VoidCallback
final
onPreviewPageTap VoidCallback?
查看当前白板课件预览(为 null 时隐藏按钮)
final
onSeek → void Function(int positionSec)
拖拽进度到某秒
final
onSeekEnd VoidCallback
final
onSeekEndedAtPosition → void Function(int positionSec)?
进度条拖拽结束时的目标秒数(与松手时滑块位置一致)
final
onSeekStart VoidCallback
final
onSpeedSelected ValueChanged<double>?
选择指定播放倍速
final
onSpeedTap VoidCallback
点击倍速按钮
final
onSwapTap VoidCallback?
交换白板/老师视频位置(仅竖屏回放时展示)
final
playbackSpeed double
final
playbackSpeedOptions List<double>
final
playButtonSnapshotLoading bool
在线信令快照请求中:中间按钮显示 loading,禁止点击播放
final
positionSec int
当前进度(秒,用于时间文案)
final
progressPositionSec double?
用于进度条计算的进度(秒,含小数),为 null 时用 positionSec,传入可避免同一秒内进度条不刷新
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sliderEnabled bool
进度条是否可拖拽(快照加载中时为 false,禁止拖动并显示 loading)
final
speedMenuVisible bool
final
totalDurationSec int
总时长(秒)
final
useBottomSafeArea bool
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<PlayBackControlPanel>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

formatDurationFromSec(int totalSeconds) String