Skip to content

Commit 77798a5

Browse files
committed
Rename showSubtitlesPerDefault flag to showSubtitles
1 parent afa4171 commit 77798a5

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Chewie allows you to enhance the video playback experience with text overlays. Y
135135

136136
### Showing Subtitles by Default
137137

138-
Chewie provides the `showSubtitlesPerDefault` flag, allowing you to control whether subtitles are displayed automatically when the video starts. By default, this flag is set to `false`.
138+
Chewie provides the `showSubtitles` flag, allowing you to control whether subtitles are displayed automatically when the video starts. By default, this flag is set to `false`.
139139

140140
### Adding Subtitles
141141

@@ -160,7 +160,7 @@ ChewieController(
160160
text: 'What’s up? :)',
161161
),
162162
]),
163-
showSubtitlesPerDefault: true, // Automatically display subtitles
163+
showSubtitles: true, // Automatically display subtitles
164164
subtitleBuilder: (context, subtitle) => Container(
165165
padding: const EdgeInsets.all(10.0),
166166
child: Text(

example/lib/app/app.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class _ChewieDemoState extends State<ChewieDemo> {
126126
];
127127
},
128128
subtitle: Subtitles(subtitles),
129-
showSubtitlesPerDefault: true,
129+
showSubtitles: true,
130130
subtitleBuilder: (context, dynamic subtitle) => Container(
131131
padding: const EdgeInsets.all(10.0),
132132
child: subtitle is InlineSpan

lib/src/chewie_player.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ class ChewieController extends ChangeNotifier {
288288
this.zoomAndPan = false,
289289
this.maxScale = 2.5,
290290
this.subtitle,
291-
this.showSubtitlesPerDefault = false,
291+
this.showSubtitles = false,
292292
this.subtitleBuilder,
293293
this.customControls,
294294
this.errorBuilder,
@@ -340,7 +340,7 @@ class ChewieController extends ChangeNotifier {
340340
bool? zoomAndPan,
341341
double? maxScale,
342342
Subtitles? subtitle,
343-
bool? showSubtitlesPerDefault,
343+
bool? showSubtitles,
344344
Widget Function(BuildContext, dynamic)? subtitleBuilder,
345345
Widget? customControls,
346346
WidgetBuilder? bufferingBuilder,
@@ -393,8 +393,7 @@ class ChewieController extends ChangeNotifier {
393393
optionsBuilder: optionsBuilder ?? this.optionsBuilder,
394394
additionalOptions: additionalOptions ?? this.additionalOptions,
395395
showControls: showControls ?? this.showControls,
396-
showSubtitlesPerDefault:
397-
showSubtitlesPerDefault ?? this.showSubtitlesPerDefault,
396+
showSubtitles: showSubtitles ?? this.showSubtitles,
398397
subtitle: subtitle ?? this.subtitle,
399398
subtitleBuilder: subtitleBuilder ?? this.subtitleBuilder,
400399
customControls: customControls ?? this.customControls,
@@ -462,8 +461,7 @@ class ChewieController extends ChangeNotifier {
462461
///
463462
/// If set to `true`, subtitles will be displayed automatically when the video
464463
/// begins playing. If set to `false`, subtitles will be hidden by default.
465-
///
466-
bool showSubtitlesPerDefault;
464+
bool showSubtitles;
467465

468466
/// The controller for the video you want to play
469467
final VideoPlayerController videoPlayerController;

lib/src/cupertino/cupertino_controls.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ class _CupertinoControlsState extends State<CupertinoControls>
641641
}
642642

643643
Future<void> _initialize() async {
644-
chewieController.showSubtitlesPerDefault &&
644+
chewieController.showSubtitles &&
645645
(chewieController.subtitle?.isNotEmpty ?? false);
646646
controller.addListener(_updateState);
647647

lib/src/material/material_controls.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ class _MaterialControlsState extends State<MaterialControls>
525525
}
526526

527527
Future<void> _initialize() async {
528-
_subtitleOn = chewieController.showSubtitlesPerDefault &&
528+
_subtitleOn = chewieController.showSubtitles &&
529529
(chewieController.subtitle?.isNotEmpty ?? false);
530530
controller.addListener(_updateState);
531531

lib/src/material/material_desktop_controls.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls>
493493
}
494494

495495
Future<void> _initialize() async {
496-
_subtitleOn = chewieController.showSubtitlesPerDefault &&
496+
_subtitleOn = chewieController.showSubtitles &&
497497
(chewieController.subtitle?.isNotEmpty ?? false);
498498
controller.addListener(_updateState);
499499

0 commit comments

Comments
 (0)