Ursule Posted March 16, 2020 Share Posted March 16, 2020 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 Link to comment
humxahafeex Posted March 18, 2020 Share Posted March 18, 2020 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
Ursule Posted March 18, 2020 Author Share Posted March 18, 2020 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
humxahafeex Posted March 18, 2020 Share Posted March 18, 2020 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 🙂 Link to comment
Ursule Posted March 20, 2020 Author Share Posted March 20, 2020 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 🙂 Hello @humxahafeex, it worked!! Thank you so much! Ursule Link to comment
humxahafeex Posted March 20, 2020 Share Posted March 20, 2020 4 minutes ago, Ursule said: Hello @humxahafeex, it worked!! Thank you so much! Ursule Glad it helped , Please mark it as solved , By clicking up arrow icon on top left of answer 🙂 Link to comment
mjwatt43 Posted June 9, 2020 Share Posted June 9, 2020 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.