Advertisement
Guest User

Untitled

a guest
Feb 9th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. require("Popcorn");
  2.  
  3.  
  4. var videos = [];
  5.  
  6. for (var d of data){
  7.     var video = Popcorn("#stream-" + d.id);
  8.  
  9.     for (var to_be_started of d.should_start){
  10.         var startAt = (to_be_started.start_offset - d.start_offset)/1000.0
  11.  
  12.         console.log(d.id + ' will start ' + to_be_started.id + ' (' + startAt + ')');
  13.  
  14.         video.cue(startAt, function(){
  15.             console.log(d.id + ' starts now ' + to_be_started.id + ' (' + startAt + '),' + ' CurrentTime: ' + this.currentTime());
  16.             // playVideo(to_be_started.id)
  17.         })
  18.  
  19.     }
  20.     videos.push(video);
  21. }
  22.  
  23. console.log('----')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement