Skip to content

Commit 03b29bb

Browse files
authored
Merge branch 'fluttercommunity:master' into pause-on-tap
2 parents 1937a7c + 483e22b commit 03b29bb

20 files changed

+350
-154
lines changed

.github/workflows/ci.yml

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,46 +11,51 @@ on:
1111
- '**.md'
1212
workflow_dispatch:
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
1418
jobs:
15-
check-format:
16-
name: Check format using dart format.
17-
runs-on: ubuntu-latest
18-
19-
steps:
20-
- name: Checkout code
21-
uses: actions/checkout@v4
22-
- name: Flutter Action
23-
uses: subosito/flutter-action@v2
24-
- name: Check format
25-
run: dart format . --set-exit-if-changed
26-
27-
lint:
28-
name: Lint
19+
# Does a sanity check that packages at least pass analysis on the N-1
20+
# versions of Flutter stable if the package claims to support that version.
21+
# This is to minimize accidentally making changes that break old versions
22+
# (which we don't commit to supporting, but don't want to actively break)
23+
# without updating the constraints.
24+
lint_and_build:
25+
name: Flutter Version ${{ matrix.flutter-version }} Lint and Build.
2926
runs-on: ubuntu-latest
30-
27+
strategy:
28+
matrix:
29+
flutter-version:
30+
# The version of Flutter to use should use the minimum Dart SDK version supported by the package,
31+
# refer to https://docs.flutter.dev/development/tools/sdk/releases.
32+
# Note: The version below should be manually updated to the latest second most recent version
33+
# after a new stable version comes out.
34+
- "3.27.4"
35+
- "3.x"
3136
steps:
32-
- name: Checkout code
37+
- name: 📚 Git Checkout
3338
uses: actions/checkout@v4
34-
- name: Flutter Action
39+
40+
- name: 🐦 Setup Flutter
3541
uses: subosito/flutter-action@v2
36-
- name: Install Package Dependencies
42+
with:
43+
flutter-version: ${{ matrix.flutter-version }}
44+
channel: stable
45+
cache: true
46+
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
47+
48+
- name: 📦 Install Dependencies
3749
run: flutter packages get
38-
- name: Get dependencies for example
39-
run: flutter pub get
40-
working-directory: example
41-
- name: Lint using flutter analyze
42-
run: flutter analyze .
43-
44-
test:
45-
name: Run tests.
46-
runs-on: ubuntu-latest
4750

48-
steps:
49-
- name: Checkout code
50-
uses: actions/checkout@v4
51-
- name: Flutter Action
52-
uses: subosito/flutter-action@v2
53-
- name: Run flutter test
54-
run: |
55-
flutter pub get
56-
flutter test
51+
- name: ✨ Check Formatting
52+
run: dart format --set-exit-if-changed lib
53+
54+
- name: 🕵️ Analyze
55+
run: flutter analyze lib
56+
57+
- name: 🧪 Run Tests
58+
run: flutter test --no-pub --coverage --test-randomize-ordering-seed random
59+
60+
- name: 📁 Upload coverage to Codecov
61+
uses: codecov/codecov-action@v5

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1+
## [1.11.0]
2+
* ⬆️ [#900](https://github.com/fluttercommunity/chewie/pull/900): Flutter `3.29` upgrade. Thanks [diegotori](https://github.com/diegotori).
3+
* **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).
20+
* [#890](https://github.com/fluttercommunity/chewie/pull/890): Fix issue 888. Thanks [diegotori](https://github.com/diegotori).
21+
* **IMPORTANT**: Relaxed the minimum supported Flutter version to `3.24`.
22+
From now on, this library will make a best effort to support the latest `N-1` Flutter version at the minimum.
23+
24+
## [1.9.0]
25+
* **BREAKING CHANGE**: Library now requires at least Flutter version `3.27.0`.
26+
27+
## [1.8.7]
28+
* ⬆️ [#876](https://github.com/fluttercommunity/chewie/pull/876): Add keyboard controls seek forward and backward and fullscreen escape on desktop. Thanks [Ortes](https://github.com/Ortes).
29+
30+
## [1.8.6]
31+
* ⬆️ [#874](https://github.com/fluttercommunity/chewie/pull/874): Add `devtools_options.yaml` configuration files. Thanks [MoRmdn](https://github.com/MoRmdn).
32+
133
## [1.8.5]
234
* ⬆️ [#703](https://github.com/fluttercommunity/chewie/pull/703): Adding Seek buttons for Android. Thanks [GyanendroKh](https://github.com/GyanendroKh).
335
* Upgraded `wakelock_plus` to version `1.2.8`, which uses `web` version `1.0.0`. Thanks [diegotori](https://github.com/diegotori).

README.md

Lines changed: 74 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,53 @@
88

99
The video player for Flutter with a heart of gold.
1010

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.
1213

13-
## Preview
14+
Chewie uses the `video_player` under the hood and wraps it in a friendly Material or Cupertino UI!
1415

15-
| MaterialControls | MaterialDesktopControls |
16-
| :--------------: | :---------------------: |
17-
| ![](https://github.com/brianegan/chewie/raw/master/assets/MaterialControls.png) | ![](https://github.com/brianegan/chewie/raw/master/assets/MaterialDesktopControls.png) |
16+
## Table of Contents
17+
1. 🚨 [IMPORTANT!!! (READ THIS FIRST)](#-important-read-this-first)
18+
2. 🔀 [Flutter Version Compatibility](#-flutter-version-compatibility)
19+
3. 🖼️ [Preview](#%EF%B8%8F-preview)
20+
4. ⬇️ [Installation](#%EF%B8%8F-installation)
21+
5. 🕹️ [Using it](#%EF%B8%8F-using-it)
22+
6. ⚙️ [Options](#%EF%B8%8F-options)
23+
7. 🔡 [Subtitles](#-subtitles)
24+
8. 🧪 [Example](#-example)
25+
9.[Migrating from Chewie < 0.9.0](#-migrating-from-chewie--090)
26+
10. 🗺️ [Roadmap](#%EF%B8%8F-roadmap)
27+
11. 📱 [iOS warning](#-ios-warning-)
28+
29+
30+
## 🚨 IMPORTANT!!! (READ THIS FIRST)
31+
This library is __NOT__ responsible for any issues caused by `video_player`, since it's merely a UI
32+
layer on top of it.
33+
34+
In other words, if you see any `PlatformException`s being thrown in your app due to video playback,
35+
they are exclusive to the `video_player` library.
36+
37+
Instead, please raise an issue related to it with the [Flutter Team](https://github.com/flutter/flutter/issues/new/choose).
38+
39+
## 🔀 Flutter Version Compatibility
40+
41+
This library will at the very least make a solid effort to support the second most recent version
42+
of Flutter released. In other words, it will adopt `N-1` version support at
43+
the bare minimum.
44+
45+
However, this cannot be guaranteed due to major changes between Flutter versions. Should that occur,
46+
future updates will be released as major or minor versions as needed.
47+
48+
## 🖼️ Preview
49+
50+
| MaterialControls | MaterialDesktopControls |
51+
|:-------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------:|
52+
| ![](https://github.com/brianegan/chewie/raw/master/assets/MaterialControls.png) | ![](https://github.com/brianegan/chewie/raw/master/assets/MaterialDesktopControls.png) |
1853

1954
### CupertinoControls
2055
![](https://github.com/brianegan/chewie/raw/master/assets/CupertinoControls.png)
2156

22-
## Installation
57+
## ⬇️ Installation
2358

2459
In your `pubspec.yaml` file within your Flutter Project add `chewie` and `video_player` under dependencies:
2560

@@ -29,10 +64,12 @@ dependencies:
2964
video_player: <latest_version>
3065
```
3166
32-
## Using it
67+
## 🕹️ Using it
3368
3469
```dart
3570
import 'package:chewie/chewie.dart';
71+
import 'package:video_player/video_player.dart';
72+
3673
final videoPlayerController = VideoPlayerController.networkUrl(Uri.parse(
3774
'https://flutter.github.io/assets-for-api-docs/assets/videos/butterfly.mp4'));
3875

@@ -59,7 +96,7 @@ void dispose() {
5996
}
6097
```
6198

62-
## Options
99+
## ⚙️ Options
63100

64101
![](https://github.com/brianegan/chewie/raw/master/assets/Options.png)
65102

@@ -125,13 +162,19 @@ optionsTranslation: OptionsTranslation(
125162
),
126163
```
127164

128-
## Subtitles
165+
## 🔡 Subtitles
166+
167+
> Since version 1.1.0, Chewie supports subtitles.
168+
169+
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
129172

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`.
131174

132-
You can provide an `List<Subtitle>` and customize your subtitles with the `subtitleBuilder` function.
175+
### Adding Subtitles
133176

134-
Add subtitles to your `ChewieController` like the following example:
177+
Here’s an example of how to add subtitles to your `ChewieController`:
135178

136179
```dart
137180
ChewieController(
@@ -149,9 +192,10 @@ ChewieController(
149192
index: 1,
150193
start: const Duration(seconds: 10),
151194
end: const Duration(seconds: 20),
152-
text: 'Whats up? :)',
195+
text: 'What’s up? :)',
153196
),
154197
]),
198+
showSubtitles: true, // Automatically display subtitles
155199
subtitleBuilder: (context, subtitle) => Container(
156200
padding: const EdgeInsets.all(10.0),
157201
child: Text(
@@ -162,9 +206,16 @@ ChewieController(
162206
);
163207
```
164208

165-
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
166210

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:
168219

169220
```dart
170221
Subtitle(
@@ -175,11 +226,15 @@ Subtitle(
175226
),
176227
```
177228

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
179234

180235
Please run the app in the [`example/`](https://github.com/brianegan/chewie/tree/master/example) folder to start playing!
181236

182-
## Migrating from Chewie < 0.9.0
237+
## Migrating from Chewie < 0.9.0
183238

184239
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.
185240

@@ -205,7 +260,7 @@ final playerWidget = Chewie(
205260
);
206261
```
207262

208-
## Roadmap
263+
## 🗺️ Roadmap
209264

210265
- [x] MaterialUI
211266
- [x] MaterialDesktopUI
@@ -231,7 +286,7 @@ final playerWidget = Chewie(
231286
- [ ] Screen-Mirroring / Casting (Google Chromecast)
232287

233288

234-
## iOS warning
289+
## 📱 iOS warning
235290

236291
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`
237292
Please refer to this [issue](https://github.com/flutter/flutter/issues/14647).

devtools_options.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
description: This file stores settings for Dart & Flutter DevTools.
2+
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
3+
extensions:

example/devtools_options.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
description: This file stores settings for Dart & Flutter DevTools.
2+
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
3+
extensions:

example/ios/Runner/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Flutter
22
import UIKit
33

4-
@UIApplicationMain
4+
@main
55
@objc class AppDelegate: FlutterAppDelegate {
66
override func application(
77
_ application: UIApplication,

0 commit comments

Comments
 (0)