Jump to content

Audio Blocks opening new window in IOS

Recommended Posts

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

Hi there,

I just launched my new site which is an audio portfolio. I find that when I click on my audio blocks from an iphone it opens the player in a new window. When on a desktop it's fine. 

Is there a way to stop this from happening? So it just stays on the player on the main site page?

Any help would be much appreciated.

Thanks!

Eli

Edited by eliblock
Link to comment

This is most likely a relatively new issue for audio blocks. The audio blocks included by Squarespace are incredibly depreciated blocks and next to useless for modern uses in my opinion. Although, looking at your website, I do really like what you've done to customize them. My apologies if this seems rude but I'm very critical of these particular blocks and they need to be updated.

I'd recommend you raise issue with the performance to customer support and hopefully they revamp these blocks soon. Otherwise, the answer is no. On mobile, they're seen as independent files and cannot be played in the page itself. Not easily at least. I'd recommend using an external plugin or hosting them through SoundCloud. If not SoundCloud, the ElfSight audio widget is fantastic.  

Link to comment
12 hours ago, eliblock said:

When I click on my audio blocks from an iphone it opens the player in a new window. Is there a way to stop this from happening?

Yes, you should be able to stop this by telling Squarespace that you're not using iOS and so it does not attempt to invoke the built in iOS player.  To do this, add the following script to Settings > Advanced > Code Injection > Footer:

<script>
  window.addEventListener("load", function(){
    Y.UA.ios = 0; 
  })
</script>

Note: Tested on Squarespace 7.1 running Safari on iOS 15.

  If this post has helped you, please click a 'Like' or 'Thanks' icon below  ⬇️

Improve your online store with our extensions.
About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™.
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Buy me a coffee

Link to comment

Ah thanks Paul - code injection appears to be a premium feature?

Googling I came across this but have no idea - coding not my strong suit!!

//Prevent iOS from opening audio blocks in new window

<script>

Y.on('domready', function(){

Y.UA.ios = 0; //Y.UA object have test key for different platforms.

//Setting ios value to 0 here allow to skip default Audio Block's behavior

})

 </script>

 

Thanks for your help!

Link to comment
6 hours ago, eliblock said:

Googling I came across this

You’ve just posted a copy of what I’ve already provided so this isn’t anything new. You’re right that you can’t add script if you are on a Personal Plan, which means you won’t be able to change the audio block’s behaviour or use an alternative player. You will require a Business Plan. 

Improve your online store with our extensions.
About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™.
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Buy me a coffee

Link to comment
  • 2 weeks later...
On 11/9/2021 at 11:27 PM, paul2009 said:

You’ve just posted a copy of what I’ve already provided so this isn’t anything new. You’re right that you can’t add script if you are on a Personal Plan, which means you won’t be able to change the audio block’s behaviour or use an alternative player. You will require a Business Plan. 

Thanks Paul. Yes I got in touch with Squarespace, they were pretty unhelpful, seems upgrading to business is the only workaround, which seems a little short sighted to me. Thanks for the help!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • 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.