Shubh Sheth Shubh Sheth - 1 year ago 149
HTML Question

How to add a music player like soundcloud

In soundcloud there is an audio player in the bottom which plays the song even if you go to other web pages I want to learn how add a constantly playing audio player in my website

Answer Source

The reason that this is possible on Soundcloud is because of a couple of things:

  1. is a single-page application, so your browser never refreshes as you load different pages. Thus, they are able to maintain a single HTML DOM context, in which they can place a music player. If the website was instead implemented as a more classic web application, with refreshes in between different pages, the music would stop every time you navigated to another page.
  2. The music player element you see on the bottom of the page has the CSS property position: fixed to keep it aligned to the bottom of the page, while other content within the page changes.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download