Skip to content

Commit

Permalink
remove video_player: video_player, requires manually registerWith()
Browse files Browse the repository at this point in the history
since flutter 3.27, only 1 implementation will be included(see #192). multiple implementations will conflict and fail to build. now you have to add fvp to your app's direct dependencies, video_player_avfoundation is also required to use official implementation, otherwise video_player_avfoundation.framework is not included.
should fix #170, #196.
  • Loading branch information
wang-bin committed Dec 19, 2024
1 parent 409227d commit e7f174d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ project is create with `flutter create -t plugin --platforms=linux,macos,windows

## How to Use

- Add [fvp](https://pub.dev/packages/fvp) in your pubspec.yaml dependencies: `flutter pub add fvp`. Since flutter 3.27, fvp must be a direct dependency in your app's pubspec.yaml.
- **(Optional)** Add 2 lines in your video_player examples. Without this step, this plugin will be used for video_player unsupported platforms(windows, linux), official implementation will be used otherwise.
- Add [fvp](https://pub.dev/packages/fvp) in your pubspec.yaml dependencies: `flutter pub add fvp`. Since flutter 3.27, fvp must be a direct dependency in your app's pubspec.yaml, and `video_player_avfoundation` is also required if you want official implementation for iOS and macOS.
- **(Optional for flutter < 3.27 and fvp <= 0.28)** Add 2 lines in your video_player examples. Without this step, this plugin will be used for video_player unsupported platforms(windows, linux), official implementation will be used otherwise.

```dart
import 'package:fvp/fvp.dart' as fvp;
Expand Down
2 changes: 2 additions & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ dependencies:
flutter:
sdk: flutter
video_player: ^2.6.1
video_player_avfoundation: any
#video_player_android: any

fvp:
# When depending on this package from a real application you should use:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ flutter:
# All these are used by the tooling to maintain consistency when
# adding or updating assets for this project.
plugin:
implements: video_player
#implements: video_player # flutter 3.27+ can only select 1 implementation
platforms:
android:
package: com.mediadevkit.fvp
Expand Down

0 comments on commit e7f174d

Please sign in to comment.