Skip to content

[1P Packages] Update code samples of packages that use video_player in their examples.  #127754

@gabrielokura

Description

@gabrielokura

Since flutter/packages#3513 is adding a new URI-typed factory method, the following packages needs to update it's deprecated examples:

  • camera/camera
  • camera/camera_android
  • camera/camera_android_camerax
  • camera/camera_avfoundation
  • image_picker/image_picker
  • image_picker/image_picker_android
  • image_picker/image_picker_ios

The fix should be similar to this code

// deprecated
final VideoPlayerController vController = kIsWeb
        ? VideoPlayerController.network(videoFile!.path)
        : VideoPlayerController.file(File(videoFile!.path));
        
// fixed
final VideoPlayerController vController = kIsWeb
        ? VideoPlayerController.networkUrl(Uri.parse(videoFile!.path))
        : VideoPlayerController.file(File(videoFile!.path));

Also, this update will fix the analyze's tests:

[31mThe following packages had errors:�[0m
[31m  camera/camera�[0m
[31m  camera_android�[0m
[31m  camera_android_camerax�[0m
[31m  camera_avfoundation�[0m
[31m  image_picker/image_picker�[0m
[31m  image_picker_android�[0m
[31m  image_picker_ios�[0m
[31mSee above for full details.�[0m

Metadata

Metadata

Labels

P1High-priority issues at the top of the work listc: tech-debtTechnical debt, code quality, testing, etc.d: examplesSample code and demosp: cameraThe camera pluginp: image_pickerThe Image Picker plugin.packageflutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionteam-ecosystemOwned by Ecosystem team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions