Skip to content

Commit b41d83d

Browse files
committed
Update README and CHANGELOG
1 parent bdb0278 commit b41d83d

File tree

2 files changed

+50
-5
lines changed

2 files changed

+50
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 1.0.0
4+
5+
* **Breaking changes**: Add a `ChewieController` to make customizations and control from outside of the player easier.
6+
Refer to the [README](README.md) for details on how to upgrade from previous versions.
7+
38
## 0.8.0
49

510
* Update to work with `video_player: ">=0.7.0 <0.8.0` - Thanks @Sub6Resources

README.md

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,63 @@ dependencies:
2121
2222
```dart
2323
import 'package:chewie/chewie.dart';
24+
final videoPlayerController = VideoPlayerController.network(
25+
'https://flutter.github.io/assets-for-api-docs/videos/butterfly.mp4');
2426

25-
final playerWidget = new Chewie(
26-
new VideoPlayerController.network(
27-
'https://flutter.github.io/assets-for-api-docs/videos/butterfly.mp4'
28-
),
27+
final chewieController = ChewieController(
28+
videoPlayerController: videoPlayerController,
2929
aspectRatio: 3 / 2,
3030
autoPlay: true,
3131
looping: true,
3232
);
33+
34+
final playerWidget = Chewie(
35+
controller: chewieController,
36+
);
37+
```
38+
39+
Please make sure to dispose both controller widgets after use. For example by overriding the dispose method of the a `StatefulWidget`:
40+
```dart
41+
@override
42+
void dispose() {
43+
videoPlayerController.dispose();
44+
chewieController.dispose();
45+
super.dispose();
46+
}
3347
```
3448

3549
## Example
3650

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

53+
## Migrating from Chewie < 1.0.0
54+
Instead of passing the `VideoPlayerController` and your options to the `Chewie` widget you now pass them to the `ChewieController` and pass that latter to the `Chewie` widget.
55+
56+
```dart
57+
final playerWidget = Chewie(
58+
videoPlayerController,
59+
aspectRatio: 3 / 2,
60+
autoPlay: true,
61+
looping: true,
62+
);
63+
```
64+
65+
becomes
66+
67+
```dart
68+
final chewieController = ChewieController(
69+
videoPlayerController: videoPlayerController,
70+
aspectRatio: 3 / 2,
71+
autoPlay: true,
72+
looping: true,
73+
);
74+
75+
final playerWidget = Chewie(
76+
controller: chewieController,
77+
);
78+
```
3979

40-
## iOS Warning
80+
## iOS warning
4181

4282
The video player plugin used by chewie is not functional on iOS simulators. An iOS device must be used during development/testing. Please refer to this [issue](https://github.com/flutter/flutter/issues/14647).
4383

0 commit comments

Comments
 (0)