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
Merge commit 'c2a54c3affbc74ba7f514958e34087e7788417ab' into custom-lg
* commit 'c2a54c3affbc74ba7f514958e34087e7788417ab':
chewie, version 1.9.2. Fixed broken Table of Contents links in README.md, take two.
Fixed broken Table of Contents links in README.md, take two.
chewie, version 1.9.1+1. Fixed broken Table of Contents links in README.md.
Fixed broken Table of Contents links in README.md.
chewie, version 1.9.1. Fixes issue fluttercommunity#888.
Added Github Workflow concurrency.
Added more descriptive name to new task, take three.
Added minimum Dart version supported by minimum Flutter version.
Added more descriptive name to new task, take two.
Added more descriptive name to new task.
Added default flutter version inputs to use with the job matrix.
Added revamped workflow that now tests this library against both the current and N-1 version of Flutter.
Ignoring withOpacity for the entire Dart extensions file.
Updated readme.
Added withOpacityCompact extension to ensure compatibility with Flutter versions below 3.27.
Rename showSubtitlesPerDefault flag to showSubtitles
feat: Add `showSubtitlesPerDefault` flag to control subtitles (fluttercommunity#648)
feat: Add `showSubtitlesPerDefault` flag to control subtitles (fluttercommunity#648)
# Conflicts:
# example/lib/app/app.dart
Copy file name to clipboardExpand all lines: CHANGELOG.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,15 @@
1
+
## [1.9.2]
2
+
* Fixed broken Table of Contents links in `README.md`, take two.
3
+
4
+
## [1.9.1+1]
5
+
* Fixed broken Table of Contents links in `README.md`.
6
+
7
+
## [1.9.1]
8
+
*[#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
+72-19Lines changed: 72 additions & 19 deletions
Display the source diff
Display the rich diff
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
131
172
132
-
> 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`.
133
174
134
-
You can provide an `List<Subtitle>` and customize your subtitles with the `subtitleBuilder` function.
175
+
### Adding Subtitles
135
176
136
-
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
168
210
169
-
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:
170
219
171
220
```dart
172
221
Subtitle(
@@ -177,11 +226,15 @@ Subtitle(
177
226
),
178
227
```
179
228
180
-
## 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
181
234
182
235
Please run the app in the [`example/`](https://github.com/brianegan/chewie/tree/master/example) folder to start playing!
183
236
184
-
## Migrating from Chewie < 0.9.0
237
+
## ⏪ Migrating from Chewie < 0.9.0
185
238
186
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`
239
292
Please refer to this [issue](https://github.com/flutter/flutter/issues/14647).
0 commit comments