Make 'mental model' of how playlists relate to the player configurable
My pull request appears to have reopened a discussion of how playlists relate to the player optional.
Apparently there are at least two mental models, some folks:
- Like having the player continue until something else is put in the queue.
- Like having the player stop if there is noting in the queue.
At the moment the player follows the first mental model. The player does not stop if the currenly playing track is removed from the queue / the playing playlist, or if a playing playlist is closed.
Resolving this issue :
- An option must be added in the options panel, it should default to the current behaviour (mental model 1), but allow a user to change the behaviour to mental model 2.
- The code must be updated to implement the chosen behaviour, when: * the currenly playing track is removed from the queue / the playing playlist * a playing playlist is closed
I'll start working on this.
I've started working on this in the branch 'mental_models' of my fork.
Following is what I have currently added to the options panel:
Player mode
When:
- The playing track is removed from the queue.
- The playing track is removed from the playing playlist.
- The playing playlist is closed.
- The queue is empty.
Playback of the playing track will:
(+) continue ( ) stop
Hi Martijn,
I had a quick look at the branch and it looks good (there were still missing checks for some of the listed scenarios, but that's an easy fix).
I would call the option simply stop playback when removing playing track [x] and I think the users will understand how it works.
Looking forward to the pull request, and thanks for the effort!
Finally had some spare time to continue on this. @devsnd, as you noticed the following scenarios are not handled yet: The playing track is removed from the queue. The playing track is removed from the playing playlist. You say that's an easy fix, but I haven't been able to figure out how the event is handled. Can you point me where the remove song [x] is handled by cherrymusic?
Hey Martijn,
What I meant, was that you used the userOptionMultivalListener instead of the userOptionCheckboxListener, even though the choice is binary (either stop when removing the playing track or dont). So all I meant was to implement this feature as a checkbox instead of a dropdown. You could call that open stoponremove or something.
If you want to check if the playing track has been removed you can listen on the removedItem event as done in the playlistmanager.js. But this event does not seem to give you any indication which track was removed, so you might need to modify the jplayerplaylist.js itself to get that information
If you have any other questions feel free to ask!