Jump to content
Sign in to follow this  
CaptWeirdBeard

html5 master audio player controlled by separate play buttons

Recommended Posts

Hi I wasn't sure exactly how to ask this so I made up a couple of mock-up pictures to help.

I am making an audio website and currently I have each song in an html file being called into a list. they each have their own audio player. Works fine, but is a bit cluttered with many players on screen when the list is large.

current.jpg

I would really like to have a master audio player in the header and each song in the list has just a play button when clicked will play the song in the main audio player at the top as shown below.I will have the main player at the top in a sticky/floating header so it remains on top and is always visible when scrolling.

want.jpg

I hope this makes sense. Any help or guidance/tutorial links on how I can adjust things to achieve this would be greatly appreciated. Thanks

Share this post


Link to post
Share on other sites

Position the header div at the top with absolute and have your songs scroll under it.

Share this post


Link to post
Share on other sites

What kind of discussion do you want them to have? Your OP is vague

Edited by niche

Share this post


Link to post
Share on other sites

You can have Javascript create a set of audio elements and attach the one currently being used. You can have it so that when a button is clicked all the audio elements stop playback before it changes the elements.

Here's an introduction to controlling audio with Javascript.

https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_HTML5_audio_and_video#Controlling_media_playback

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...