meteor / react-packages

Meteor packages for a great React developer experience
http://guide.meteor.com/react.html
Other
573 stars 158 forks source link

<audio> on iOS fails when passing reactive data #142

Closed ffxsam closed 3 years ago

ffxsam commented 8 years ago

This is quite strange! I noticed my audio player was not working on iOS, but in every desktop browser it was fine. Took a really long time to figure this out, but it boils down to passing a variable returned from getMeteorData into my component. Apparently on iOS, it doesn't see this as a user-generated play command, so it ignores it. It's easier to demonstrate it, so here's the repo:

https://github.com/ffxsam/meteor-react-ios-bug

The way to fix this is to edit Home.jsx and change the AudioPlayer line to:

<AudioPlayer audioPlayerData={this.state.audioPlayerData} />

And modify doit so that it sets state instead of the reactive var.

This StackOverflow answer illustrates the problem.

Strange that a state change works ok, but reactive var change fails.

filipenevola commented 3 years ago

I'm closing this just because it's too old. We can open new issues for items that are still valid.