Jump to content

Audio Blocks opening new window in IOS

Go to solution Solved by paul2009,

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
  • Solution
On 11/8/2021 at 9:13 PM, 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?

On iOS devices (iPhones, iPads) Audio Blocks detect that iOS is being used and they default to the built-in iOS player that opens on a new page. 

You should be able to stop this by using some code to tell the Squarespace Audio Block that the visitor is not using iOS. This should prevent the block attempting 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: This was tested on a Squarespace 7.1 site running Safari on iOS 15.

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

Edited by paul2009

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

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. 

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

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.