Background Audio on iOS issues

Q&A about the latest versions
Post Reply
User avatar
Carlos Chegado
Posts: 45
Joined: Wed Feb 14, 2007 7:11 pm

Tue Aug 18, 2020 11:48 pm

G'Day,

Background audio works fine on every other platform except iOS.

Any plans to fix this?

Is there a work around?

Currently Audio only plays in the first node of an Animation. Subsequent nodes go Mute!

On my iPad is even worse as it tries to play all audio files at once right at the start of an animation!

I'm starting to hate Safari with the same fervor that I used to hate Explorer...

Anyway, did anyone manage to get Animation working with a Background Audio different on each node?

Much appreciated,

Cheers from Down Under.
User avatar
Tony
Posts: 999
Joined: Mon Feb 15, 2010 6:54 am
Location: Adelaide, South Australia
Contact:

Wed Aug 19, 2020 4:41 am

Hi Carlos,

Hope you are well and safe.

Are there two issues or only one? Are you having any issues with background sound in iOS aside from the playback in an animation say for instance when you have a background sound in a node.

I'll do an animation test and let you know how I get on.

cheers,

Tony
Tony Redhead | Panoramic Photographer | mobile: +61438501002 | website: http://tonyredhead.com - http://redsquare.com | roundme: http://round.me/@tonyredhead | instagram: https://www.instagram.com/tonyredhead/
User avatar
Carlos Chegado
Posts: 45
Joined: Wed Feb 14, 2007 7:11 pm

Wed Aug 19, 2020 6:06 am

Hi Tony,

It's wonderful to actually get a reply without having to wait 12h for Mr. Hopki to get out of bed :-)

Yeah, the project I'm working on has a splash screen with a button users can press to start animation. That click interaction also gets most browsers playing background audio for each node. Each node has a different audio setup as background sound (Loop 1).

On my computer and my Android phones, when I start animation, the autoplay goes on through each node as per animation script and plays the respective background sound.

On my iPhone, it only plays audio on the first node. Every other node doesn't play Audio.

On my iPad, it tries to play all the background sound at once in the first node causing a mess, then goes mute the rest of the nodes.

I noticed the Gnomes have a notice about it here:

https://ggnome.com/doc/sounds-add/

"★ Background sounds do not work on iOS devices (HTML5) without a button to start and stop the sound. You can add a button for this in the Skin Editor."

So there's definitely an issue there with Background Sound.

I'm wondering if this is going to be solved any soon or do we have to come up with a work around?

Tony, You have pretty good audio tutorials on your website but they are not quite doing what I want.

I'll see if I can get a sample project online this arvo to see if anyone can come up with a workaround.

Cheers Mate
User avatar
Tony
Posts: 999
Joined: Mon Feb 15, 2010 6:54 am
Location: Adelaide, South Australia
Contact:

Wed Aug 19, 2020 3:27 pm

Hi,

Okay did a bit of testing, but have run into the issue on the iPad in Chrome and Firefox.

I've uploaded this sample https://p2vr.s3-ap-southeast-2.amazonaw ... index.html

On the desktop it's fine but on the iPad I only get the first node and mute on all the others.

I've tried some workarounds but they didn't have any effect. What I did was add a container and used the Action - Node Changed - Play Media - 1 - (tried both _background and Element01) with a modifier for Operating System = iOS. I have a text box showing the node change working (true) and then a timer to turn it back to false.

Tony
Tony Redhead | Panoramic Photographer | mobile: +61438501002 | website: http://tonyredhead.com - http://redsquare.com | roundme: http://round.me/@tonyredhead | instagram: https://www.instagram.com/tonyredhead/
User avatar
Carlos Chegado
Posts: 45
Joined: Wed Feb 14, 2007 7:11 pm

Thu Aug 20, 2020 12:56 am

Hi Tony,

Thanks a lot for that.

Yeah, my findings are in line with yours.

I tried your link on my iPhone and it has the same issue. I only get Audio on the first node. Subsequent nodes go mute!

It is because of a so called "security feature" on those devices that block media from auto start unless a click or button press by the user happens.

I'm able to circumvent the problem by making a button pop up in between nodes so users can press to get the audio playing on iPhones and iPads, but I don't want this pop up to come up for any other user because their experiences run fine as it is but now I'm having trouble targeting ONLY iPhone and iPad users!

Hopefully someone here has any clue on how to produce a logic bloc that shows a button to ONLY iPhone and iPad users!

Cheers
User avatar
Tony
Posts: 999
Joined: Mon Feb 15, 2010 6:54 am
Location: Adelaide, South Australia
Contact:

Thu Aug 20, 2020 2:14 am

Hi,
I'm able to circumvent the problem by making a button pop up in between nodes so users can press to get the audio playing on iPhones and iPads, but I don't want this pop up to come up for any other user because their experiences run fine as it is but now I'm having trouble targeting ONLY iPhone and iPad users!
I've updated the example to include a 'play audio' button that only appears on mobile devices running iOS. I haven't tested it on Android and it displays on the first node, but it works.

https://p2vr.s3-ap-southeast-2.amazonaw ... index.html
Hopefully someone here has any clue on how to produce a logic bloc that shows a button to ONLY iPhone and iPad users!
Take a look at these two links;

https://modernizr.com/

https://stackoverflow.com/questions/577 ... -13-and-up

Tony
Tony Redhead | Panoramic Photographer | mobile: +61438501002 | website: http://tonyredhead.com - http://redsquare.com | roundme: http://round.me/@tonyredhead | instagram: https://www.instagram.com/tonyredhead/
User avatar
Carlos Chegado
Posts: 45
Joined: Wed Feb 14, 2007 7:11 pm

Thu Aug 20, 2020 3:38 am

Hi Tony,

Yes, this is as good as it gonna get for iOS users I think (unless our favorite Gnomes manage to fix this blunder!)

Your example works fine on my iPhone showing the [Play Audio] button correctly.

Your example also works well on my Android devices by only showing the button at start to get Audio going, from there on it works fine.

Desktop works well as expected.

I'll check it on the iPad later when my daughter comes back from school!

I'll go see if I can reproduce the exact same behaviour in my skin.

Cheers
User avatar
Tony
Posts: 999
Joined: Mon Feb 15, 2010 6:54 am
Location: Adelaide, South Australia
Contact:

Thu Aug 20, 2020 7:45 am

Hi Carlos,

I've updated the skin so that the Audio button doesn't show on the first node.

https://p2vr.s3-ap-southeast-2.amazonaw ... index.html

I've also attached the skin I'm using so you can take a look at it.

Tony
Attachments
soundanim_testios.ggsk
(8.12 KiB) Downloaded 16 times
Tony Redhead | Panoramic Photographer | mobile: +61438501002 | website: http://tonyredhead.com - http://redsquare.com | roundme: http://round.me/@tonyredhead | instagram: https://www.instagram.com/tonyredhead/
User avatar
Carlos Chegado
Posts: 45
Joined: Wed Feb 14, 2007 7:11 pm

Fri Aug 21, 2020 1:19 am

Excellent work Tony,

I think you've got material for another pretty good Tutorial :-)

I would suggest a couple things for you to consider:

On the cnt_play_audio Visibility Logic Block, you have 3 conditions there (Is Mobile, Has Touch and Operating System =iOS).

I would say the first two are redundant? (Operating System = iOS) should be all it takes to target the iPhones no?

Also, I would add in there another logic block to target iPads with two conditions (Operating System = MacOS AND Has Touch = True).

This way, those pesky iPads reporting themselves as Mackintosh grownups could be added to the cnt_play_audio group as they have the same problem!

If you want to go deeper into this, I've also found out that if you're repeating a background sound say on node 1 and node 3 or whatever, once a background audio has played, we don't need to press the play audio button again later in the tour as it will start on it's own.

This might need some additional logic in the skin to skip the Play Audio button on a subsequent node if that same audio file has been used before in the animation sequence.

Of course, me thinks this should be handled properly by default in the next Pano2VR version. Hopefully Mr. Rauscher is taking note of all of this so we get that nice surprise when we upgrade ;-)

Meanwhile, looking forward to your next Background Audio in Pano2VR Tutorial 👍

Cheers
User avatar
Hopki
Gnome
Posts: 10824
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Mon Aug 24, 2020 9:41 pm

Hi Carlos,
This is already in the bug tracker, its to do with Auto node change, be it using Animation or Autorotation.
So it's on the radar.
Regards,
Hopki
Garden Gnome Software Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
Post Reply