Jump to content

Block ios audio player for a blog post

Recommended Posts

  • Replies 6
  • Created
  • Last Reply
On 3/17/2020 at 2:51 AM, Ursule said:

Site URL: https://www.tamtamdeliberte.com/echos-libres/episode-1-demystifions-la-sante-mentale

Hi guys,

I'm looking for a way to block the ios player when listening to an audio block in a blog post. When clicking on the play button, it opens up in a different page.

On Android, the audio plays on the same page. iOS behaves differently.

Any thoughts?

Thanks

Ursule

Hi @Ursule It's quite easy to fix this issue ,It's very old issue with audio blocks on Squarespace, on some IOS version audio blocks behaves like this there is a simple fix to this problem , Simple paste the following code block to Settings>Advance>Code Injection>HEADER  It will fix the problem right away.

<script>
 Y.on('domready', function(){Y.UA.ios=0;})
</script>

Hope it helps. Don't Forget to mark question as Solved. 

** Little Explanation for Nerds**

Squarespace uses YUI , In which Y.UA is a YUI's built in user agent which detects from which operating system the website is requested. So what we are doing here with our code is to force the UA(user agent) to set value to 0 which renders the page correctly on IOS.

For More Info :  https://yuilibrary.com/yui/docs/yui/yui-ua.html

 

#StrangeAudioBlockBehaviourSquarespace#AudioBlockOpenInSeperatePlayer#AudioBlockOpenInSeperateLink

Link to comment
3 hours ago, humxahafeex said:

Hi @Ursule It's quite easy to fix this issue ,It's very old issue with audio blocks on Squarespace, on some IOS version audio blocks behaves like this there is a simple fix to this problem , Simple paste the following code block to Settings>Advance>Code Injection>HEADER  It will fix the problem right away.


<script>
 Y.on('domready', function(){Y.UA.ios=0;})
</script>

Hope it helps. Don't Forget to mark question as Solved. 

** Little Explanation for Nerds**

Squarespace uses YUI , In which Y.UA is a YUI's built in user agent which detects from which operating system the website is requested. So what we are doing here with our code is to force the UA(user agent) to set value to 0 which renders the page correctly on IOS.

For More Info :  https://yuilibrary.com/yui/docs/yui/yui-ua.html

 

#StrangeAudioBlockBehaviourSquarespace#AudioBlockOpenInSeperatePlayer#AudioBlockOpenInSeperateLink

 

Hi @humxahafeex, thank you for your reply.

I tried that, but unfortunately it didn't work.

The audio block is in a blog post, not in the header. May be that's the reason? I don't know...

Thanks again.

Ursule

Link to comment
4 minutes ago, Ursule said:

 

Hi @humxahafeex, thank you for your reply.

I tried that, but unfortunately it didn't work.

The audio block is in a blog post, not in the header. May be that's the reason? I don't know...

Thanks again.

Ursule

Can you try 1 more thing go to Blog Page Settings >Advance >  Post Blog Item Code Injection and paste the code and check it on Private window 🙂 

add.PNG

Link to comment
  • 2 months later...

Trying to resolve this problem for standard audio blocks but the aforementioned code doesn't fix the problem for standard audio blocks. OnClick, the audio opens in a new page/iOS player on mobile.

 

Is there another header injection fix for standard audio blocks for mobile (iOS)?

Link to comment

Archived

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.