Skip to content

Commit

Permalink
Update README and CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
cbenhagen committed Jan 20, 2019
1 parent bdb0278 commit bb0285a
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.0.0 **Breaking changes**

* Add a `ChewieController` to make customizations and control from outside of the player easier.
Refer to the [README](README.md) for details on how to upgrade from previous versions.

## 0.8.0

* Update to work with `video_player: ">=0.7.0 <0.8.0` - Thanks @Sub6Resources
Expand Down
50 changes: 45 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,63 @@ dependencies:

```dart
import 'package:chewie/chewie.dart';
final videoPlayerController = VideoPlayerController.network(
'https://flutter.github.io/assets-for-api-docs/videos/butterfly.mp4');
final playerWidget = new Chewie(
new VideoPlayerController.network(
'https://flutter.github.io/assets-for-api-docs/videos/butterfly.mp4'
),
final chewieController = ChewieController(
videoPlayerController: videoPlayerController,
aspectRatio: 3 / 2,
autoPlay: true,
looping: true,
);
final playerWidget = Chewie(
controller: chewieController,
);
```

Please make sure to dispose both controller widgets after use. For example by overriding the dispose method of the a `StatefulWidget`:
```dart
@override
void dispose() {
videoPlayerController.dispose();
chewieController.dispose();
super.dispose();
}
```

## Example

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

## Migrating from Chewie < 1.0.0
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.

```dart
final playerWidget = Chewie(
videoPlayerController,
aspectRatio: 3 / 2,
autoPlay: true,
looping: true,
);
```

becomes

```dart
final chewieController = ChewieController(
videoPlayerController: videoPlayerController,
aspectRatio: 3 / 2,
autoPlay: true,
looping: true,
);
final playerWidget = Chewie(
controller: chewieController,
);
```

## iOS Warning
## iOS warning

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

Expand Down

0 comments on commit bb0285a

Please sign in to comment.