Skip to content

Commit 2aad2c9

Browse files
committed
fix review issues
1 parent 2883e37 commit 2aad2c9

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

packages/video_player_avplay/lib/src/closed_caption_file.dart

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class TextCaption extends Caption {
7373
/// and [end].
7474
final String text;
7575

76-
/// The subtitile attributes associated with this caption.
76+
/// The subtitle attributes associated with this caption.
7777
final List<SubtitleAttribute?>? subtitleAttributes;
7878

7979
/// Specifies how the text in the closed caption should look.
@@ -89,7 +89,7 @@ class TextCaption extends Caption {
8989
subtitleAttributes: <SubtitleAttribute?>[],
9090
);
9191

92-
static Color? _toColor(int colorValue) {
92+
static Color? _intToColor(int colorValue) {
9393
String hexValue = colorValue.toRadixString(16);
9494
if (hexValue.length < 6) {
9595
hexValue = hexValue.padLeft(6, '0');
@@ -103,11 +103,11 @@ class TextCaption extends Caption {
103103
return null;
104104
}
105105

106-
static FontWeight _toWeight(int weightValue) {
106+
static FontWeight _intToFontWeight(int weightValue) {
107107
return weightValue == 0 ? FontWeight.normal : FontWeight.bold;
108108
}
109109

110-
static FontStyle _toStyle(int styleValue) {
110+
static FontStyle _intToFontStyle(int styleValue) {
111111
return styleValue == 0 ? FontStyle.normal : FontStyle.italic;
112112
}
113113

@@ -131,19 +131,19 @@ class TextCaption extends Caption {
131131
}
132132
case SubtitleAttrType.subAttrFontWeight:
133133
actualTextStyle = actualTextStyle.copyWith(
134-
fontWeight: _toWeight(attr.attrValue as int));
134+
fontWeight: _intToFontWeight(attr.attrValue as int));
135135
case SubtitleAttrType.subAttrFontStyle:
136136
actualTextStyle = actualTextStyle.copyWith(
137-
fontStyle: _toStyle(attr.attrValue as int));
137+
fontStyle: _intToFontStyle(attr.attrValue as int));
138138
case SubtitleAttrType.subAttrFontColor:
139139
if (actualTextStyle.foreground == null) {
140140
actualTextStyle = actualTextStyle.copyWith(
141-
color: _toColor(attr.attrValue as int));
141+
color: _intToColor(attr.attrValue as int));
142142
}
143143
case SubtitleAttrType.subAttrFontBgColor:
144144
if (actualTextStyle.background == null) {
145145
actualTextStyle = actualTextStyle.copyWith(
146-
backgroundColor: _toColor(attr.attrValue as int));
146+
backgroundColor: _intToColor(attr.attrValue as int));
147147
}
148148
case SubtitleAttrType.subAttrFontOpacity:
149149
actualTextStyle = actualTextStyle.copyWith(
@@ -156,10 +156,6 @@ class TextCaption extends Caption {
156156
case SubtitleAttrType.subAttrFontTextOutlineColor:
157157
case SubtitleAttrType.subAttrFontTextOutlineThickness:
158158
case SubtitleAttrType.subAttrFontTextOutlineBlurRadius:
159-
// actualTextStyle = actualTextStyle.copyWith(shadows: <Shadow>[
160-
// const Shadow(color: Colors.green, offset: Offset(1, 1))
161-
// ]);
162-
break;
163159
case SubtitleAttrType.subAttrRegionXPos:
164160
case SubtitleAttrType.subAttrRegionYPos:
165161
case SubtitleAttrType.subAttrRegionWidth:

packages/video_player_avplay/lib/video_player.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ class VideoPlayerValue {
243243
'size: $size, '
244244
'position: $position, '
245245
'textCaption: $textCaption, '
246-
'pictureCapton: $pictureCaption, '
246+
'pictureCaption: $pictureCaption, '
247247
'captionOffset: $captionOffset, '
248248
'tracks: $tracks, '
249249
'buffered: $buffered, '

packages/video_player_avplay/tizen/src/plus_player.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,9 +1261,7 @@ void PlusPlayer::OnSubtitleData(char *data, const int size,
12611261
STBIW_FREE(subtitle_png);
12621262
} else {
12631263
LOG_ERROR("[PlusPlayer] Picture subtitle data is null or size is 0.");
1264-
STBIW_FREE(subtitle_png);
12651264
}
1266-
12671265
} else {
12681266
LOG_INFO(
12691267
"[PlusPlayer] Subtitle is text: duration: %llu, text: %s, type: %d",

0 commit comments

Comments
 (0)