Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pause in Playlist #574

Open
weinc1 opened this issue Mar 24, 2023 · 4 comments
Open

Pause in Playlist #574

weinc1 opened this issue Mar 24, 2023 · 4 comments

Comments

@weinc1
Copy link

weinc1 commented Mar 24, 2023

The lack of an option to turn off autoplay in a playlist is driving me batty, Is there any code that be added? I know the "autoplay" option is it here but it does nothing for playlist. Thanks

@terrill
Copy link
Member

terrill commented Mar 24, 2023

@weinc1 the playlist feature was created with the assumption that a playlist, by definition, is a list of media that are intended to be played continuously in sequence, like a record album. Is your desire to pause between tracks from the standpoint of an author or user?

  • For Authors: If the media is not intended to be played in sequence, I recommend not coding it as a playlist. Provide separate Able Player instances for each media title, or create an application that dynamically loads new media titles into a single Able Player instance as users click on titles.
  • For Users: We could add a setting to the Preferences menu. We don't currently have any preferences for Playlists, so that would probably require its own submenu category "Playlists", and the option could be a checkbox with a label like "Automatically advance to next track in playlist" (checked by default since I do believe that's the expected behavior of playlists, but users can uncheck it).

@weinc1
Copy link
Author

weinc1 commented Mar 24, 2023

Thanks for the reply. A couple of quick answers.

  1. As an author it is for Podcasts. Like a archive section. I did the individual/separate but as I am also providing transcripts it loaded each and every transcript window by default. That didn't so well.

  2. For the user it would be best to NOT have everything auto play.

By way of example there is a "simple" playlist that default to a paused stated after each selection. It works great...except it is nowhere near as caption friendly as ableplayer. The code though seems to be easy...but I could find no where to place anything similar into ableplayer. The "xxx" would be the player name...say "able". And obviously I am only showing you the code related to the "autoplay"

"auto_load" is what it is...

controls.querySelector('.xxx-plause').disabled = xxx_auto_load ? true : false;

And later

if (xxx_auto_load || xxx_isPlaying) xxx_loadAudio(elem);

and starting is:

function xxx_startScript() {
xxx_auto_load = xxx_config.auto_load; //auto load audio file

And finely:
// Start player
if (document.querySelector('#xxx')) {
var xxx_auto_load, xxx_audio, xxx_album, xxx_cover, xxx_title, xxx_artist, xxx_controls, xxx_progress, xxx_volume, xxx_v_slider, xxx_v_num, xxx_others;
var xxx_isNext = false; //auto play

var xxx_config = ap_xxx.dataset.config ? JSON.parse(ap_xxx.dataset.config) : {
auto_load: false //auto load audio file
};

@terrill
Copy link
Member

terrill commented Mar 26, 2023

For Able Player, I could add support for a new attribute data-playlist-continuous which could be added to the playlist element. It will need to be "true" by default since continuous play has always been the default behavior so it shouldn't be changed unexpectedly without authors having control. Any author who wants their playlist to pause between tracks will just need to add data-playlist-continuous="false"

@terrill terrill self-assigned this Mar 26, 2023
@terrill terrill changed the title Pause in Playlist - Question Pause in Playlist Mar 26, 2023
@weinc1
Copy link
Author

weinc1 commented Mar 27, 2023

That would be great,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants