I was using video_player
to do the rest of the metadata extraction I need but I didn’t find a way to get the resolution with this package.
I was using video_player
to do the rest of the metadata extraction I need but I didn’t find a way to get the resolution with this package.
2
Answers
VideoPlayerController
is aValueNotifier<VideoPlayerValue>
and theVideoPlayerValue
has asize
property that reports the size of the video.https://github.com/flutter/packages/blob/f5a45177034bff79d7df07a85077218774aa4a80/packages/video_player/video_player/lib/video_player.dart#L42
You can add a listener to the
VideoPlayerController
and be notified when the value changes. Depending on the source, the size of the video can change too (for example if it’s a HLS stream with multiple variants).