sockets - How to let a Meteor "room" know about an update -
i'm building similar app togethertube.com , far have this
/profile, /rooms, /, /:roomname
now, in each room using both youtube player api , youtube video search api, rooms loaded mongo collection called "rooms", mongo collection called "videos" associated own rooms each time room loaded, videos loaded too.
the rooms collection has field called "currentvideo" (and "currentvideotime") so, want let particular room know when currentvideo field changes view of each user isn't owner of room , viewing changes , youtube player api starts playing new video.
i don't know how that, i've thought sockets reason started using meteor avoid using socket.io if that's solution, it. tried thinking using meteor's collection "observe" when document corresponding room in rooms collection updated (when video in owner of room's view finishes playing , room's currentvideo updated) function fired , youtube player api loads video.
any ideas on how can achieve or there better full-stack framework can use similar dubtrack.fm , togethertube.com?
collection.observechanges() way go. note meteor uses websocket changes pushed automatically server subscribed clients.
Comments
Post a Comment