jetgrizzly/jetgrizzly — pull request #77 by jgladch (2014-10-22 23:16:47+00:00)
Title: (feat) Synchronize video queue and player

So the player / queue syncing is now working for the base case (videos in queue, player already playing a video). There are still problems we need to work out. Namely:

1) The listener in room.js on line 105 is checking for any changes made to children of the youTubeFirebase ref, and then it makes changes to children of the firebase ref (lines 107 and 108), kicking off another whole round of listening and setting... This doesn't stop the base case from functioning correctly, but we should probably refactor this. See the comments I left for you in the code.

2) The 'addToQueue' function in controllers/videoqueue.js (line 43) needs to know if the player is currently playing a video in order to know how to store links added to the queue. Any ideas how we can do this?

3) Right now, if the player ends and there are no videos in the queue, playing stops. This is expected. However, when a new link is added the player doesn't start playing because of #2 above. I can add logic to the queue to handle this case as long as I can know if the player is playing right now or not.

TL:DR: base case is working, we have more work to do to make it more robust. But this is a step in the right direction!