This demo uses the native
audio HTML element and the MediaSession API. Both are widely supported across browsers and platforms. In other words, Progressive Web Apps are an excellent choice for your audio and music players. With one single code base, your audio player will work natively on nearly all mobile and desktop devices. The implementation is also extremely simple — this entire demo is less than 100 lines of code.
With the native
audio HTML element, you can play audio in the browser (or in an installed PWA). With the MediaSession API, you can make this
audio element controllable from the device's lock screen or notification tray (on iOS or Android) or via the dedicated desktop audio player interfaces (on macOS and Windows).