koel / koel

🐦 A personal music streaming server that works.
https://koel.dev
MIT License
16.02k stars 1.97k forks source link

Playback error when trying to log in #1206

Closed mncn closed 4 years ago

mncn commented 4 years ago

Sometimes when I try to login I get the message: TypeError: Cannot read property 'media' of undefined

referring to this line at playback.js this.listenToMediaEvents(this.player.media);

It's weird 'cause it's not every time. Sometimes it works and I'm able to login, sometimes it doesn't and it shows this message.

A few times I'm actually able to login but nothing is loaded, it seems like the event KOEL_READY is not fired (I force it to test it inside the albums-list.vue and it worked).

Usually when it happens, the 2nd time I try I'm able to login.

As far as I checked, that happens 'cause the: this.player = plyr.setup({ controls: [] })[0]

returns undefined for this.player.

any ideas?

Environment

Thanks!

phanan commented 4 years ago

This is a race condition that's hopefully fixed in the latest version. Can you upgrade and see if the problem persists?

BrookeDot commented 4 years ago

Hi @mncn were you able to upgrade?

mncn commented 4 years ago

Yes, it's working now! Thank you and sorry for the late reply.