This isn’t necessarily because of the media player, this is because of the file format. As you mentioned yourself – when you render in mp4 it’s the same. There likely is a simple answer to this question, but it’s probably filled with technicalities that might even be unnecessary by today’s standards. At a surface level there are file formats that do use the full range of 0-255 and others that don’t. If the output file differs from your preview – the format simply by default has different values and calculations for Levels compared to your project.