Squarewebsites Plugins

View Original

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: 

See this content in the original post

Test this and  say if troubles on devices.