Skip to content

Commit

Permalink
[various] Update examples using video_player (#5653)
Browse files Browse the repository at this point in the history
Updates examples in other packages (image_picker, camera) that use the deprecated `VideoPlayerController.network` to use the newer `VideoPlayerController.networkUrl` instead.

Fixes flutter/flutter#127754
  • Loading branch information
stuartmorgan authored Dec 12, 2023
1 parent 8411522 commit bf6c32c
Show file tree
Hide file tree
Showing 20 changed files with 31 additions and 38 deletions.
4 changes: 4 additions & 0 deletions packages/camera/camera/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.10.5+7

* Updates example app to use non-deprecated video_player method.

## 0.10.5+6

* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0.
Expand Down
6 changes: 1 addition & 5 deletions packages/camera/camera/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -986,11 +986,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
}

final VideoPlayerController vController = kIsWeb
// TODO(gabrielokura): remove the ignore once the following line can migrate to
// use VideoPlayerController.networkUrl after the issue is resolved.
// https://github.com/flutter/flutter/issues/121927
// ignore: deprecated_member_use
? VideoPlayerController.network(videoFile!.path)
? VideoPlayerController.networkUrl(Uri.parse(videoFile!.path))
: VideoPlayerController.file(File(videoFile!.path));

videoPlayerListener = () {
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies:
flutter:
sdk: flutter
path_provider: ^2.0.0
video_player: ^2.1.4
video_player: ^2.7.0

dev_dependencies:
build_runner: ^2.1.10
Expand Down
3 changes: 1 addition & 2 deletions packages/camera/camera/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A Flutter plugin for controlling the camera. Supports previewing
Dart.
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
version: 0.10.5+6
version: 0.10.5+7

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down Expand Up @@ -34,7 +34,6 @@ dev_dependencies:
sdk: flutter
mockito: 5.4.3
plugin_platform_interface: ^2.0.0
video_player: ^2.0.0

topics:
- camera
4 changes: 4 additions & 0 deletions packages/camera/camera_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.10.8+15

* Updates example app to use non-deprecated video_player method.

## 0.10.8+14

* Fixes `pausePreview` null pointer error. `pausePreview` should not be called
Expand Down
6 changes: 1 addition & 5 deletions packages/camera/camera_android/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -994,11 +994,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
}

final VideoPlayerController vController = kIsWeb
// TODO(gabrielokura): remove the ignore once the following line can migrate to
// use VideoPlayerController.networkUrl after the issue is resolved.
// https://github.com/flutter/flutter/issues/121927
// ignore: deprecated_member_use
? VideoPlayerController.network(videoFile!.path)
? VideoPlayerController.networkUrl(Uri.parse(videoFile!.path))
: VideoPlayerController.file(File(videoFile!.path));

videoPlayerListener = () {
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera_android/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
flutter:
sdk: flutter
path_provider: ^2.0.0
video_player: ^2.1.4
video_player: ^2.7.0

dev_dependencies:
build_runner: ^2.1.10
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Android implementation of the camera plugin.
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22

version: 0.10.8+14
version: 0.10.8+15

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down
4 changes: 4 additions & 0 deletions packages/camera/camera_android_camerax/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.5.0+24

* Updates example app to use non-deprecated video_player method.

## 0.5.0+23

* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0.
Expand Down
6 changes: 1 addition & 5 deletions packages/camera/camera_android_camerax/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -971,11 +971,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
}

final VideoPlayerController vController = kIsWeb
// TODO(gabrielokura): remove the ignore once the following line can migrate to
// use VideoPlayerController.networkUrl after the issue is resolved.
// https://github.com/flutter/flutter/issues/121927
// ignore: deprecated_member_use
? VideoPlayerController.network(videoFile!.path)
? VideoPlayerController.networkUrl(Uri.parse(videoFile!.path))
: VideoPlayerController.file(File(videoFile!.path));

videoPlayerListener = () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies:
camera_platform_interface: ^2.2.0
flutter:
sdk: flutter
video_player: ^2.4.10
video_player: ^2.7.0

dev_dependencies:
espresso: ^0.2.0
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera_android_camerax/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: camera_android_camerax
description: Android implementation of the camera plugin using the CameraX library.
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android_camerax
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
version: 0.5.0+23
version: 0.5.0+24

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down
3 changes: 2 additions & 1 deletion packages/camera/camera_avfoundation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 0.9.13+8

* Updates example app to use non-deprecated video_player method.
* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0.

## 0.9.13+7
Expand Down
6 changes: 1 addition & 5 deletions packages/camera/camera_avfoundation/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -994,11 +994,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
}

final VideoPlayerController vController = kIsWeb
// TODO(gabrielokura): remove the ignore once the following line can migrate to
// use VideoPlayerController.networkUrl after the issue is resolved.
// https://github.com/flutter/flutter/issues/121927
// ignore: deprecated_member_use
? VideoPlayerController.network(videoFile!.path)
? VideoPlayerController.networkUrl(Uri.parse(videoFile!.path))
: VideoPlayerController.file(File(videoFile!.path));

videoPlayerListener = () {
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera_avfoundation/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
flutter:
sdk: flutter
path_provider: ^2.0.0
video_player: ^2.1.4
video_player: ^2.7.0

dev_dependencies:
build_runner: ^2.1.10
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera_avfoundation/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: camera_avfoundation
description: iOS implementation of the camera plugin.
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_avfoundation
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
version: 0.9.13+7
version: 0.9.13+8

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down
3 changes: 2 additions & 1 deletion packages/image_picker/image_picker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 1.0.5

* Updates example app to use non-deprecated video_player method.
* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0.

## 1.0.4
Expand Down
6 changes: 1 addition & 5 deletions packages/image_picker/image_picker/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ class _MyHomePageState extends State<MyHomePage> {
await _disposeVideoController();
late VideoPlayerController controller;
if (kIsWeb) {
// TODO(gabrielokura): remove the ignore once the following line can migrate to
// use VideoPlayerController.networkUrl after the issue is resolved.
// https://github.com/flutter/flutter/issues/121927
// ignore: deprecated_member_use
controller = VideoPlayerController.network(file.path);
controller = VideoPlayerController.networkUrl(Uri.parse(file.path));
} else {
controller = VideoPlayerController.file(File(file.path));
}
Expand Down
2 changes: 1 addition & 1 deletion packages/image_picker/image_picker/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:
path: ../
image_picker_platform_interface: ^2.8.0
mime: ^1.0.4
video_player: ^2.1.4
video_player: ^2.7.0

dev_dependencies:
build_runner: ^2.1.10
Expand Down
2 changes: 1 addition & 1 deletion packages/image_picker/image_picker/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for selecting images from the Android and iOS image
library, and taking new pictures with the camera.
repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
version: 1.0.4
version: 1.0.5

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down

0 comments on commit bf6c32c

Please sign in to comment.