Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0
Ursule

Block ios audio player for a blog post

Question

5 answers to this question

Recommended Posts

  • 1
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

Share this post


Link to post
  • 1
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

Share this post


Link to post
  • 0
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

Share this post


Link to post
  • 0
On 3/18/2020 at 1:57 PM, humxahafeex said:

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

Hello @humxahafeex, it worked!!

Thank you so much!

Ursule

Share this post


Link to post

Create an account or sign in to comment

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


×
×
  • Create New...