Hello iñaki97,
Thanks for asking the Apple Support Communities for help with your iPhone. Thanks for the video example as well.
Is this occurring with Auto-Brightness enabled? Adjust the brightness on your iPhone, iPad, or iPod touch - Apple Support
If you have Automatic brightness enabled, I recommend disabling it, restarting, and then testing. Restart your iPhone - Apple Support
Test with Auto-Brightness enabled and disabled. If it is currently disabled, enable it, restart, and then disable it again, then test.
- Your info shows iOS 12, so you can turn Auto-Brightness on or off in Settings > General > Accessibility > Display & Text Size.
- For devices with iOS 13, you can turn Auto-Brightness on or off in Settings > Accessibility > Display & Text Size
Also, ensure there is nothing blocking the ambient light sensor on your device. Some third-party screen cases and screen protectors may block the sensor. You may need to remove them and test again. Get help with the display on your iPhone, iPad, or iPod touch - Apple Support
Thanks and have a wonderful day.