Coder Social home page Coder Social logo

kinoplex's Introduction

kinoplex

Kinoplex is a project for syncing media playback, aiming to be a simpler replacement for Syncplay without all the bloat, and without relying on Python.

The project is comprised of a procotol, server, mpv client, and web client. Clients targeted at other media players can easily be implemented thanks to the simple JSON protocol. There are no official servers or support for rooms, since the intended use case is syncing playback of videos and music for friend groups using a single shared server. The server hosts a web client, and the mpv client can be configured to connect to the server using a config file.

For user roles there can be only 1 admin that controls playback, acting as the anchor point for syncing time and state. The admin can let other users be jannies through a command, which gives them access to add URLs to the playlist.

Build

Compile using Nim 1.4.8 or higher (preferably 1.6.4).

Build the server (kino_server) and mpv client (kino_mpv):

nimble build -d:danger

Build the web client JavaScript:

nimble webclient

To run the mpv client, make sure you have mpv installed on your system. If you're on Windows or using a custom build, make sure to change binPath in the config file to point to the binary.

Config

Copy server.example.conf to server.conf and/or mpv_client.example.conf to mpv_client.conf, ideally in ~/.config/kinoplex and modify them to your needs. Allowed locations are next to the executable and in ~/.config/kinoplex/. The web client doesn't have a config.

mpv

mpv's native playlist functionality is used to synchronize the playlist across clients. The admin can go back and forth in the playlist without any issues, other clients will follow it perfectly. As non-admin pausing and skipping ahead doesn't work, the client constantly syncs time and state to be as close the admin as possible. Chat and server messages are displayed using mpv's built-in OSD overlay. If the OSD isn't visible at all, you may have to change your mpv configuration.

Keybindings

Enter Open chat input, Enter again to send and/or exit
/ Open chat input with "/" already in the input (convenient for commands)
Ctrl + l Clear chat
Ctrl + shift + l Display recent chat messages
Ctrl + q Fully quit mpv. Normal q will restart mpv.
Ctrl + v Add clipboard to playlist (must be admin or janny)

Commands

Prefix for all commands is /. Press / to open the chat ready to type a command. The shorthand notation [c]md means /c is the same as /cmd

[u]sers Show list of users in the server
[l]og n Show n lines of the chat log. If n is empty, it shows 6 lines
[a]dd url Add URL to playlist (admin and janny). Ctrl + v does the same.
[e]mpty Empties the playlist (admin only)
[i]ndex n Sets playlist index to n (number) (admin only)
[j]anny u Grant janny role to user with username u (admin only)
unjanny u Revoke janny role from user with username u (admin only)
[o]pen path Replace current file or URL locally. Useful if you have a local copy of something being streamed
[c]lear Clear chat, same as Ctrl + l
[r]eload Reload playlist and state. Useful if mpv gets messed up
rename name Change your display name to name
restart If reload isn't enough to fix mpv, try this. Hitting q should do the same
quit Same as Ctrl + q, fully quit mpv

Web

The web client can be accessed at the server's main path, e.g. http://localhost:9001/ or https://kinoplex.example.com/

You're prompted to pick a username, and optionally your password if you're admin. The web client has a chat overlay almost identical to mpv's, visible in fullscreen-mode. Press Enter to show it, and again to send/close.

plyr is used for playback which supports YouTube and Vimeo links, as well as video and audio file links. For broadest link support, consider using the mpv client instead since it uses youtube-dl to stream from almost any source. mkv files are generally not supported by browsers, but you can turn it into an m3u8 stream with ffmpeg easily, supported by all browsers using hls.

kinoplex's People

Contributors

ardek66 avatar rabioli avatar zedeus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

kinoplex's Issues

Add library and utilities for writing clients

As of now clients have loads of duplicate code which could be wrapped inside a general purpose API library, which would not only clean up existing implementations but also greatly aid in developing new clients such as bots or addons.

[web] Double click to fullscreen selects chat text

This can help:

   user-select: none; /* supported by Chrome and Opera */
   -webkit-user-select: none; /* Safari */
   -khtml-user-select: none; /* Konqueror HTML */
   -moz-user-select: none; /* Firefox */
   -ms-user-select: none; /* Internet Explorer/Edge */

Implement a Kodi client

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.