How to set a timer to automatically stop playing music or videos on your iPhone

Learn how to automatically stop playing music, video or other media on your iPhone or iPad when a timer runs out, like before you usually fall asleep.

iPhone screen showing a song playing with play and pause icons in the background

White noise and calming music help me fall asleep, but I don’t want the audio playing for longer than 20-30 minutes. Setting a sleep timer to automatically stop playing media before you fall asleep is super handy, so let’s show you how to do that.

Set a sleep timer for music, videos, and movies

You can set a sleep timer to automatically stop playing media at a designed time in Apple’s built-in Clock app by following the instructions below.

  1. Open the Clock app on your iPhone and select the Timers tab at the bottom.
  2. Tap When Timer Ends. This is where you’d normally select the timer sound.
  3. Scroll to the bottom, select Stop Playing, and hit Set in the top-right corner.
  4. Set your timer and hit the Start button to run it.
Setting timer to stop playing media on iPhone

If you’re listening to music or watch a movie, playback will stop automatically when the timer is up. To create a timer with a ringtone instead, be sure to turn off the “Stop Playing” action and choose a timer sound; I can’t tell you how many times I’ve set a cooking timer that never rang because I left it on Stop Playing.

Sleep-based audio control with AirPods

AirPods settings on iPhone with the option to automatically pause media playback when falling asleep turned on.
AirPods can stop the music if you’re sleeping. Image: Christian Zibreg/iDB/Apple

If you wear your AirPods 4 or AirPods Pro 2 in bed, they can automatically pause audio when you fall asleep. You’ll need to update your iPhone to iOS 26 when it drops this fall to get the feature. Sleep-based audio control on AirPods is a new capability which works independently of the timer function in the Clock app.

Also, check out: