benwiley4000 / cassette

📼 A flexible media player component library for React that requires no up-front config
https://benwiley4000.github.io/cassette/styleguide
MIT License
183 stars 28 forks source link

onSelectTrackIndex always starts playing #514

Open tyv opened 1 year ago

tyv commented 1 year ago

I wish to update activeTrackIndex without triggering play, as far as I understood, it's impossible. I suggest to add extra argument to onSelectTrackIndex to tell @cassette which shouldPlay has to be.

benwiley4000 commented 1 year ago

To me it seems like it would make more sense to just add a boolean parameter to the player context that decides whether or not you should auto-play when switching tracks. I've never used a player that doesn't autoplay when changing tracks, but it seems fine that this is what you want.

I assume this would cover your needs, and you're not actually giving the user separate buttons to decide whether they want to autoplay or not when selecting a new track.

Le mer. 18 janv. 2023, 12 h 39 p.m., Yuri Tkachenko < @.***> a écrit :

I wish to update activeTrackIndex without triggering play, as far as I understood, it's impossible. I suggest to add extra argument to onSelectTrackIndex to tell @cassette https://github.com/cassette which shouldPlay has to be.

— Reply to this email directly, view it on GitHub https://github.com/benwiley4000/cassette/issues/514, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADHOD3M5W43VMQMRW2GVXMDWTATG5ANCNFSM6AAAAAAT7LUL5Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>