Lior,
I found an issue concerning the quality and size badges.
Not all videos seem to have the standardized resolution, for example width
1280 x
1920 x
3840 x
Or height
x 720
x 1080
x 2160
4k videos I checked are not recognized as 4k with the following resolution:
3840 x 1600 or 3840 x 1608 or even 3840 x 2160 are displayed as 720p
Full HD
a video resolution 1918 x 802 is displayed as 720p
Maybe an approach could be:
1080p displayed if width > 1280 && height > 720
4k displayed if width > 1920 && height > 1080
Or maybe just use the terms:
HD
Full HD
4K
when the xxx p values don't match exactely
Same with smaller resolution if needed.