Search code examples
laravel-bladesingle-page-applicationhtml5-audio

How can i play audio across a mulit-paged website


I'm making a music streaming website and i want to play the song, I can play my song in one page but the problem is when I visit another page the song stops. And im using php laravel and blade to develop my website. how can i fix this problem?

I know that using SPA (single page application) will solve my problem but I already made my wesbite and finshed my ui as a multi-page application and I'm trying to see if there is a way without re-strating from the beginning uisng SPA.


Solution

  • The classic way to build this would be with a <frameset>. It's deprecated but I doubt it will ever be removed from browsers since it's probably used a lot by existing pages out there.

    You would need to put your player in one frame and the existing website in another one. The player stays alive while you can navigate the website as usual.

    A bit more modern approach would be a full page player which hosts the existing website in an <iframe>.