Background music on a homepage

This forum is for general questions about extensions for Joomla! 3.x.

Moderators: pe7er, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Post Reply
papakota
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Fri Aug 19, 2016 7:54 pm

Background music on a homepage

Post by papakota » Mon Jul 22, 2019 5:11 pm

Hello everybody!
I want to have a background music played on my site's homepage. Preferably without the controls. So that the music would start playing on its own (ie, without user's interaction). I tried different things, but all in vain so far. Tried to insert an audio HTML5 code into Joomla's Custom HTML module. Also tried an extension from K2 AllVideos. I heard that Firefox "doesn't like" mp3 format? So I also have the same audio file in .ogg (just in case). And another thing. I read online somewhere that browsers don't allow sites to play music without it being started by sites' visitors, ie without them pushing "PLAY" button first? Like there's some special JS code that helps to overcome that obsticle in a way that the code triggers the player to start playing music. I've got K2 component on my site, so these aren't the regular Joomla articles, but K2 "items". Don't know if that makes any difference in this regard... Also I'm aware that there's an option of inserting directly an audio HTML5 code into body of index.php file of current Joomla template. Though I'm not sure how to do that?
Thanks in advance!

papakota
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Fri Aug 19, 2016 7:54 pm

Re: Background music on a homepage

Post by papakota » Mon Jul 22, 2019 6:41 pm

UPDATE.
Well, I'd found some nice Joomla plugin, which I inserted into K2 item (article). And it's supposed to autoplay, but it doesn't. 'cos Firefox by default blocks autoplaying. So should I use the JS code to bypass that browser restriction? If yes, then how exactly?

User avatar
bruno28
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 231
Joined: Wed May 16, 2012 5:41 am
Location: Chartres, France
Contact:

Re: Background music on a homepage

Post by bruno28 » Mon Jul 22, 2019 7:55 pm

Hello papakota

Why do you want to do that.It is not a good practice and will disturb most of your visitors. It is better to let users activate the sound themselves.

But if you want that way, did you search in the jed : https://extensions.joomla.org/tags/audi ... s-gallery/

Bruno
Cordialement, Bruno28 :)
Joomla! 3.9.11 - php 7.3
https://www.bp2i.fr/ - https://www.moneglisesurle.net/

papakota
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Fri Aug 19, 2016 7:54 pm

Re: Background music on a homepage

Post by papakota » Mon Jul 22, 2019 8:34 pm

Seems that even JS code won't help. But maybe if someone know the way to bypass this issue please do let me know!
bruno28, we won't get into an argument whether it's worth to autoplay. That's MY site and I'm the boss there :-)
As per your link to JED with different music player... Like I said, the limitation is in the browser, so changing a player probably won't help...

User avatar
bruno28
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 231
Joined: Wed May 16, 2012 5:41 am
Location: Chartres, France
Contact:

Re: Background music on a homepage

Post by bruno28 » Tue Jul 23, 2019 5:03 am

Hello papakota

Sorry for the comment of yesterday, I was just trying to help :(

You are right, this is YOUR site and you are the boss in it :) ;)

I don't know JS code so I can't help you in this but I am sure someone else will help you

Have a good day

Bruno
Cordialement, Bruno28 :)
Joomla! 3.9.11 - php 7.3
https://www.bp2i.fr/ - https://www.moneglisesurle.net/

User avatar
bruno28
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 231
Joined: Wed May 16, 2012 5:41 am
Location: Chartres, France
Contact:

Re: Background music on a homepage

Post by bruno28 » Tue Jul 23, 2019 5:09 am

I found this :

joomla.stackexchange.com/questions/24957/background-music-on-a-homepage

forums.tomsguide.com/faq/how-can-i-add-background-music-on-my-homepage.345268/

It may help you

Bruno
Cordialement, Bruno28 :)
Joomla! 3.9.11 - php 7.3
https://www.bp2i.fr/ - https://www.moneglisesurle.net/

User avatar
AMurray
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4883
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Background music on a homepage

Post by AMurray » Tue Jul 23, 2019 9:21 am

Well the user can easily mute their speakers ;) - but one reason (and a courtesy really) to let users decide to play background music on a website, and not have it forced on them, is they may already be listening to music of their own choice.

So as you have found, browsers these days can prevent such auto-playing, and even if you have Javascript to override that behaviour, one can always block that Javascript in their browser options and you're back where you started.
Regards,
--------------------------------------------------------------
A Murray
Millennium Falcon - it's the ship that made the Kessel run in less than 12 parsecs! The fastest hunk of junk in the galaxy.


Post Reply

Return to “Extensions for Joomla! 3.x”