Xiaomi smartphone users often face the challenge of listening to a video track, podcast or lecture without keeping the device screen permanently on. Google’s standard platform policy blocks background playback for free accounts, forcing gadget owners to look for workarounds. MIUI and HyperOS device owners have unique system customization tools that allow them to bypass these restrictions without installing suspicious software.
In this article, we will take a look at all the legal and technical ways to implement the background of a video player. We will look at the built-in shell features, special features settings and system parameters that are often hidden from the eyes of the average user. Understanding the background processes in Android will help you not only listen to music, but also optimize battery consumption.
Many methods don't require root rights or complex flashing, but you need to fine-tune the power saving and permissions for a particular application, and we'll look at why the system can force YouTube to close when the screen is turned off, and how to give the app a green light to work in the background.
Use of the built-in Picture-in-Picture (PiP) function
The easiest and most legal way to continue watching or listening to content when switching to other tasks or turning off the screen is Picture-in-Picture mode, which is built into the Android kernel and is fully supported by the MIUI shell. However, by default, it can be disabled or malfunction due to aggressive battery optimization.
To activate, you need to go to the system settings of the smartphone. Find the section responsible for special features or window management. You need to find the Picture-in-Picture item and make sure that the switch is activated. Without this step, the application will not be able to curl up into a floating window, which often allows you to continue buffering audio even when minimized.
Then you have to configure the YouTube app itself. In the smartphone settings menu, find a list of installed apps, select video hosting, and go to the additional settings section. Make sure that permission to use PiP mode is enabled. Some versions of the shell require separate confirmation for each application.
⚠️ Note: Some global versions of the firmware MIUI Picture-in-Picture for YouTube can only work for Premium subscribers, in which case the system will show a black window or stop playback when you try to fold the application.
If the standard path doesn't work, try activating developer mode. To do this, click seven times on the build number in the About Phone section. Then, in the advanced settings, look for the Developer section and look for options related to forced PiP on all applications. This can help bypass software locks.
- 📱 Go to Settings. → Annexes → All applications.
- 🎬 Find YouTube in the list and select “Additional Permissions».
- 🖼️ Activate the Picture-in-Picture Switch».
- 🔋 Turn off energy savings for this app in the Battery section».
After you do this, when you fold the video, you have to have a floating window. To turn off the screen, just press the lock button. If the video keeps going, it works. In some cases, you have to start the video, roll it up, and then turn it off.
Autostart settings and no battery limitations
The main enemy of the background processes on Xiaomi smartphones is the aggressive energy saving system, which seeks to shut down any application that consumes resources when the device’s screen is turned off. For YouTube to work in the background, it needs to be granted exclusive rights, effectively equating it with system processes.
The first step is to set up autostart. Find the Apps section in the settings menu and select Autostart. In the list that appears, find YouTube and activate the switch, which will allow the app to run the necessary services immediately after the phone is turned on and restore after cleaning the memory.
The next critical step is to remove the battery constraints. Go to YouTube's settings, select Energy Saving (or Battery) and set "No Limits." The standard Charge Saving mode will kill the playback as soon as you lock the screen.
☑️ Power Saving Settings for YouTube
It is also recommended to lock the application in RAM: Open the menu of running applications (bottom-up swipe and retention), find a YouTube window, click on the lock icon or hold your finger for a preview until the lock icon appears, this will prevent the application from being accidentally cleaned by the system.
Remember that even with these settings, some versions of the app may not correctly determine the state of the screen. If the video stops a few seconds after blocking, try running the video, rolling it up in a PiP, waiting 5-10 seconds, and then locking the screen, which gives the system time to switch the audio stream to the background.
Use of special facilities and access services
The MIUI and HyperOS shells have powerful tools for people with disabilities that can be adapted to manage multimedia. The Special Features section contains features that allow applications to control the screen and audio output even when rolled up.
First, look at the voice control or voice access feature, which, while designed to be touchless, often changes the priorities of Android audio, and enabling these services can prevent audio from blocking when the display is turned off.
Another method is to activate this service and set it to run on a volume button or triple tap, the system will assume that the user is interacting with the interface, which can prevent the transition to deep sleep mode, blocking background tasks.
- 👁️ Open the Settings. → Advanced settings → Special facilities.
- 🔊 Enable Voice Management or similar access service.
- ⚙️ Provide the application with all requested permissions for imposition and access.
- 🔄 Restart the device to apply system changes.
There is also a lesser-known method, through Quick Commands: Create a script that automatically changes the screen or sound settings when you launch YouTube, which requires a deeper immersion in the system settings, but gives you flexible control over the behavior of the device.
Risks of using special opportunities
Table of comparison of background work methods
To make it easier for you to choose the right way, we have organized the basic methods into a comparative table, each with its advantages and disadvantages depending on the version of MIUI and the model of the smartphone.
| Method | Difficulty | Off-screen work | Requires a Premium. |
|---|---|---|---|
| Picture-in-Picture | Low. | Partially (depending on version) | Often. |
| Battery setup | Medium | Yes (with proper setup) | No. |
| Special opportunities | Tall. | Yeah (unstable) | No. |
| Browser mode | Low. | Yes. | No. |
As the table shows, the most stable method without using third-party software is a combination of properly configuring the battery and using the browser version of the site.The native YouTube app has the highest priority of blocking background tasks from Google servers.
It is important to consider that with each MIUI update, the memory algorithms change. What worked on MIUI 12 may require additional customization on HyperOS. Always check the relevance of the settings after a major system update.
Alternative Clients and Browser Solutions
If standard methods don't work, it makes sense to consider using alternative clients: YouTube's official app is the most "heavy" and limited. There are many open source projects that use the video hosting API but lack ad units and restrictions on background play.
One of the most popular solutions is the NewPipe project or its forks (like LibreTube), which do not require Google Play services to work, which significantly reduces battery consumption, allowing you to download video, listen to audio in the background and use the “Audio Only” mode.
To install such applications will need to download APK-file from the official website of the developer or through the F-Droid store. MIUI It can warn you of the dangers of installation from unknown sources, and you need to confirm the installation, because open source repositories are generally safe.
⚠️ Note: Installing modified YouTube clients may violate Google’s terms of use, use them at your own risk, especially if you value your primary account.
Another option is to use browsers that support extensions such as FirefoxBrave. Once you install the uBlock Origin extension or similar, you can open the mobile version of the site youtube.com. Browsers often do not block the sound when you turn off the screen, if the media settings allow background play.
- 🦊 Download Firefox browser from Google Play.
- 🧩 Install an addon to block ads.
- 🌐 Open YouTube in the full version of the page.
- 🎧 Start the video and turn off the screen – the sound should continue.
The good thing about the browser method is that it doesn't require any questionable software to be installed, but it can consume more CPU resources than a native application, which will result in faster battery discharge with prolonged listening.
Problems with MIUI Optimization and USB Debugging
For advanced users who are willing to take risks, there is a method to disable MIUI optimization.It is a deep system setup that changes how the operating system manages resolutions and background processes.Without disabling this option, some background work methods may be useless.
To access this menu, you need to activate the developer mode (click on the build number) and log in. At the bottom of the developer's settings list is the item "Enable MIUI Optimization." Disabling it will require a reboot and may reset some application permissions settings.
The path to the hidden menu:
Settings → The phone. → (7 times tap according to version MIUI) →
Additional → → For developers → Enable MIUI optimization (Off)Once optimisation is turned off, the system will become less aggressive with regard to background tasks, but this can lead to increased battery consumption as the control over applications will be weakened.
💡
Before disabling MIUI optimization, back up important data. In rare cases, after enabling this feature, some system applications may not work well or require reconfiguration of permissions.
Also worth mentioning is the ADB command, which allows you to change the behavior of the system without turning off optimization, and with the help of a computer and USB debugging, you can enter a command that prevents the system from killing the YouTube process, which requires a PC and basic knowledge of working with the command line.