ChapterInfo class
章节信息
表示视频中的一个章节,包含时间范围和标题。 通常由视频拆条(将长视频按内容/语义拆分为多个片段)后生成, BottomBarSlot 在进度条上绘制章节标记点, 以及用户 Seek 时显示当前章节信息。
Chapter Info
Represents a chapter in the video with time range and title. Typically generated by video segmentation (splitting a long video into multiple segments based on content/semantics). Used for drawing chapter markers on the progress bar and displaying chapter info during seek when chapter data is provided.
Constructors
- ChapterInfo({String? id, required int startMs, required int endMs, required String title, String? thumbnailUrl})
- 构造函数
-
ChapterInfo.fromJson(Map<
String, dynamic> json) -
从 JSON 映射创建 ChapterInfo 实例
factory
Properties
- endMs → int
-
章节结束时间,单位毫秒
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String?
-
章节唯一标识(可选)
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- startMs → int
-
章节开始时间,单位毫秒
final
- thumbnailUrl → String?
-
章节缩略图 URL
final
- title → String
-
章节标题
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - 转换为 JSON 映射
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
findIndexByPosition(
List< ChapterInfo> ? chapters, int positionMs) → int - 根据播放位置查找当前章节索引(二分查找,O(log n))