@@ -528,12 +528,10 @@ class VideoEvent {
528528 this .duration,
529529 this .size,
530530 this .buffered,
531- this .textsInfo,
532- this .textDuration,
533531 this .isPlaying,
534532 this .adInfo,
535- this .pictureInfo,
536533 this .manifestInfo,
534+ this .subtitlesInfo,
537535 });
538536
539537 /// The type of the event.
@@ -554,16 +552,6 @@ class VideoEvent {
554552 /// Only used if [eventType] is [VideoEventType.bufferingUpdate] .
555553 final int ? buffered;
556554
557- /// Text and attributes of the video subtitle.
558- ///
559- /// Only used if [eventType] is [VideoEventType.subtitleUpdate] .
560- final List <dynamic >? textsInfo;
561-
562- /// The duration of text
563- ///
564- /// Only used if [eventType] is [VideoEventType.subtitleUpdate] .
565- final int ? textDuration;
566-
567555 /// Whether the video is currently playing.
568556 ///
569557 /// Only used if [eventType] is [VideoEventType.isPlayingStateUpdate] .
@@ -574,16 +562,16 @@ class VideoEvent {
574562 /// Only used if [eventType] is [VideoEventType.adFromDash] .
575563 final Map <Object ?, Object ?>? adInfo;
576564
577- /// Subtitle picture info of the video. Includes the picture and its width and height.
578- ///
579- /// Only used if [eventType] is [VideoEventType.subtitleUpdate] .
580- final Map <Object ?, Object ?>? pictureInfo;
581-
582565 /// The manifest information in dash.
583566 ///
584567 /// Only used if [eventType] is [VideoEventType.manifestInfoUpdated] .
585568 final String ? manifestInfo;
586569
570+ /// The subtitle information of the video.
571+ ///
572+ /// Only used if [eventType] is [VideoEventType.subtitleUpdate] .
573+ final SubtitlesInfo ? subtitlesInfo;
574+
587575 @override
588576 bool operator == (Object other) {
589577 return identical (this , other) ||
@@ -593,12 +581,10 @@ class VideoEvent {
593581 duration == other.duration &&
594582 size == other.size &&
595583 buffered == other.buffered &&
596- listEquals (textsInfo, other.textsInfo) &&
597- textDuration == other.textDuration &&
598584 isPlaying == other.isPlaying &&
599585 mapEquals (adInfo, other.adInfo) &&
600- mapEquals (pictureInfo, other.pictureInfo) &&
601- manifestInfo == other.manifestInfo ;
586+ manifestInfo == other.manifestInfo &&
587+ subtitlesInfo == other.subtitlesInfo ;
602588 }
603589
604590 @override
@@ -607,12 +593,10 @@ class VideoEvent {
607593 duration.hashCode ^
608594 size.hashCode ^
609595 buffered.hashCode ^
610- textsInfo.hashCode ^
611- textDuration.hashCode ^
612596 isPlaying.hashCode ^
613597 adInfo.hashCode ^
614- pictureInfo .hashCode ^
615- manifestInfo .hashCode;
598+ manifestInfo .hashCode ^
599+ subtitlesInfo .hashCode;
616600}
617601
618602/// Type of the event.
@@ -722,6 +706,35 @@ class DurationRange {
722706 int get hashCode => start.hashCode ^ end.hashCode;
723707}
724708
709+ /// The subtitle information of the video. Contains the text duration, text and attributes, and picture info.
710+ @immutable
711+ class SubtitlesInfo {
712+ /// Creates an instance of [SubtitlesInfo] .
713+ const SubtitlesInfo (this .textDuration, this .textsInfo, this .pictureInfo);
714+
715+ /// The duration of text.
716+ final int ? textDuration;
717+
718+ /// Text and attributes of the video subtitle.
719+ final List <dynamic >? textsInfo;
720+
721+ /// Subtitle picture info of the video. Includes the picture and its width and height.
722+ final Map <Object ?, Object ?>? pictureInfo;
723+
724+ @override
725+ bool operator == (Object other) {
726+ return identical (this , other) ||
727+ other is SubtitlesInfo &&
728+ listEquals (textsInfo, other.textsInfo) &&
729+ textDuration == other.textDuration &&
730+ mapEquals (pictureInfo, other.pictureInfo);
731+ }
732+
733+ @override
734+ int get hashCode =>
735+ textDuration.hashCode ^ textsInfo.hashCode ^ pictureInfo.hashCode;
736+ }
737+
725738/// [VideoPlayerOptions] can be optionally used to set additional player settings
726739@immutable
727740class VideoPlayerOptions {
0 commit comments