All Projects → diessica → Clicker

diessica / Clicker

📺 a web remote control for the players out there

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Clicker

Angular Chat
(IM App)Chat App built using Angular and Socket.io
Stars: ✭ 12 (-74.47%)
Mutual labels:  socket-io
Vuex Socketio Plugin
Vuex plugin to integrate socket.io client
Stars: ✭ 34 (-27.66%)
Mutual labels:  socket-io
Ihealth app
App front-end of iHealth project ( a medical WebApp based on mui )
Stars: ✭ 41 (-12.77%)
Mutual labels:  socket-io
Multi Draw
☁️ 基于Fabric.js+Socket.io的多人在线实时同步画板
Stars: ✭ 13 (-72.34%)
Mutual labels:  socket-io
Socket Click Example
Node + Express + Socket.io button click example
Stars: ✭ 28 (-40.43%)
Mutual labels:  socket-io
Express Security
nodejs + express security and performance boilerplate.
Stars: ✭ 37 (-21.28%)
Mutual labels:  socket-io
Eve Live
EVELive provides real-time pricing data for the MMORPG EVE Online
Stars: ✭ 8 (-82.98%)
Mutual labels:  socket-io
Nodejs Socketio Chat App
MEAN Stack & Socket.IO Real-time Chat App | A MEAN stack based Real Time chat application
Stars: ✭ 45 (-4.26%)
Mutual labels:  socket-io
Realtime Newsapi
Financial News Aggregator - Real Time & Query API for Financial News
Stars: ✭ 34 (-27.66%)
Mutual labels:  socket-io
Trycode
Open-source realtime collaborative code editor on Babel, NodeJS, AngularJS, Socket.io, ACE - http://trycode.pw
Stars: ✭ 38 (-19.15%)
Mutual labels:  socket-io
Streamcaster
Live streaming platform built with Node.js and React
Stars: ✭ 20 (-57.45%)
Mutual labels:  socket-io
Peeplus
python+vue3前后端分离项目
Stars: ✭ 28 (-40.43%)
Mutual labels:  socket-io
Socket Io
基于Hyperf微服务协程框架开发的sokcet-io分布式系统
Stars: ✭ 38 (-19.15%)
Mutual labels:  socket-io
Dodgem
A Simple Multiplayer Game, built with Mage Game Engine.
Stars: ✭ 12 (-74.47%)
Mutual labels:  socket-io
Chat Buy React
Client for beginners to learn, built with React / Redux / Node
Stars: ✭ 1,026 (+2082.98%)
Mutual labels:  socket-io
Vue Qq
🎨 Vue family bucket with socket.io and express/koa2 , create a web version of mobile QQ, supporting real-time group chat, real-time private chat, special care, shielding chat, smart IP geographic location, real-time display temperature and other QQ core functions
Stars: ✭ 861 (+1731.91%)
Mutual labels:  socket-io
Doom Lgs
A multiplayer Node.js light gun shooter inspired on Doom
Stars: ✭ 36 (-23.4%)
Mutual labels:  socket-io
Node Chat One To One
Node.js socket-io based one to one chat engine
Stars: ✭ 47 (+0%)
Mutual labels:  socket-io
Phaser3template
heroku deployable webpacked phaser3 template with socket.io for multi or single player games
Stars: ✭ 44 (-6.38%)
Mutual labels:  socket-io
Progress Bot
High-tech weaponized moe progress delivery bot for IRC, Discord, and web
Stars: ✭ 38 (-19.15%)
Mutual labels:  socket-io

CLICKER

a web remote control for the players out there! ✨

Clicker hands-on

Motivation

In a nutshell, I had to desperately get out of the bed to turn down the volume of a TV show episode I was watching and that got me really mad at the universe. So I've built Clicker, a JavaScript application powered by socket.io and React – for fun and profit.

How to setup your Clicker

Since this is a JavaScript application, make sure you have Node.js installed.

Then git clone this repository or download the package, and go to the project's folder using your terminal. If you've called it clicker, just:

$ cd clicker

1. get the server running 💻

You'll need to install the project's dependencies and start the server.

$ cd server
$ npm install
$ npm start

The server will start under https://localhost:4001.

2. set up the front-end 📱

Again, installing dependencies and starting the server, but in the client folder.

$ cd client
$ npm install
$ npm start

The front-end will start under https://localhost:3000.

Remember to set up the server's external IP environment variable (REACT_APP_SERVER_IP) in the .env file so Clicker will connect to it instead of localhost. After that, you should be able to use Clicker in any device connected your network, such as your smartphone!

⚠️ Since both servers are under HTTPS with self-signed certificates, make sure your browser trusts them so you don't get "insecure response" errors that may prevent the connection. You can assert that by going to https://localhost:4001 and https://localhost:3000 (replace localhost with the external IP if that applies).

3. set up in the target player 📺

It's time to get the external player ready for Clicker! The website's player should react to the following events triggered by Clicker:

  • play_done
  • pause_done
  • volume_set_done

To get Clicker to know about the initial player state, it's important to react to volume_get, volume_get_done, volume_set_done, playback_get as well.

The code below shows an integration with the JW Player, a popular web player, by making use of its API, exposed in the website's window object.

const socket = io("https://localhost:4001")

socket.on("play_done", () => {
    window.jwplayer().play()
})
socket.on("pause_done", () => {
    window.jwplayer().pause()
})
socket.on("volume_get", () => {
    const volume = window.jwplayer().getVolume()
    socket.emit("volume_get_done", volume)
})
socket.on("volume_set_done", volume => {
    window.jwplayer().setVolume(volume)
})
socket.on("playback_get", () => {
    const playback = window.jwplayer().getState()
    socket.emit("playback_get_done", playback)
})

That code should be appended to the website along with the socket.io client. You can use browser extensions such Custom Style Script, for Firefox, or Custom JavaScript for websites, for Chrome, to achieve that.

The final example is provided below.

<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.4/socket.io.js"></script>
<script>
    const socket = io("https://localhost:4001")

    socket.on("play_done", () => {
        window.jwplayer().play()
    })
    socket.on("pause_done", () => {
        window.jwplayer().pause()
    })
    socket.on("volume_get", () => {
        const volume = window.jwplayer().getVolume()
        socket.emit("volume_get_done", volume)
    })
    socket.on("volume_set_done", volume => {
        window.jwplayer().setVolume(volume)
    })
    socket.on("playback_get", () => {
        const playback = window.jwplayer().getState()
        socket.emit("playback_get_done", playback)
    })
</script>
See final script

Have fun!

How it works

I'll write a (hopefully fun) in-depth blog post on how it works on my blog. For now, this might help you to get the flow:

Clicker flow

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].