Inspiration

ShareLive was inspired by an article published in the "Frontiers in Psychology" journal by researchers at the University of Oxford about how sharing the experience of listening to music can increase social bonding.

What it does

ShareLive allows users to share music live (there's up to 5 seconds of latency) with friends over the internet.

How I built it

Most of the code is written in JavaScript. There's a very simple (18 lines of code) back end written in PHP. The front end is stylised using bootstrap.

Challenges I ran into

YouTube doesn't allow all videos to be embedded, due to the various different licensing arrangements they have - so I had to make sure my web app took this into account and didn't offer users videos which were unplayable. I designed a bespoke events protocol using pusher to synchronise clients "peer to peer" - all the back end does is authorise connections (all connections are automatically authorised, however pusher requires connections to be authorised using a back end before they can broadcast data).

Unfortunately my web app doesn't yet work on mobile due to issues with automatically playing / pausing videos (see the YouTube documentation for more information). I hope that this issue can be overcome in the near future.

Accomplishments that I'm proud of

It all works fairly smoothly. The user interface is quite friendly, and is looks reasonably nice. This was my first "major" (4+ hours of coding time) project using JavaScript - it's a good way to write cross-platform applications.

What I learned

I learned how to write a substantial application using JavaScript, and how to use Pusher without having a central backend to keep track of state. I think this is really useful - by using client-side programming and peer-to-peer communication costs are kept to a minimum and applications are generally scalable by nature.

What's next for ShareLive

There are a few items on the to do list. I'd really like to integrate with Spotify instead of YouTube, as Spotify offers greater music choice and higher sound quality. Access to their APIs is by application / invitation only, so hopefully this proof-of-concept can show that this is a good idea.

Share this project:

Updates