Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var t;
- var duration;
- socketio.listen(server).on('connection', function (socket) {
- function doit() {
- getvideo(function(vid, callback) {
- if(vid.stopwatch) { duration = vid.stopwatch * 1000 + 1000; } else { duration = defdur; }
- console.log('le broadcast')
- socket.broadcast.to('player').emit('changevid', vid);
- t=setTimeout(function() {
- //do it again
- callback(function() {
- doit();
- });
- }, duration);
- });
- }
- });
- function getvideo(callback) {
- //do stuff
- callback(vid);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement