2

I'm trying to create a little HTML5 audio player, as many people do. So far so good, it is this simple:

<audio controls preload="auto" title="The title" src="https://dl.espressif.com/dl/audio/ff-16b-2c-44100hz.m4a">
</audio>

iOS is able to play/pause, seek (also in lock screen) and everything is working perfectly. A little extra HTML and JavaScript and even Playlists are not a problem any more at least in the browser - except one thing:

I did not find any way to make iOS 14 show enabled previos (⏮️) and next (⏭️) button, when the lock screen is active. What I've tried so far without success:

M3U Playlists

<audio controls preload="auto" src="a-playlist-with-3-files.m3u"></audio>

WebVTT with chapters

Reference: https://developer.mozilla.org/en-US/docs/Web/API/WebVTT_API

<audio controls preload="auto" title="a title">
    <source src="https://dl.espressif.com/dl/audio/ff-16b-2c-44100hz.m4a" title="a title">
    <track kind="chapters" src="chapters.vtt" label="Chapters">
</audio>

chapters.vtt

WEBVTT

00:01.000 --> 00:04.000
- Never drink liquid nitrogen.

00:05.000 --> 00:09.000
- It will perforate your stomach.

JavaScript stuff

Here is no code example, none of the APIs I found enabled the lock screen buttons for next and previous. Samples: https://ableplayer.github.io/ableplayer/ Libs: Howl, Tone.js, etc...

References / related questions may be:

But my question is just about enabling the next/prev buttons, not about pausing JavaScript - this seems to be resolved:

My question: (How) is it possible to enable next / prev in iOS lockscreen at the moment?

sandreas
  • 101
  • 1
  • 7
  • 1
    Here is solution: https://stackoverflow.com/questions/73993512/web-audio-player-ios-next-song-previous-song-buttons-are-not-in-control-cent I have success with it. – sincos Jan 05 '23 at 16:22

0 Answers0