nypublicradio / ember-hifi

The easy way to play audio in your ember app
MIT License
45 stars 10 forks source link

Error if using addon in Ember 4.x #111

Open BwehaaFox opened 2 years ago

BwehaaFox commented 2 years ago

When using this addon in Ember 4.x, an error occurs when trying to play sound. The main problem is removing Ember global and removing getWithDefault.

The ember-poll service does not compile correctly in the ember-poll addon. Service.extend compiles to Ember.Service.extend which causes an error when using this addon.

This addon uses getWithDefault which was removed in Ember 4.x

Also ember-copy in this addon also causes an error. Fix upgrading to ember-copy to version 2.0.1

I made an attempt to fork both addons, raise dependencies and write getWithDefault based on the original method locally, but later the internal logic of this addon began to fail, in particular calling PromiseRace.start when calling the callback and trying to read strategy.connection in which strategy became undefined which causes a crash when trying to play a sound.

At the same time, when downgrading ember-source to 3.28 and installing original addons, the problem disappears completely.

Alas, I do not have the opportunity to thoroughly study the work of this addon from the inside and make more correct corrections other than the poke method, so I ask people who know who are involved in this addon to add support for Ember 4.x

jkeen commented 2 years ago

Unfortunately hifi doesn't work with the latest ember, and is pretty old school in terms of modern ember paradigms.

However it's modern successor ember-stereo should work just fine with 4.0 and is way easier to deal with overall! I spent a lot of time rethinking the interface, resolving some longstanding issues with hifi, and most crucially adding interactive documentation. Check it out and file an issue on that repo if things don't work right for you.