watch-ensemble

command module
v0.0.0-...-4b3616f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2020 License: MIT Imports: 7 Imported by: 0

README

Watch Ensemble

Watch Ensemble allows you to watch videos together with your friends online. Watch Ensemble synchronizes video playback using a websocket.

Usage

go run main.go

docker build -t watch-ensemble .
docker run -p 8080:8080 watch-ensemble

Websocket Docs

Endpoint: /ws?clientId=EXAMPLE_ID

setPlaybackState: Report to server after user changed playback state or server tells client to change state

{
    "type": "setPlaybackState",
    "text": "playing|paused|waiting",
    "client": "<client>",
    "date": "..."
}

requestVideo: Client requests video by url

{
    "type": "requestVideo",
    "text": "<url>",
    "client": "<client>",
    "date": "..."
}

setVideoDetails: Server sends new video with details to all clients

{
    "type": "setVideoDetails",
    "videoDetails": {
        "title": {"de": "<video title>"},
        "description": {"de": "<video description>"},
        "url": {"de": "<video url>"},
        "languages": ["de"],
    },
    "client": "<client>",
    "date": "..."
}

jumpToTime: Report to server after user jumped to time and server transmits to all clients

{
    "type": "jumpToTime",
    "seconds": 163,
    "client": "<client>",
    "date": "..."
}

reportStatus: Clients reports every 5 seconds current status

{
    "type": "reportStatus",
    "status": {
        "playbackState": "playing|paused|waiting",
        "currentTime": 163
    },
    "client": "<client>",
    "date": "..."
}

Meta

Lucas Hild - https://lucas-hild.de
This project is licensed under the MIT License - see the LICENSE file for details

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL