Skip to content

Commit

Permalink
changed files to work with older version of video_player
Browse files Browse the repository at this point in the history
  • Loading branch information
przemektuzinek committed Apr 22, 2021
1 parent 9634c1f commit cfbacc9
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class _ChewieDemoState extends State<ChewieDemo> {
child: Center(
child: _chewieController != null &&
_chewieController!
.videoPlayerController.value.isInitialized
.videoPlayerController.value.initialized
? Chewie(
controller: _chewieController!,
)
Expand Down
5 changes: 1 addition & 4 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ dependencies:
cupertino_icons: ^1.0.0
flutter:
sdk: flutter
video_player:
git:
url: https://github.com/ptuzinek/plugins
path: packages/video_player/video_player
video_player: 0.11.0

dev_dependencies:
flutter_test:
Expand Down
3 changes: 2 additions & 1 deletion lib/src/chewie_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:chewie/src/player_with_controls.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
// ignore: import_of_legacy_library_into_null_safe
import 'package:video_player/video_player.dart';
import 'package:wakelock/wakelock.dart';

Expand Down Expand Up @@ -341,7 +342,7 @@ class ChewieController extends ChangeNotifier {
await videoPlayerController.setLooping(looping);

if ((autoInitialize || autoPlay) &&
!videoPlayerController.value.isInitialized) {
!videoPlayerController.value.initialized) {
await videoPlayerController.initialize();
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/cupertino_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ class _CupertinoControlsState extends State<CupertinoControls>
} else {
_cancelAndRestartTimer();

if (!controller.value.isInitialized) {
if (!controller.value.initialized) {
controller.initialize().then((_) {
controller.play();
});
Expand Down
2 changes: 1 addition & 1 deletion lib/src/material_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ class _MaterialControlsState extends State<MaterialControls>
} else {
_cancelAndRestartTimer();

if (!controller.value.isInitialized) {
if (!controller.value.initialized) {
controller.initialize().then((_) {
controller.play();
});
Expand Down
5 changes: 1 addition & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ dependencies:
cupertino_icons: ^1.0.2
flutter:
sdk: flutter
video_player:
git:
url: https://github.com/ptuzinek/plugins
path: packages/video_player/video_player
video_player: 0.11.0
wakelock: ^0.4.0

dev_dependencies:
Expand Down

0 comments on commit cfbacc9

Please sign in to comment.