Giter VIP home page Giter VIP logo

streaming-server's Introduction

Streaming Server

Working demo at FlickTrack.me

What?

Multi-client media streaming server. Watch videos with friends, keeping everyone in sync.

Please see the Wiki for a detailed guide on using this project.

Why?

Thought it'd be fun.

Downloading

There are currently no downloads available, links will appear here in the future for binary downloads of this project. Please see the Compiling section to learn how to compile this project for now.

Building

Alternatively, you may choose to compile this project yourself rather than downloading a pre-compiled binary. See the sub-sections below for detailed steps and requirements.

Compiling

Requires Go and ffmpeg-devel to compile.

  1. Either git clone or go get this repo.
  • cd $GOPATH && go get github.com/juanvallejo/streaming-server
  • or (using git clone):
    • mkdir -p $GOPATH/src/github.com/juanvallejo
    • cd $GOPATH/src/github.com/juanvallejo
    • git clone https://github.com/juanvallejo/streaming-server
    • git submodule update --init (init the webclient submodule)
  1. make

Running

Once you've followed these steps, you should see a newly created bin directory containing a streaming binary.

  1. ./bin/streaming
  • You can optionally specify the port to bind to with ./bin/streaming --port <PORT>

The server will bind to port 8080 by default. Once it is running, you can access the web client at http://localhost:8080. To access a stream room, create a room by going to http://localhost:8080/v/roomname.

Further reading

Wiki

For up-to-date and comprehensive information about using this project, please read the wiki.

Simple Overview

Rooms

Rooms represent individual playback objects that allow one or more clients to play media independent from each other.

The default room url is /v/<ROOM>.

A room is created the first time it is accessed. Any subsequent access, retrieves previously created playback information.

Chat

Each room contains a chat, which acts as a make-shift command prompt.
Any chat messages entered in the chat beginning with / are interpreted as commands by the server.

A list of available commands is available by typing /help in the chat.

Streams

Playback requires a stream to be set, before operations such as play, pause, stop can be performed.
To set a stream, enter the command /stream set <URL> in the chat.

Playback, right now, supports streaming youtube and local videos.

Streaming local videos & "data" directory

Local videos are streamed from local files in the server. These files should be placed in the data directory, in the root of this project.

Example of setting a local video:

/stream set mylocalvideo.mp4

Note that local video files must be of a browser-friendly format in order for them to actually be displayed.

Streaming youtube videos

youtube videos are set using their full YouTube url.

Example of setting a youtube video:

/stream set https://www.youtube.com/watch?v=...

Controlling a stream

Once you set a stream, it will be loaded by each client, but will not begin playing.
To begin playback, use the command:

/stream play

Performing this command before setting a stream will result in a playback error.

The queue

Please refer to the wiki for a comprehensive guide and explanation of the queue.

It is also possible to queue media. Queuing differs from the /stream set ... command in that set immediately loads a video, bypassing the queue entirely, while queueing simply pushes a stream object into an internal list.

You can queue a video with:

/queue add <URL>

Note that queuing does not cause clients to also load the video. For the next item in the queue to be loaded by all clients, you must skip the currently set video with:

/stream skip

Note that this command results in an error if there are no items in the queue.
Additionally, by default, clients will automatically load the next item in the queue, if one exists, once the currently playing video ends.

TODO

  • Add ui for commonly used commands that control stream playback and queue actions.
  • Add a client config that allows certain features to be turned on or off (such as automatically playing the next item in the queue).

streaming-server's People

Contributors

juanvallejo avatar

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.