To use the
ResolutionDetector class, you first need to import the package:
Then, you can create an instance of the
ResolutionDetector class and call the
getMaxResolution method to get the maximum supported resolution of the device:
final ResolutionDetector resolutionDetector = ResolutionDetector(); MaxSupportedResolution? maxResolution = await resolutionDetector.getMaxResolution();
getMaxResolution method returns an instance of the
MaxSupportedResolution enum which can be one of
res720p. You can use this value to determine the maximum supported resolution of the device and adjust your video playback accordingly.
It is also important to note that the
getMaxResolution method is only called once and the result is stored in a cache for future usage, so it will not affect performance.