flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
162.18k stars 26.64k forks source link

video_player does not give access to the file resolution? #147471

Closed stephane-archer closed 2 weeks ago

stephane-archer commented 2 weeks ago

Use case

VideoPlayerController controller = new VideoPlayerController.file(myfile);
controller.value.duration ; // OK
controller.value.size ; // OK
controller.value.resolution; // is not working

Proposal

up

moffatman commented 2 weeks ago

Isn't that just size? What do you mean by resolution?

stephane-archer commented 2 weeks ago

@moffatman Sorry, you are probably right but I found size.height and size.width to be equal to zero so I'm not sure what I'm missing

moffatman commented 2 weeks ago

Size should be there after you initialize() the controller.

stephane-archer commented 2 weeks ago

@moffatman thank you so much you are the best

tldr:

VideoPlayerController controller = VideoPlayerController.file(myFile);
await controller.initialize();
print(controller.value.size.height);
print(controller.value.size.width);
github-actions[bot] commented 3 days ago

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.