Prevent Squarespace Audio blocks open in player on IOS devices

Blog

Check Out Useful Squarespace articles here

Prevent Squarespace Audio blocks open in player on IOS devices

If you try to open page with Audio Block mobile Safari - you'll be redirected to source url and track will be play in player. This is because SQS audio script check browser userAgent and if match "ios" - it change location url to track url.

But actually modern devices (at least IOS 9.1) can play music in usual way. I checked on Simulator and Iphone 5S - it's working OK.

I didn't try if something another falls, so you may inject this (page or collection Advanced Tab) only on page with your Audio Blocks. So here is simple snippet: 

<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>
<!--Updated 05.03.16-->

Test this and  say if troubles on devices.

Code SnippetsMichael Mashai