Very random question, but how do you get YouTube videos to play just audio? Or are you just running the video in your pocket and only listening to the audio?
I just mount the phone on the handlebars and run the video at 144p with screen brightness turned down so it doesn't chew through too much data or battery, using one earbud only. I believe Youtube Premium allows you to play videos in the background or with screen off, and I think there are unofficial apps and workarounds to get the same functionality without that subscription, but I haven't felt the need to go down either path.
Here's a simple one: open YouTube in your phone's browser and switch the browser to desktop mode. Hope that works.
Not any browser though. If you use safari it doesn’t work.
"Not any browser though. If you use safari it doesn’t work."
On the contrary, through trial-and-error/messing-around, I figured out a long time ago how to play YouTube videos in audio-only mode in Safari on an iPhone. Here's how I do it on my current iPhone (iPhone 13):
Step 1: Start YouTube video in Safari (and get past ads, if any)
Step 2: Tap within video, then tap on double-arrow icon that appears in lower right.
Result A: Video now appears in letterbox mode, i.e., against black background entirely by itself with no title shown, no comments, no recommended/suggested videos, no advertisements, etc.
Step 3: **While letterbox-mode video is playing** (this procedure doesn't work if video is paused), press side button on right edge to switch off display
Result B: Display goes dark
Step 4: Press right-side edge button again to switch on display
Result C: The lock screen appears with an audio control bar toward the bottom (with play/pause, fast-forward, and rewind buttons, and showing time remaining and time elapsed)
Success! I now tap the play button, and I'm off to the races. I can switch the display off and on with the right-side edge button without interrupting the audio, and the audio control bar is always there on the lock screen when I switch the display back on. To listen to a different YouTube video, go back to Step 1.
The above sequence might seem rather involved, but after familiarization, one can blaze through it.
Glitch: Sometimes, Step 4 (press right-side edge button) fails to produce Result C (audio control bar appears on lock screen); or Result C is produced, but tapping the play button on the control bar results in a "Not Playing" error message. In that case, I tap/swipe "home" (and enter the passcode), which brings back Result A (letterbox mode); play the video a few seconds longer; and then repeat Steps 3-4. If that doesn't work, I do it again. And if that doesn't work, I tap/swipe "home" to bring back Result A (letterbox mode), tap on the screen, and tap on the X that appears at the top, which puts the video back into regular viewing mode (Step 1). I then play the video a few seconds longer and just go through the rest of the whole sequence again, i.e., Steps 2-4. Sometimes, in trying to clear the glitch, tapping/swiping "home" skips Result A (letterbox mode) and puts me all the way back to Step 1, in which case I just shrug and go through Steps 2-4 again. To reiterate, these steps can be performed a lot faster than one might think.
The above methods have never let me down so far, but depending on your iPhone model, iOS version, etc., your mileage/kilometerage/kilometreage may vary.