Skip to content

Instantly share code, notes, and snippets.

@xat
Created October 10, 2014 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xat/f4a743fd824e8d2b2d56 to your computer and use it in GitHub Desktop.
Save xat/f4a743fd824e8d2b2d56 to your computer and use it in GitHub Desktop.
var localfiles = function(opts, player, type, next) {
if (type !== 'launch') return next();
if (isUrl(opts.path)) return next();
// start local webserver, change the path to an url
};
var defaultmedia = function(opts, player, type, next) {
player.on('app-launch-pre', function(err, app) {
// add player api, if namespace ist default player
});
};
player
.use(localfiles())
.use(torrents())
.use(defaultmedia());
player.launch('http://whatever.mp4', function(err, p) {
p.pause();
p.stop();
p.volume(0.5);
});
player('http://whatever.mp4');
player.join(function() {
});
player(function(err, p) {
p.stop();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment