sync/bin/build-player.js

52 lines
1017 B
JavaScript
Raw Permalink Normal View History

#!/usr/bin/env node
var coffee = require('coffeescript');
2015-07-01 16:38:01 +00:00
var fs = require('fs');
var path = require('path');
var order = [
'base.coffee',
2022-01-28 15:18:10 +00:00
'dailymotion.coffee',
2022-02-01 00:45:44 +00:00
'niconico.coffee',
2022-01-28 15:18:10 +00:00
'peertube.coffee',
'soundcloud.coffee',
'twitch.coffee',
2015-07-01 16:38:01 +00:00
'vimeo.coffee',
'youtube.coffee',
2022-01-28 15:18:10 +00:00
2022-08-29 00:08:28 +00:00
// playerjs-based players
'playerjs.coffee',
2022-08-29 00:08:28 +00:00
'iframechild.coffee',
'odysee.coffee',
'streamable.coffee',
// iframe embed-based players
2015-07-01 16:38:01 +00:00
'embed.coffee',
2022-08-29 00:08:28 +00:00
'custom-embed.coffee',
'livestream.com.coffee',
'twitchclip.coffee',
// video.js-based players
2022-01-28 15:18:10 +00:00
'videojs.coffee',
2022-08-29 00:08:28 +00:00
'gdrive-player.coffee',
'hls.coffee',
'raw-file.coffee',
'rtmp.coffee',
2022-01-28 15:18:10 +00:00
2022-08-29 00:08:28 +00:00
// mediaUpdate handler
2015-07-01 16:38:01 +00:00
'update.coffee'
];
var buffer = '';
order.forEach(function (file) {
buffer += fs.readFileSync(
path.join(__dirname, '..', 'player', file)
) + '\n';
2015-07-01 16:38:01 +00:00
});
fs.writeFileSync(
path.join(__dirname, '..', 'www', 'js', 'player.js'),
coffee.compile(buffer)
);