diff --git a/lib/src/chewie_player.dart b/lib/src/chewie_player.dart index 952e1ce9f..0ac065735 100644 --- a/lib/src/chewie_player.dart +++ b/lib/src/chewie_player.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:provider/provider.dart'; -import 'package:video_player/video_player.dart'; +import 'package:ext_video_player/ext_video_player.dart'; import 'package:wakelock/wakelock.dart'; import 'package:chewie/src/models/subtitle_model.dart'; @@ -474,7 +474,7 @@ class ChewieController extends ChangeNotifier { await videoPlayerController.setLooping(looping); if ((autoInitialize || autoPlay) && - !videoPlayerController.value.isInitialized) { + !videoPlayerController.value.initialized) { await videoPlayerController.initialize(); } diff --git a/lib/src/cupertino/cupertino_controls.dart b/lib/src/cupertino/cupertino_controls.dart index 02873a865..6202a2018 100644 --- a/lib/src/cupertino/cupertino_controls.dart +++ b/lib/src/cupertino/cupertino_controls.dart @@ -13,7 +13,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:video_player/video_player.dart'; +import 'package:ext_video_player/ext_video_player.dart'; import 'package:chewie/src/models/subtitle_model.dart'; class CupertinoControls extends StatefulWidget { @@ -655,7 +655,7 @@ class _CupertinoControlsState extends State } else { _cancelAndRestartTimer(); - if (!controller.value.isInitialized) { + if (!controller.value.initialized) { controller.initialize().then((_) { controller.play(); }); diff --git a/lib/src/cupertino/cupertino_progress_bar.dart b/lib/src/cupertino/cupertino_progress_bar.dart index 8e14962bc..e3b89cca2 100644 --- a/lib/src/cupertino/cupertino_progress_bar.dart +++ b/lib/src/cupertino/cupertino_progress_bar.dart @@ -2,7 +2,7 @@ import 'package:chewie/src/chewie_progress_colors.dart'; import 'package:chewie/src/progress_bar.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; -import 'package:video_player/video_player.dart'; +import 'package:ext_video_player/ext_video_player.dart'; class CupertinoVideoProgressBar extends StatelessWidget { CupertinoVideoProgressBar( diff --git a/lib/src/material/material_controls.dart b/lib/src/material/material_controls.dart index d0643a671..2055dae12 100644 --- a/lib/src/material/material_controls.dart +++ b/lib/src/material/material_controls.dart @@ -10,9 +10,8 @@ import 'package:chewie/src/material/widgets/options_dialog.dart'; import 'package:chewie/src/notifiers/index.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:video_player/video_player.dart'; import 'package:chewie/src/models/subtitle_model.dart'; - +import 'package:ext_video_player/ext_video_player.dart'; import 'widgets/playback_speed_dialog.dart'; class MaterialControls extends StatefulWidget { @@ -496,7 +495,7 @@ class _MaterialControlsState extends State } else { _cancelAndRestartTimer(); - if (!controller.value.isInitialized) { + if (!controller.value.initialized) { controller.initialize().then((_) { controller.play(); }); diff --git a/lib/src/material/material_desktop_controls.dart b/lib/src/material/material_desktop_controls.dart index 8c38cec9f..a1675d3d1 100644 --- a/lib/src/material/material_desktop_controls.dart +++ b/lib/src/material/material_desktop_controls.dart @@ -11,7 +11,7 @@ import 'package:chewie/src/material/widgets/options_dialog.dart'; import 'package:chewie/src/notifiers/index.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:video_player/video_player.dart'; +import 'package:ext_video_player/ext_video_player.dart'; import 'package:chewie/src/models/subtitle_model.dart'; import 'widgets/playback_speed_dialog.dart'; @@ -501,7 +501,7 @@ class _MaterialDesktopControlsState extends State } else { _cancelAndRestartTimer(); - if (!controller.value.isInitialized) { + if (!controller.value.initialized) { controller.initialize().then((_) { controller.play(); }); diff --git a/lib/src/material/material_progress_bar.dart b/lib/src/material/material_progress_bar.dart index fd1ee4fbb..4f5ed5a18 100644 --- a/lib/src/material/material_progress_bar.dart +++ b/lib/src/material/material_progress_bar.dart @@ -2,7 +2,7 @@ import 'package:chewie/src/chewie_progress_colors.dart'; import 'package:chewie/src/progress_bar.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; -import 'package:video_player/video_player.dart'; +import 'package:ext_video_player/ext_video_player.dart'; class MaterialVideoProgressBar extends StatelessWidget { MaterialVideoProgressBar( diff --git a/lib/src/player_with_controls.dart b/lib/src/player_with_controls.dart index e162b628c..1c407adf3 100644 --- a/lib/src/player_with_controls.dart +++ b/lib/src/player_with_controls.dart @@ -4,7 +4,7 @@ import 'package:chewie/src/notifiers/index.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:video_player/video_player.dart'; +import 'package:ext_video_player/ext_video_player.dart'; class PlayerWithControls extends StatelessWidget { const PlayerWithControls({Key? key}) : super(key: key); diff --git a/lib/src/progress_bar.dart b/lib/src/progress_bar.dart index dcb2b7ad1..73ed4bb9d 100644 --- a/lib/src/progress_bar.dart +++ b/lib/src/progress_bar.dart @@ -1,7 +1,7 @@ import 'package:chewie/src/chewie_progress_colors.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; -import 'package:video_player/video_player.dart'; +import 'package:ext_video_player/ext_video_player.dart'; class VideoProgressBar extends StatefulWidget { VideoProgressBar( @@ -67,7 +67,7 @@ class _VideoProgressBarState extends State { Widget build(BuildContext context) { return GestureDetector( onHorizontalDragStart: (DragStartDetails details) { - if (!controller.value.isInitialized) { + if (!controller.value.initialized) { return; } _controllerWasPlaying = controller.value.isPlaying; @@ -78,7 +78,7 @@ class _VideoProgressBarState extends State { widget.onDragStart?.call(); }, onHorizontalDragUpdate: (DragUpdateDetails details) { - if (!controller.value.isInitialized) { + if (!controller.value.initialized) { return; } _seekToRelativePosition(details.globalPosition); @@ -93,7 +93,7 @@ class _VideoProgressBarState extends State { widget.onDragEnd?.call(); }, onTapDown: (TapDownDetails details) { - if (!controller.value.isInitialized) { + if (!controller.value.initialized) { return; } _seekToRelativePosition(details.globalPosition); @@ -153,7 +153,7 @@ class _ProgressBarPainter extends CustomPainter { ), colors.backgroundPaint, ); - if (!value.isInitialized) { + if (!value.initialized) { return; } final double playedPartPercent = diff --git a/pubspec.yaml b/pubspec.yaml index 537432fa1..a8df90ca2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: chewie description: A video player for Flutter with Cupertino and Material play controls -version: 1.2.2 +version: 1.2.4 homepage: https://github.com/brianegan/chewie environment: @@ -12,8 +12,9 @@ dependencies: flutter: sdk: flutter provider: ^5.0.0 - video_player: ^2.1.5 wakelock: ^0.5.2 + ext_video_player: ^0.0.6 + dev_dependencies: flutter_test: