Jump to content

Coding to enable single track music on android and Apple devices

Recommended Posts

Site URL: https://www.stevelbanks.co.uk/

Hi, I found the code to continuously play the piano track Milan your hear when opening the 'Paintings' page on this site, but it does not like some mobile devices, especially Apple. I understand that Apple does not like the instant/continuous play of music tracks on website pages. Does anyone know of any coding solution or advice that may help to allow the music to play across all mobile devices please. Much appreciated.

This was some advice and conversation around the issue with a web developer contact:

Good afternoon Steve,  Below is the transcript of a discussion I had with an app developer - unfortunately web design is not his area however he was helpful.  It appears the web industry is in debate regarding whether auto-play music should be allowed so a number of browsers now have this disabled. Looking through various technical forums it appears this can be fixed, if you know what your doing but this includes Java scripting!.  The easiest fix may be to just add a start button that starts the music - this could be embedded within a statement that suggest the best viewing experience is accompanied by Sam’s tune? Sell it as  a visual audio experience!
Alternatively, you could have Matt drop a query to the SquareSpace technical forum as contributors seems really keen to help the less skilled, 
The addition of the link would be my approach however as this way you can guarantee the music is played if the viewer wishes,  whatever the browser!
Good luck,
Begin forwarded message:
From: Steve Lockwood <Steve.Lockwood@avantiplc.com>
Subject: mp3
Date: 10 September 2020 at 13:32:47 BST
You all right?
I'm hoping you can provide a little advice regarding CSS optimisation of mp3 for mobile devices?
Every used SquareSpace?
oh, that is something new
A friend has asked my why his website plays audio or a laptop but not mobile devices?
no, unfortunately have no experience with that
I can have a look when you provide me a link
the website is stevelbanks.co.uk  an artist I know who has a exhibition soon but his website is broke!
should it play background music on that page?
can't hear anything (edited) 
Interestingly just noticed that  the music stops if the pictures are displayed but the header information is moved off screen -
I'm using Linux machine, maybe it have problem with it too
let me check it on Windows, I'll get back to you soon
Thank you, any suggestion would be a great help
music actually plays nicely on my Android phone both in Firefox and Chrome browsers :smile:
works also under Edge browser on Windows
but is not working on Firefox, both Linux & Windows
it looks more like javascript/cross browser issue
mp3 itself is fine also, I can play it if I put link to mp3 directly in any browser, even Firefox
I can try dig deeper why it is not working on Firefox but mp3 itself looks good for me
Doesn't work on an iPad or IOS also, if this helps, thanks
Stack OverflowStack Overflow
Before I get flamed to death, I know this doesn't work currently due to Apple's concern over downloading an audio file automatically. However, my question is: Has anyone found a cunning workaround...
problem solved (edited) 
sound autoplay is disabled by default in most of the browsers
when I enabled it in my Firefox, mp3 is playing as expected
There is no chance to get autoplay working in mobile browsers. Android and iOS doesn't allow it and personally I think that is a feasible confinement! Imagine every second website you will open plays and ugly sound at start!
HI Pawel, This explain the issue, thank you for looking at this
Link to comment
  • Replies 0
  • Created
  • Last Reply


This topic is now archived and is closed to further replies.

  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.