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

create playlist plugin #1018

Merged
merged 12 commits into from
Mar 4, 2017
Merged

Conversation

entonbiba
Copy link
Contributor

@entonbiba entonbiba commented Feb 28, 2017

create playlist plugin

  • user util.ajax to get file content - ok
  • support m3u - ok
  • check if mp3 or wav file urls set in playlist - ok
  • return empty array if playlist type not supported or set - ok
  • create plugin example and docs - ok create Playlist plugin sample #1019

Parameters:

playlistFile - link to playlist file

playlistType
'm3u' or 'audio/mpegurl' will default to m3u

Preview:
http://codepen.io/entonbiba/pen/OpMQjR

@entonbiba entonbiba self-assigned this Feb 28, 2017
@entonbiba entonbiba mentioned this pull request Feb 28, 2017
Copy link
Contributor

@thijstriemstra thijstriemstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't want to merge this before "create plugin example and docs". PlaylistParser also could use a better name, why not just call it playlist?

@entonbiba
Copy link
Contributor Author

entonbiba commented Feb 28, 2017

@thijstriemstra yes don't merge until I complete the remaining tasks, I added the label 'needs-update', when I remove the label it will be ready.

@thijstriemstra
Copy link
Contributor

@entonbiba i'm not sure if thats the way to go. maybe you should not make a PR before that checklist is completed?

@mspae
Copy link
Contributor

mspae commented Mar 1, 2017

I don't have any strong opinions about this. I think we all agree the PR should only be merged when it's ready. But whether PRs should only be opened when they are truly ready (or the author considers them to be ready at least) I don't know – It does add clutter to the PR list and may be confusing if everybody starts doing it.

@katspaugh
Copy link
Owner

I think it's OK to open a PR to discuss the approach before it's too late. Also, is m3u the most popular playlist format? If so, this plugin would already be useful to people even without other formats.

@entonbiba
Copy link
Contributor Author

@mspae @thijstriemstra @katspaugh yea I opened a pr so I can share the code updates directly here instead of linking to them.

I'll remove the other formats for now and create the example for m3u.

@entonbiba
Copy link
Contributor Author

entonbiba commented Mar 2, 2017

@thijstriemstra @katspaugh @mspae the playlist parser plugin is now ready 👍

@entonbiba entonbiba added this to the 1.3.5 milestone Mar 2, 2017
Copy link
Contributor

@thijstriemstra thijstriemstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PlaylistParser also could use a better name, why not just call it Playlist or PlayList?

@entonbiba
Copy link
Contributor Author

@thijstriemstra sure, all agree on this @katspaugh @mspae ? PlayList

@entonbiba entonbiba changed the title create playlist parser plugin create playlist plugin Mar 2, 2017
@mspae
Copy link
Contributor

mspae commented Mar 2, 2017

@entonbiba I like that name.

return this.playlistData;
},

parse: function(playlistFile) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parse sounds too techy, I'd personally call it load. And I also prefer playlistData over parsedList, can you come up with a better name that avoids parse?

if (this.playlistType == 'm3u' || this.playlistType == 'audio/mpegurl') {
playlist = playlistFile.replace(/^.*#.*$|#EXTM3U|#EXTINF:/mg, '').split('\n');
} else {
throw new Error('No valid playlist file provided, valid formats are m3u pls smil json or their valid mime types');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove the listing of the supported formats in the error and just keep it short: No valid playlist file provided.

- set getPlaylist method
- change parse to loadPlaylist
- make generic no valid playlist message
@entonbiba
Copy link
Contributor Author

@thijstriemstra updated, I changed it to getPlaylist and loadPlaylist

@thijstriemstra thijstriemstra merged commit 947b48a into master Mar 4, 2017
@thijstriemstra thijstriemstra deleted the entonbiba-patch-playlistparser-plugin branch March 4, 2017 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants