Have you ever wanted to automatically stop video playback on Android-device after a certain time? You might want to fall asleep with a movie, but not drain your battery all night. Or limit viewing time for your child. In this article, we will look at all the possible ways to set a timer on a video - from built-in functions to third-party applications with advanced settings.

Standard players Android rarely offer a built-in sleep timer, but there are workarounds. We tested solutions for different OS versions (from Android 8.0 to Android 14) and collected working methods. Important: some methods require superuser rights or installing additional software, but there are also completely free options without root.

If you are looking for a way to turn off a video after 30 minutes, an hour or a specific time, you will find detailed instructions here. And if you need to not just stop playback, but completely turn off the screen or put the device into sleep mode, we have solutions for that too.

Many users do not know that the application Google Photos (and some standard galleries from manufacturers) has a hidden timer function. It does not work for all video formats, but it supports popular .mp4 and .mkv.

To activate the timer:

  • ๐Ÿ“ฑ Open the video in Google Photos and click on the three dots in the upper right corner.
  • โฑ๏ธ Select item Sleep timer (in some versions - Auto stop).
  • โฐ Set the time: 15/30/45/60 minutes or At the end of the video.
  • ๐Ÿ”„ Confirm your choice - the timer will start counting down from the moment you press Play.

Method limitations:

  • โŒ Works only in the background (if minimized application, the timer will be reset).
  • โŒ Does not support 4Kvideo and files with a bitrate higher than 20 Mbit/s.
  • โŒ On some devices (Xiaomi, Huawei) the function may missing.
๐Ÿ’ก

If the item Sleep Timer is not in the menu, update Google Photos to the latest version in Play Market.

2. Using the "Sleep Timer" application. (without root)

For those who need more flexibility, a third-party application is suitable Sleep Timer from Urbandroid. It can not only stop the video, but also:

  • ๐ŸŽต Stop music (YouTube Music, Spotify).
  • ๐Ÿ“ฑ Turn off the screen or switch the phone to Do Not Disturb mode Do not disturb.
  • โฒ๏ธ Set the timer accurate to the second (maximum 24 hours).
  • ๐Ÿ”„ Work on top of other applications (you need to give permission in the settings).

Step-by-step guide:

  1. Download Sleep Timer from Play Market (free version with advertising).
  2. Run the video in any player (VLC, MX Player, standard).
  3. Open Sleep Timer and click + Add timer.
  4. Select an action: Stop media โ†’ specify the time โ†’ Start.
  5. Return to the video - the timer will run in the background.

Give the app permission to "Display on top of other windows"|Disable battery optimization for Sleep Timer|Check compatibility with your player|Set up a notification when the timer ends

-->

App supports automatic recognition running media files, but some players (for example, YouTube) require manual configuration via ADB.

How to set up Sleep Timer for YouTube?

To work with YouTube need to be enabled Accessibility Service in the settings Sleep Timer:

  1. Go to Settings โ†’ Accessibility โ†’ Sleep Timer.
  2. Activate the switch.
  3. Go back to the application and select the action Stop YouTube.

Without this, the timer will not be able to close the application.

3. Timer via Tasker (for advanced users)

If you need it fully automate process (for example, stopping a video at the same time every day) is suitable Tasker. This application allows you to create complex scenarios based on triggers.

Setting algorithm:

  1. Install Tasker and plugin AutoInput (to emulate clicks).
  2. Create a new task (+ โ†’ New task).
  3. Add action: Media โ†’ Stop.
  4. Set a time trigger: Profile โ†’ Time.
  5. Save the task and activate it.

Advantages method:

  • โœ… Works with any players, including YouTube i Netflix.
  • โœ… Can be configured repeating timer (for example, every day at 23:00).
  • โœ… Supports conditional logic (for example, stop the video only when connected to Wi-Fi).

VLC|MX Player|Standard player|YouTube|Other-->

Tasker requires time to study, but provides maximum flexibility. To simplify, you can download ready-made profiles from the community (for example, on TaskerNet).

โš ๏ธ Attention: To work Android 12+ for work Tasker with media functions, you must manually give permission Managing media sessions in the application settings.

4. Built-in functions of VLC and MX Player players

Popular players VLC and MX Player have built-in sleep timers, but they are hidden deep in the settings. Let's consider both options.

VLC for Android

Instructions:

  1. Open the video in VLC.
  2. Click on the icon โ‹ฎ (three dots) โ†’ Sleep timer.
  3. Select time or configure Custom (up to 240 minutes).
  4. The timer will start counting after press Play.

MX Player

Here the function is called Auto stop:

  1. During playback, swipe up to open the toolbar.
  2. Click on the icon โฐ โ†’ select the time.
  3. To cancel the timer, press โฐ again.

Comparison of capabilities:

Function VLC MX Player
Max. timer time 240 min 120 min
Work in the background โœ… Yes โŒ No
4K HDR support โœ… Yes โš ๏ธ Partially
Automatic repeat โŒ No โœ… Yes

MX Player may conflict with energy-saving modes on devices Samsung i OnePlus โ€”the timer is reset when optimizing the battery.

5. Timer via ADB commands (for technical users)

If you do not want to install third-party applications, you can use ADB (Android Debug Bridge) to send a command to stop playback. This method works on any device with enabled USB debugging.

Instructions:

  1. Connect the phone to the PC and activate Developer mode (click on Build number 7 times settings).
  2. Enable USB debugging in Settings โ†’ System โ†’ For developers.
  3. On a PC, open a terminal and enter:
    adb shell input keyevent KEYCODE_MEDIA_PAUSE

    This command simulates pressing the pause button.

  4. To automate the process, create a .batfile with a timer:
    timeout /t 1800 & adb shell input keyevent KEYCODE_MEDIA_PAUSE

    Here 1800 โ€” time in seconds (30 minutes).

Advantages of the method:

  • โœ… Does not require installation of additional applications.
  • โœ… Works on any version of Android.
  • โœ… Can be integrated with Tasker or Automate.
โš ๏ธ Attention: Commands ADB require a permanent connection to a PC or wireless debugging settings. On some devices (Huawei, Xiaomi), you need to additionally enable debugging in Security Settings.

Comparison of all methods: which one to choose?

The choice of method depends on your needs:

  • ๐ŸŽฌ For one-time use the built-in timer is suitable for VLC or MX Player.
  • โฐ For daily automatic shutdown โ€” Tasker or Sleep Timer.
  • ๐Ÿ’ป For technical userswho do not want to install software - ADB.
  • ๐Ÿ‘ถ For controlling children's time โ€” Sleep Timer with the screen lock function.

If you need not just to stop the video, but turn off completely devicecombine Sleep Timer with the application MacroDroid (to create a chain of actions).

๐Ÿ’ก

For maximum reliability, use a combination of VLC (built-in timer) + Tasker (backup shutdown).

Frequent problems and their solutions

Even with the correct setting of the timer may not work. Considered errors and ways to fix them:

Problem 1: The timer is reset when the screen is locked.

  • ๐Ÿ”น Disable Battery optimization for the player in the settings.
  • ๐Ÿ”น In Sleep Timer activate the option Work in the background.
  • ๐Ÿ”น For VLC: enable Do not stop playback when locked in the settings.

Problem 2: The timer does not work in YouTube.

  • ๐Ÿ”น Use YouTube Vanced (if available) or NewPipe โ€”they support background playback.
  • ๐Ÿ”น In Sleep Timer select action Close application instead of Stop media.

Problem 3: The Android 13+ timer stops working after updating.

  • ๐Ÿ”น Check permissions for the application in Settings โ†’ Applications โ†’ Special access.
  • ๐Ÿ”น Update the player and Sleep Timer to the latest versions.
โš ๏ธ Attention: On devices with MIUI (Xiaomi) and EMUI (Huawei) you may need to manually add applications to the list Autostart and No battery limitations.
Is it possible to set a timer on a YouTube video without third-party applications?

No, the standard application YouTube does not support a sleep timer. Alternatives:

  • Use the web version YouTube in a browser with an extension AutoStop (for PC).
  • Install NewPipe โ€”there is a built-in timer.
  • Set Tasker to close the application by time.
Why does the timer in VLC reset after a pause?

This is a known bug in the versions VLC below 3.5.0. Update the application or:

  1. Stop the video instead of pausing (button Stop).
  2. Use an external timer (Sleep Timer).
How to make the phone turn off after the end of the video?

For This requires a combination of two actions:

  1. Set Sleep Timer to stop the video.
  2. Create a task in Tasker or MacroDroid to turn off the screen after stopping the media.

Example of a macro for MacroDroid:

Trigger: Stop playback (Media Session)

Action: Turn off the screen (Display Off)

Is there a way to set a timer on a video in Telegram?

Yes, but with limitations:

  • In the official client Telegram there is no timer.
  • Use Sleep Timer with the action Close Telegram.
  • For local files download the video and open it in VLC.
Is it possible to set a timer on a video in Netflix or Disney+?

Streaming services block access to system media buttons, therefore:

  • ๐Ÿ”น Use Sleep Timer with action Close the application.
  • ๐Ÿ”น Set Tasker to simulate pressing Back after a specified time.
  • ๐Ÿ”น On Android TV use function Sleep by timer in the system settings.