chromecast-api icon indicating copy to clipboard operation
chromecast-api copied to clipboard

Playlist feature

Open Waxyen opened this issue 5 years ago • 5 comments

Hey all,

Since music support is added, I was wondering if this library is a good place for a playlist feature. I'm imagining a class where media objects are stored and played in the order they are added, shuffled or whatever.

I'm not sure if you want to keep this library low-level, or if you are open to expand it with some features.

Waxyen avatar Dec 24 '19 08:12 Waxyen

Thanks for the suggestion @Waxyen :)

IMHO, I think a playlist would require an unnecessary increase in complexity. For example, what if the next media content in the playlist is suddenly not available? Do we throw an error or an event? In that case do we stop the application or close it? (and more problems that I haven't though about yet)

I think these questions must be answered by the user of the library. So it must be done in a separate library which wraps this one or implemented by the user of the library.

What do you think?

alxhotel avatar Dec 25 '19 17:12 alxhotel

Yes it will add some extra complexity. I think it should not be very hard to implement though. If it was optional to have it play via the playlist; enclosed by a try/catch, it would not be that complex at all. If it fails, a callback could be executed with some user-implemented code.

But I agree, maybe it is too much for this library.

Waxyen avatar Dec 27 '19 12:12 Waxyen

You may check https://github.com/thibauts/node-castv2-client/blob/master/examples/queue.js

This library is based on cast-V2-client and that GitHub seems to have a queue (playlist) example.

mAPBhlJ avatar Jan 02 '20 11:01 mAPBhlJ

Oh cool, so it's already implemented.

Seems like a great feature then ;)

alxhotel avatar Jan 08 '20 17:01 alxhotel

Haha awesome! I don't have much time at the moment. But I'd love to get my hands dirty when I do. Otherwise everyone is welcome to do it, if I may speak for all :).

Waxyen avatar Jan 14 '20 20:01 Waxyen