You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
***BREAKING CHANGE**: Library now requires at least Flutter version `3.27.0`, for real this time.
4
+
5
+
## [1.10.0]
6
+
* 🛠️ [#871](https://github.com/fluttercommunity/chewie/pull/871): Fixed pop the wrong page when changing the speed. Thanks [akmalova](https://github.com/akmalova).
7
+
***BREAKING CHANGES**:
8
+
*`OptionItem.onTap` now takes in a `BuildContext`.
9
+
*`OptionItem`'s properties are now marked as `final`. Use `copyWith` to mutate its properties into
10
+
a new instance.
11
+
12
+
## [1.9.2]
13
+
* Fixed broken Table of Contents links in `README.md`, take two.
14
+
15
+
## [1.9.1+1]
16
+
* Fixed broken Table of Contents links in `README.md`.
17
+
18
+
## [1.9.1]
19
+
*[#872](https://github.com/fluttercommunity/chewie/pull/872): feat: Add showSubtitles flag to control subtitles (#648). Thanks [floodoo](https://github.com/floodoo).
Copy file name to clipboardExpand all lines: README.md
+74-19Lines changed: 74 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -8,18 +8,53 @@
8
8
9
9
The video player for Flutter with a heart of gold.
10
10
11
-
The [`video_player`](https://pub.dartlang.org/packages/video_player) plugin provides low-level access to video playback. Chewie uses the `video_player` under the hood and wraps it in a friendly Material or Cupertino UI!
11
+
The [`video_player`](https://pub.dartlang.org/packages/video_player) plugin provides low-level
12
+
access to video playback.
12
13
13
-
## Preview
14
+
Chewie uses the `video_player` under the hood and wraps it in a friendly Material or Cupertino UI!
Chewie allows you to enhance the video playback experience with text overlays. You can add a `List<Subtitle>` to your `ChewieController` and fully customize their appearance using the `subtitleBuilder` function.
170
+
171
+
### Showing Subtitles by Default
129
172
130
-
> Since version 1.1.0 chewie supports subtitles. Here you can see how to use them.
173
+
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`.
131
174
132
-
You can provide an `List<Subtitle>` and customize your subtitles with the `subtitleBuilder` function.
175
+
### Adding Subtitles
133
176
134
-
Add subtitles to your `ChewieController` like the following example:
177
+
Here’s an example of how to add subtitles to your `ChewieController`:
The `index` attribute is for if you want to structure your subtitles in your database and provide your indexes here. `end` and `text` are the key attributes.
209
+
### Subtitle Structure
166
210
167
-
The Duration defines which part of your video your subtitles should start and end. For example, if your video is 10 minutes long and you want to add a subtitle between: `00:00` and `00:10`'th of a second:
211
+
The `Subtitle` model contains the following key attributes:
212
+
213
+
-**`index`**: A unique identifier for the subtitle, useful for database integration.
214
+
-**`start`**: The starting point of the subtitle, defined as a `Duration`.
215
+
-**`end`**: The ending point of the subtitle, defined as a `Duration`.
216
+
-**`text`**: The subtitle text that will be displayed.
217
+
218
+
For example, if your video is 10 minutes long and you want to add a subtitle that appears between `00:00` and `00:10`, you can define it like this:
168
219
169
220
```dart
170
221
Subtitle(
@@ -175,11 +226,15 @@ Subtitle(
175
226
),
176
227
```
177
228
178
-
## Example
229
+
### Customizing Subtitles
230
+
231
+
Use the `subtitleBuilder` function to customize how subtitles are rendered, allowing you to modify text styles, add padding, or apply other customizations to your subtitles.
232
+
233
+
## 🧪 Example
179
234
180
235
Please run the app in the [`example/`](https://github.com/brianegan/chewie/tree/master/example) folder to start playing!
181
236
182
-
## Migrating from Chewie < 0.9.0
237
+
## ⏪ Migrating from Chewie < 0.9.0
183
238
184
239
Instead of passing the `VideoPlayerController` and your options to the `Chewie` widget you now pass them to the `ChewieController` and pass that later to the `Chewie` widget.
The video_player plugin used by chewie will only work in iOS simulators if you are on flutter 1.26.0 or above. You may need to switch to the beta channel `flutter channel beta`
237
292
Please refer to this [issue](https://github.com/flutter/flutter/issues/14647).
0 commit comments