Switching tracks in background on locked iphone

My web app plays a playlist of multiple tracks. It plays just fine on a PC or on an active IPhone. But when an iphone gets locked tracks stop switching and continue automatically only when I unlock it and open the browser.


I know there might be some restrictions to doing things on a locked iphone, but I feel like many websites are able to do that. Is there a way to play longer playlists on a locked iphone?