Red5 Mouse Movement & Click Sharing

I’ve been playing around with this concept of sharing mouse movements and clicks with all users who are view the same webpage. So far, I have a rough prototype functioning (on this website and on www.porterdigital.com). Assuming you have a recent Flash player installed and your firewall allows RTMP socket connections, this should work for you. Try clicking around on this page (not on a link yet) and you should see your click. If anyone else is viewing this page right now, they’ll see it too. Try opening up a second browser window with this same URL and view them side-by-side. You should see your clicks and mouse moving around the page.

So here’s how it works: There is a tiny flash movie embedded into this page and it’s moved off screen so it doesn’t interfere with the page layout. This movie clip opens a persistent NetworkConnection (a RTMP socket connection) to a Red5 server (running on my office desktop). JavaScript listens for your mouse to move or a click to happen and relays this event to the Flash movie. Flash then sends that data off to the server. The server (running Red5) figures out who’s viewing this same page and pushes an event to that client immediately. The Flash movie receives the event and relays that event to JavaScript. JavaScript then moves the little cursors around or plays the animated ‘click’ thingy.

A custom Red5 application has been created to keep track of who’s visiting what page and which clients needs to be notified of which mouse events. Basically it’s a proxy for mouse events.

Granted, it’s a pretty cheesy example of using this technology, but I think the overall concept has some potential. It allows true ‘push’ to clients unlike AJAX which relies on polling. Let me know what you think.

This entry was posted in Flex & Flash, Red5. Bookmark the permalink.

Comments are closed.