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

Media Sources #4

Merged
merged 6 commits into from
Mar 24, 2016
Merged

Media Sources #4

merged 6 commits into from
Mar 24, 2016

Conversation

goto-bus-stop
Copy link
Member

Implements a simple, pluggable media source API.

Sources are registered using a source() method:

import ytSource from 'u-wave-source-youtube';
import scSource from 'u-wave-source-soundcloud';
uwave.source('youtube', ytSource, { key: 'API_KEY_HERE' });
uwave.source('soundcloud', scSource, { key: 'API_KEY_HERE' });

Then searches can be run like:

uwave.source('youtube').search('Query', pageToken);
uwave.source('soundcloud').search('Query', pageOffset);

The search pagination implementation is incomplete.

@goto-bus-stop
Copy link
Member Author

Oh-- it might be useful to also pass the üWave core object and the current user to Sources, so that a Source could use the üWave Play History, or the current user's liked videos on YouTube, or use the current user's preferences to hide videos that are not available in their country.

Passing the üWave core object is fairly simple, but the current user would have to be passed to each method call.

@goto-bus-stop
Copy link
Member Author

Although that might be over-engineering it.

@goto-bus-stop
Copy link
Member Author

Took a few clues from Browserify's plugin() implementation, so this allows Sources to take a üWave object in their first parameter.

@goto-bus-stop goto-bus-stop mentioned this pull request Feb 27, 2016
Merged
5 tasks
@goto-bus-stop
Copy link
Member Author

A "current user's playlists" source cannot yet be implemented with this, but I'll merge this now to get a cleaner api-v1 repo, anyway.

@goto-bus-stop goto-bus-stop merged commit ff10a85 into master Mar 24, 2016
@goto-bus-stop goto-bus-stop deleted the feature/modular-sources branch March 26, 2016 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant