Commit 8e057225 authored by Simon Kirsten's avatar Simon Kirsten
Browse files

Initial push

parent dc41a7e4
Pipeline #22103 failed with stages
in 11 seconds
pages:
stage: deploy
image: python:alpine
before_script:
- pip install mkdocs
- pip install mkdocs-material
script:
- mkdocs build
- mv site public
artifacts:
paths:
- public
server:
stage: build
image: golang
before_script:
# Create a symbolic link under $GOPATH, this is needed for local build
# i.e. /go/src/gitlab.com/ykyuen/gitlab-ci-go-build
- cd $GOPATH/src
- mkdir -p $GITLAB_DOMAIN/$CI_PROJECT_NAMESPACE
- cd $GITLAB_DOMAIN/$CI_PROJECT_NAMESPACE
- ln -s $CI_PROJECT_DIR
- cd $CI_PROJECT_NAME
script:
- sed -i -e '/insert:index\.html/r server/website/index.html' server/website/website.go
- env GOOS=darwin GOARCH=386 go build -o stream-tv-server-darwin-x86
- env GOOS=darwin GOARCH=amd64 go build -o stream-tv-server-darwin-x86_64
- env GOOS=linux GOARCH=386 go build -o stream-tv-server-linux-x86
- env GOOS=linux GOARCH=amd64 go build -o stream-tv-server-linux-x86_64
- env GOOS=linux GOARCH=arm go build -o stream-tv-server-linux-arm
- env GOOS=linux GOARCH=arm64 go build -o stream-tv-server-linux-arm64
- env GOOS=windows GOARCH=386 go build -o stream-tv-server-windows-x86.exe
- env GOOS=windows GOARCH=amd64 go build -o stream-tv-server-windows-x86_64.exe
artifacts:
paths:
- stream-tv-server-darwin-x86
- stream-tv-server-darwin-x86_64
- stream-tv-server-linux-x86
- stream-tv-server-linux-x86_64
- stream-tv-server-linux-arm
- stream-tv-server-linux-arm64
- stream-tv-server-windows-x86.exe
- stream-tv-server-windows-x86_64.exe
# Include the subdirectorie's .gitlab-ci.yml
variables:
GITLAB_DOMAIN: "code.fbi.h-da.de"
include:
- '/.gitlab-ci-docs.yml'
- '/.gitlab-ci-server.yml'
# Stream TV
# Stream TV Project
### [Stream TV Documentation](https://simons-nzse-2.h-da.io/stream-tv-server)
TODO
\ No newline at end of file
package main
import (
"flag"
"fmt"
"log"
"net/http"
tv "code.fbi.h-da.de/simons-nzse-2/stream-tv/internal/tv"
twitch "code.fbi.h-da.de/simons-nzse-2/stream-tv/internal/twitch"
util "code.fbi.h-da.de/simons-nzse-2/stream-tv/internal/util"
website "code.fbi.h-da.de/simons-nzse-2/stream-tv/internal/website"
)
var listenAddr string
var openBrowser bool
func init() {
const (
defaultListen = ":8080"
usageListen = "Address to listen on"
defaultBrowser = false
usageBrowser = "Automatically open the default browser"
)
flag.StringVar(&listenAddr, "listen", defaultListen, usageListen)
flag.StringVar(&listenAddr, "l", defaultListen, usageListen+" (shorthand)")
flag.BoolVar(&openBrowser, "browser", defaultBrowser, usageBrowser)
flag.BoolVar(&openBrowser, "b", defaultBrowser, usageBrowser+" (shorthand)")
}
func main() {
flag.Parse()
mux := http.NewServeMux()
mux.Handle("/", website.Handler())
mux.Handle("/twitch/", twitch.Handler())
mux.Handle("/tv/", tv.Handler())
fmt.Printf("Starting Stream TV Server on %s\n\n", listenAddr)
fmt.Printf("IP addresses:\n")
util.PrintIPAddresses()
fmt.Printf("\nRead the documentation at https://simons-nzse-2.h-da.io/stream-tv to use this server\n")
fmt.Printf("Stop with Ctrl-C or close this terminal\n")
if openBrowser {
util.OpenBrowser("http://localhost" + listenAddr)
}
log.Fatal(http.ListenAndServe(listenAddr, mux))
}
# Alternatives <small>considered</small>
!!! example "*TODO*"
* explain
* improve and add missing
## SoundCloud
SoundCloud bietet eine sehr einfache [REST API](https://developers.soundcloud.com/docs/api/guide) an welche es möglich macht Apps zu schreiben, die all zu erwartenden Funktionen inklusive der Wiedergabe von Songs auf dem Android target möglich machen.
#### Cons
- Das Registrieren von neuen apps für einen API key ist zur Zeit nicht möglich.
- Es wurde angekündigt die aktuelle API abzuschaffen.
- Es gibt außer Suche, Genres und Playlists nicht viele Möglichkeiten Content zu discovern. ([*mood* wie bei spotify](https://open.spotify.com/genre/mood-page) o.ä. auto generierte Playlisten wären z.B. gut).
- Activity management wird durch die Audiowiedergabe verschwert.
- Da alles auf dem Target läuft fehl das *"ich steuer was in der realen welt fern"* Gefühl.
## KODI
## IGDB
[IGDB](https://www.igdb.com/discover) bietet eine API an welche es ermöglicht Informationen über Spiele zu erfassen. Dazu gehören u.a. Reviews, Franchises und Genres.
Leider bietet die API nicht viel im Bezug auf Medien. Auch bei der Integration ins Praktikum haben wir uns schwer getan spannende Aspekte und *"Angriffswinkel"* fürs Praktikum zu finden.
Weiter ist ein großer Bestandteil der Funktionen hinter einer paywall versteckt.
## IMDB
## Home Automation
## Smart Fridge
## RMV
## Home IO
# About this Project
!!! example "*TODO*"
* everything
* knowledgebase
* context
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="585px" height="477px" version="1.1"><defs><style type="text/css">ul { margin-top: 0px; margin-bottom: 10px } &#xa;ol { margin-top: 0px; margin-bottom: 10px } &#xa;ul { margin-top: 0px; margin-bottom: 10px } &#xa;ol { margin-top: 0px; margin-bottom: 10px } &#xa;ul { margin-top: 0px; margin-bottom: 10px } &#xa;ol { margin-top: 0px; margin-bottom: 10px } &#xa;</style></defs><g transform="translate(0.5,0.5)"><ellipse cx="147" cy="400" rx="7.5" ry="7.5" fill="#cda2be" stroke="none" pointer-events="none"/><rect x="132" y="392" width="30" height="60" fill-opacity="0" fill="#cda2be" stroke="none" pointer-events="none"/><ellipse cx="147" cy="400" rx="7.5" ry="7.5" fill="none" stroke="#000000" pointer-events="none"/><path d="M 147 407 L 147 432" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 132 416 L 162 416" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 147 432 L 132 452" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 147 432 L 162 452" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="146.5" y="470.5">Twitch API</text></g><ellipse cx="366" cy="42" rx="7.5" ry="7.5" fill="#cda2be" stroke="none" pointer-events="none"/><rect x="350.5" y="34.5" width="30" height="60" fill-opacity="0" fill="#cda2be" stroke="none" pointer-events="none"/><ellipse cx="366" cy="42" rx="7.5" ry="7.5" fill="none" stroke="#000000" pointer-events="none"/><path d="M 365.5 49.5 L 365.5 74.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 350.5 58.5 L 380.5 58.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 365.5 74.5 L 350.5 94.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 365.5 74.5 L 380.5 94.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="365" y="113">User</text></g><rect x="0" y="142" width="582" height="228" fill="#7acff5" stroke="#000000" pointer-events="none"/><g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="290.5" y="160.5">Laptop</text></g><rect x="361" y="239" width="155" height="87" fill="#d5e8d4" stroke="#000000" pointer-events="none"/><rect x="361" y="239" width="155" height="87" fill="none" stroke="#000000" pointer-events="none"/><path d="M 501 244 L 511 244" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 511 244 L 511 260" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 501 260 L 511 260" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 501 244 L 501 247" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="498" y="247" width="7" height="4" fill="none" stroke="#000000" pointer-events="none"/><path d="M 501 251 L 501 253" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="498" y="253" width="7" height="4" fill="none" stroke="#000000" pointer-events="none"/><path d="M 501 257 L 501 260" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="12px"><text x="428.5" y="255.5">&lt;&lt;component&gt;&gt;</text><text x="428.5" y="269.5">Website</text></g><rect x="44" y="239" width="155" height="87" fill="#d5e8d4" stroke="#000000" pointer-events="none"/><rect x="44" y="239" width="155" height="87" fill="none" stroke="#000000" pointer-events="none"/><path d="M 184 244 L 194 244" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 194 244 L 194 260" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 184 260 L 194 260" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 184 244 L 184 247" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="181" y="247" width="7" height="4" fill="none" stroke="#000000" pointer-events="none"/><path d="M 184 251 L 184 253" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="181" y="253" width="7" height="4" fill="none" stroke="#000000" pointer-events="none"/><path d="M 184 257 L 184 260" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="12px"><text x="111.5" y="255.5">&lt;&lt;component&gt;&gt;</text><text x="111.5" y="269.5">Backend</text></g><ellipse cx="122" cy="176" rx="10" ry="10" fill="#00ff00" stroke="#000000" pointer-events="none"/><ellipse cx="122" cy="176" rx="10" ry="10" fill="none" stroke="#000000" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="12px"><text x="121" y="204">HTTP API</text></g><ellipse cx="281" cy="283" rx="10" ry="10" fill="#00ff00" stroke="#000000" pointer-events="none"/><ellipse cx="281" cy="283" rx="10" ry="10" fill="none" stroke="#000000" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="12px"><text x="280.5" y="311">Websockets /</text><text x="280.5" y="325">SSE</text></g><path d="M 361 283 L 295.98 283.25" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 281 267.5 C 289.28 267.5 296 274.22 296 282.5 C 296 290.78 289.28 297.5 281 297.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 212.12 283 L 225 283 Q 235 283 245 283 L 271 283" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 200.12 283 L 212.12 277 L 212.12 289 Z" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 122 225.88 L 122 218.94 Q 122 212 122 202 L 122 186" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 122 237.88 L 116 225.88 L 128 225.88 Z" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 122 326 L 122 349 Q 122 359 132 359 L 139.5 359 Q 147 359 147 369 L 147 389.76" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 141 378.88 L 147 390.88 L 153 378.88" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 147 85 L 147 115 Q 147 125 137 125 L 129.5 125 Q 122 125 122.07 135 L 122.25 160.52" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 106.5 175.5 C 106.5 167.22 113.22 160.5 121.5 160.5 C 129.78 160.5 136.5 167.22 136.5 175.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 350.5 64.5 L 226.74 64.5" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 237.62 58.5 L 225.62 64.5 L 237.62 70.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="2" y="0" width="263" height="117" fill="#7acff5" stroke="#000000" pointer-events="none"/><g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="133" y="18.5">Phone</text></g><rect x="69.5" y="44.5" width="155" height="40" fill="#ffce9f" stroke="#000000" pointer-events="none"/><rect x="69.5" y="44.5" width="155" height="40" fill="none" stroke="#000000" pointer-events="none"/><path d="M 209.5 49.5 L 219.5 49.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 219.5 49.5 L 219.5 65.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 209.5 65.5 L 219.5 65.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 209.5 49.5 L 209.5 52.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="206.5" y="52.5" width="7" height="4" fill="none" stroke="#000000" pointer-events="none"/><path d="M 209.5 56.5 L 209.5 58.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="206.5" y="58.5" width="7" height="4" fill="none" stroke="#000000" pointer-events="none"/><path d="M 209.5 62.5 L 209.5 65.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="12px"><text x="137" y="61">&lt;&lt;component&gt;&gt;</text><text x="137" y="75">Android App</text></g><path d="M 380.5 65 L 429 65 Q 439 65 439 75 L 439 236.76" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 433 225.88 L 439 237.88 L 445 225.88" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 122 326 L 122 349 Q 122 359 132 359 L 139.5 359 Q 147 359 147 369 L 147 389.76" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 141 378.88 L 147 390.88 L 153 378.88" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 350.5 64.5 L 226.74 64.5" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 237.62 58.5 L 225.62 64.5 L 237.62 70.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 380.5 65 L 429 65 Q 439 65 439 75 L 439 236.76" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 433 225.88 L 439 237.88 L 445 225.88" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 361 283 L 295.98 283.25" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 281 267.5 C 289.28 267.5 296 274.22 296 282.5 C 296 290.78 289.28 297.5 281 297.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 380.5 65 L 429 65 Q 439 65 439 75 L 439 236.76" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 433 225.88 L 439 237.88 L 445 225.88" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 212.12 283 L 225 283 Q 235 283 245 283 L 271 283" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 200.12 283 L 212.12 277 L 212.12 289 Z" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 122 225.88 L 122 218.94 Q 122 212 122 202 L 122 186" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 122 237.88 L 116 225.88 L 128 225.88 Z" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 122 326 L 122 349 Q 122 359 132 359 L 139.5 359 Q 147 359 147 369 L 147 389.76" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 141 378.88 L 147 390.88 L 153 378.88" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 122 225.88 L 122 218.94 Q 122 212 122 202 L 122 186" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 122 237.88 L 116 225.88 L 128 225.88 Z" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 147 85 L 147 115 Q 147 125 137 125 L 129.5 125 Q 122 125 122.07 135 L 122.25 160.52" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 106.5 175.5 C 106.5 167.22 113.22 160.5 121.5 160.5 C 129.78 160.5 136.5 167.22 136.5 175.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 361 283 L 295.98 283.25" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 281 267.5 C 289.28 267.5 296 274.22 296 282.5 C 296 290.78 289.28 297.5 281 297.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 212.12 283 L 225 283 Q 235 283 245 283 L 271 283" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 200.12 283 L 212.12 277 L 212.12 289 Z" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 147 85 L 147 115 Q 147 125 137 125 L 129.5 125 Q 122 125 122.07 135 L 122.25 160.52" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 106.5 175.5 C 106.5 167.22 113.22 160.5 121.5 160.5 C 129.78 160.5 136.5 167.22 136.5 175.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 350.5 64.5 L 226.74 64.5" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 237.62 58.5 L 225.62 64.5 L 237.62 70.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/></g></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="597px" height="477px" version="1.1"><defs><style type="text/css">ul { margin-top: 0px; margin-bottom: 10px } &#xa;ol { margin-top: 0px; margin-bottom: 10px } &#xa;ul { margin-top: 0px; margin-bottom: 10px } &#xa;ol { margin-top: 0px; margin-bottom: 10px } &#xa;ul { margin-top: 0px; margin-bottom: 10px } &#xa;ol { margin-top: 0px; margin-bottom: 10px } &#xa;</style></defs><g transform="translate(0.5,0.5)"><ellipse cx="159" cy="400" rx="7.5" ry="7.5" fill="#cda2be" stroke="none" pointer-events="none"/><rect x="144" y="392" width="30" height="60" fill-opacity="0" fill="#cda2be" stroke="none" pointer-events="none"/><ellipse cx="159" cy="400" rx="7.5" ry="7.5" fill="none" stroke="#000000" pointer-events="none"/><path d="M 159 407 L 159 432" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 144 416 L 174 416" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 159 432 L 144 452" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 159 432 L 174 452" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="158.5" y="470.5">Twitch API</text></g><ellipse cx="378" cy="42" rx="7.5" ry="7.5" fill="#cda2be" stroke="none" pointer-events="none"/><rect x="362.5" y="34.5" width="30" height="60" fill-opacity="0" fill="#cda2be" stroke="none" pointer-events="none"/><ellipse cx="378" cy="42" rx="7.5" ry="7.5" fill="none" stroke="#000000" pointer-events="none"/><path d="M 377.5 49.5 L 377.5 74.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 362.5 58.5 L 392.5 58.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 377.5 74.5 L 362.5 94.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 377.5 74.5 L 392.5 94.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="377" y="113">User</text></g><rect x="317" y="142" width="277" height="228" fill="#7acff5" stroke="#000000" pointer-events="none"/><g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="455" y="160.5">Laptop</text></g><path d="M 107 321.5 L 107 347 Q 107 357 117 357 L 149 357 Q 159 357 159 367 L 159 389.76" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 153 378.88 L 159 390.88 L 165 378.88" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 145 85 L 145 121 Q 145 131 135 131 L 117 131 Q 107 131 107.06 141 L 107.25 171.52" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 91.5 186.5 C 91.5 178.22 98.22 171.5 106.5 171.5 C 114.78 171.5 121.5 178.22 121.5 186.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 362.5 64.5 L 224.74 64.5" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 235.62 58.5 L 223.62 64.5 L 235.62 70.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="0" y="0" width="263" height="117" fill="#7acff5" stroke="#000000" pointer-events="none"/><g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="131" y="18.5">Phone</text></g><rect x="67.5" y="44.5" width="155" height="40" fill="#ffce9f" stroke="#000000" pointer-events="none"/><rect x="67.5" y="44.5" width="155" height="40" fill="none" stroke="#000000" pointer-events="none"/><path d="M 207.5 49.5 L 217.5 49.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 217.5 49.5 L 217.5 65.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 207.5 65.5 L 217.5 65.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 207.5 49.5 L 207.5 52.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="204.5" y="52.5" width="7" height="4" fill="none" stroke="#000000" pointer-events="none"/><path d="M 207.5 56.5 L 207.5 58.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="204.5" y="58.5" width="7" height="4" fill="none" stroke="#000000" pointer-events="none"/><path d="M 207.5 62.5 L 207.5 65.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="12px"><text x="135" y="61">&lt;&lt;component&gt;&gt;</text><text x="135" y="75">Android App</text></g><path d="M 392.5 65 L 441 65 Q 451 65 451 75 L 451 232.26" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 445 221.38 L 451 233.38 L 457 221.38" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="373" y="234.5" width="155" height="87" fill="#d5e8d4" stroke="#000000" pointer-events="none"/><rect x="373" y="234.5" width="155" height="87" fill="none" stroke="#000000" pointer-events="none"/><path d="M 513 239.5 L 523 239.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 523 239.5 L 523 255.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 513 255.5 L 523 255.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 513 239.5 L 513 242.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="510" y="242.5" width="7" height="4" fill="none" stroke="#000000" pointer-events="none"/><path d="M 513 246.5 L 513 248.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="510" y="248.5" width="7" height="4" fill="none" stroke="#000000" pointer-events="none"/><path d="M 513 252.5 L 513 255.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="12px"><text x="440.5" y="251">&lt;&lt;component&gt;&gt;</text><text x="440.5" y="265">Website</text></g><path d="M 373 278 L 247.5 278" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 232.5 263 C 240.78 263 247.5 269.72 247.5 278 C 247.5 286.28 240.78 293 232.5 293" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="0" y="142" width="277" height="228" fill="#7acff5" stroke="#000000" pointer-events="none"/><g fill="#000000" font-family="Helvetica" text-anchor="middle" font-size="12px"><text x="138" y="160.5">Cloud</text></g><rect x="29" y="234.5" width="155" height="87" fill="#d5e8d4" stroke="#000000" pointer-events="none"/><rect x="29" y="234.5" width="155" height="87" fill="none" stroke="#000000" pointer-events="none"/><path d="M 169 239.5 L 179 239.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 179 239.5 L 179 255.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 169 255.5 L 179 255.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 169 239.5 L 169 242.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="166" y="242.5" width="7" height="4" fill="none" stroke="#000000" pointer-events="none"/><path d="M 169 246.5 L 169 248.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><rect x="166" y="248.5" width="7" height="4" fill="none" stroke="#000000" pointer-events="none"/><path d="M 169 252.5 L 169 255.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="12px"><text x="96.5" y="251">&lt;&lt;component&gt;&gt;</text><text x="96.5" y="265">Backend</text></g><ellipse cx="107" cy="187" rx="10" ry="10" fill="#00ff00" stroke="#000000" pointer-events="none"/><ellipse cx="107" cy="187" rx="10" ry="10" fill="none" stroke="#000000" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="12px"><text x="106" y="215">HTTP API</text></g><path d="M 107 221.38 L 107 218.69 Q 107 216 107 206.5 L 107 197" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 107 233.38 L 101 221.38 L 113 221.38 Z" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><ellipse cx="233" cy="278" rx="10" ry="10" fill="#00ff00" stroke="#000000" pointer-events="none"/><ellipse cx="233" cy="278" rx="10" ry="10" fill="none" stroke="#000000" pointer-events="none"/><g fill="#000000" font-family="Helvetica" font-weight="bold" text-anchor="middle" font-size="12px"><text x="232" y="306.5">Websockets /</text><text x="232" y="320.5">SSE</text></g><path d="M 197.12 278 L 223 278" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 185.12 278 L 197.12 272 L 197.12 284 Z" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 107 321.5 L 107 347 Q 107 357 117 357 L 149 357 Q 159 357 159 367 L 159 389.76" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 153 378.88 L 159 390.88 L 165 378.88" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 362.5 64.5 L 224.74 64.5" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 235.62 58.5 L 223.62 64.5 L 235.62 70.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 392.5 65 L 441 65 Q 451 65 451 75 L 451 232.26" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 445 221.38 L 451 233.38 L 457 221.38" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 145 85 L 145 121 Q 145 131 135 131 L 117 131 Q 107 131 107.06 141 L 107.25 171.52" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 91.5 186.5 C 91.5 178.22 98.22 171.5 106.5 171.5 C 114.78 171.5 121.5 178.22 121.5 186.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 362.5 64.5 L 224.74 64.5" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 235.62 58.5 L 223.62 64.5 L 235.62 70.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 392.5 65 L 441 65 Q 451 65 451 75 L 451 232.26" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 445 221.38 L 451 233.38 L 457 221.38" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 373 278 L 247.5 278" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 232.5 263 C 240.78 263 247.5 269.72 247.5 278 C 247.5 286.28 240.78 293 232.5 293" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 107 321.5 L 107 347 Q 107 357 117 357 L 149 357 Q 159 357 159 367 L 159 389.76" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 153 378.88 L 159 390.88 L 165 378.88" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 107 221.38 L 107 218.69 Q 107 216 107 206.5 L 107 197" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 107 233.38 L 101 221.38 L 113 221.38 Z" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 197.12 278 L 223 278" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 185.12 278 L 197.12 272 L 197.12 284 Z" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 145 85 L 145 121 Q 145 131 135 131 L 117 131 Q 107 131 107.06 141 L 107.25 171.52" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 91.5 186.5 C 91.5 178.22 98.22 171.5 106.5 171.5 C 114.78 171.5 121.5 178.22 121.5 186.5" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 107 221.38 L 107 218.69 Q 107 216 107 206.5 L 107 197" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 107 233.38 L 101 221.38 L 113 221.38 Z" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 373 278 L 247.5 278" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 232.5 263 C 240.78 263 247.5 269.72 247.5 278 C 247.5 286.28 240.78 293 232.5 293" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 197.12 278 L 223 278" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-dasharray="5" pointer-events="none"/><path d="M 185.12 278 L 197.12 272 L 197.12 284 Z" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/></g></svg>
\ No newline at end of file
# Stream TV Project
!!! example "*TODO*"
* The documentation is written in mixed german and english. I should decide on one.
* Maybe there should be an icon on each article (left drawer) that specifies if it is important.
* Maybe add dual language for pages that are crucial for the hands-on training
* Also i dont like this page
Stream TV ist ein Projekt was an der [Hochschule Darmstadt](https://h-da.de) für das NZSE (Nutzerzentrierte Softwareentwicklung) Praktikum erstellt wurde. Im Rahmen des Praktikums soll eine Android App entwickelt werden die den hier dokumentierten Stream TV Server fernsteuert. Der Stream TV Server stellt livestreams der popularen streaming seite [Twitch.tv](https://twitch.tv) da.
Das Projekt ist ein direkter Nachfolger des [TV Servers](https://lernen.h-da.de/course/view.php?id=6802) welcher Standbilder diverser Fernsehsender anzeigt.
## Einteilung Dokumentation
- [Project](index.md): Allgemeines und quickstart.
- [Server](server/index.md): Spezifisches über den Server.
- [Remote](remote/index.md): Hilfestellungen für das Programmieren der Android App.
- [About](about/index.md): Meta-dokumentation.
!!! info
Für das Praktikum ist das lesen der kompletten Dokumentation nicht nötig. Vorallem das Kapitel [About](about/index.md) ist vorallem für interne Zwecke gedacht.
\ No newline at end of file
# Project Structure
!!! example "*TODO*"
* wie alles aufgebaut ist: Server, Website, Terminal, Prakikum, Remote, Testpage, emulator.
* worum sich die studenten nicht kümmern müssen
* die dokumentation ist viel weiterreichend als (für die studis) notwendig
The following System Design doesn't fit here and is just a plain copy paste from the old wiki.
### System Proposal with a local backend (comparable to the existing TV Server).
- *App* connects via IP address to the *Backend*.
- *App* requests content via *Backend*.
- *App* controls *Website* via *Backend*.
- *Backend* requests content from the Twitch API and simplifies the response for the *App*.
- *Backend* forwards controls from the *App* to the *Website*.
- *Website* displays Twitch stream(s).
![SystemProposal1.svg](/assets/SystemProposal1.svg)
### System Proposal with no local backend. The backend is then provided by us in the cloud / fbi-network for everybody.
This is similar to the other proposal, but this time only a single backend exists and is shared between all the users. To differentiate between different users – tokens need to be used.
- *App* connects via a public hostname to the *Backend* and specifies a token to identify the website instance it wants to control.
- *App* requests content via *Backend*.
- *App* controls *Website* via *Backend*.
- *Backend* requests content from the Twitch API and simplifies the response for the *App*.
- *Backend* forwards controls from the *App* to the *Website*.
- *Website* displays Twitch stream(s).
![SystemProposal2.svg](/assets/SystemProposal2.svg)
\ No newline at end of file
# Quickstart
!!! example "*TODO*"
* simple super fast quickstart
* download, run, test page, android???
# Twitch
!!! example "*TODO*"
* about twitch
\ No newline at end of file
# Remote
!!! example "*TODO*"
* idk what to put here
The following needs to be somewhere but idk where at the moment. Maybe in the Server doc. Maybe here.
## Games
### Game Data Structure
```json
{
"name": "League of Legends",
"viewers": 123456,
"box_img_url": "https://static-cdn.jtvnw.net/ttv-boxart/League%20of%20Legends-272x380.jpg",
"logo_img_url": "https://static-cdn.jtvnw.net/ttv-logoart/League%20of%20Legends-240x144.jpg"
}
```
### Top Games
Gets games sorted by number of current viewers on Twitch, most popular first.
returns `list(Game)`
### Search Games
Searches for games by name. A game is returned if the query parameter is matched entirely or partially, in the game name.
#### filter by
- `query` e.g. `over` will find *"Overwatch"*, *"Overcooked! 2"*, etc.
returns `list(Game)`
## Streams
### Stream Data Structure
```json
{
"average_fps": 60,
"started_at": "2019-06-21T08:45:54Z",
"game": "Hearthstone",
"preview_img_url": "https://static-cdn.jtvnw.net/previews-ttv/live_user_playhearthstone-640x360.jpg",
"video_height": 1080,
"viewers": 8331,
"status": "Hearthstone Grandmasters Asia-Pacific - Week 5 Day 1 | Staz vs che0nsu",
"language": "en",
"mature": false,
"channel_name": "playhearthstone",
"channel_display_name": "PlayHearthstone",
"channel_logo_img_url": "https://static-cdn.jtvnw.net/jtv_user_pictures/9c71609c-26ce-4bde-986f-567e202e0dbc-profile_image-300x300.jpeg"
}
```
### Top Streams
Gets streams sorted by number of current viewers on Twitch, most popular first.
#### filter by
- `channels` - Constrains the channel(s) of the streams returned. (max 100 per request)
- `game` - Constraint by game e.g. `Overwatch`
- `language` - Constraint by language e.g. `de`
returns `list(Stream)`
### Featured Streams
Gets a list of all featured live streams. (Featured streams are shown on the front page)
returns `list(Stream)`
# Author's notes
!!! example "*TODO*"
* This could be moved to about
\ No newline at end of file
# Contributing
!!! example "*TODO: talk about*"
* gitlab
* issues
* pull requests
* code quality
* tests
* gitlab CI
* recommended dev environment
\ No newline at end of file
# Stream TV Server
!!! example "*TODO*"
* this is a lot of content making it feel convoluted
## Download
OS | CPU Platform | Download
--- | --- | ---
Windows | x86 (64-bit) | [stream-tv-server-windows-x86_64.exe](https://code.fbi.h-da.de/simons-nzse-2/stream-tv-server/-/jobs/artifacts/master/raw/stream-tv-server-windows-x86_64.exe?job=build)
&nbsp;| x86 (32-bit) | [stream-tv-server-windows-x86.exe](https://code.fbi.h-da.de/simons-nzse-2/stream-tv-server/-/jobs/artifacts/master/raw/stream-tv-server-windows-x86.exe?job=build)
Linux | x86 (64-bit) | [stream-tv-server-linux-x86_64](https://code.fbi.h-da.de/simons-nzse-2/stream-tv-server/-/jobs/artifacts/master/raw/stream-tv-server-linux-x86_64?job=build)
&nbsp;| x86 (32-bit) | [stream-tv-server-linux-x86](https://code.fbi.h-da.de/simons-nzse-2/stream-tv-server/-/jobs/artifacts/master/raw/stream-tv-server-linux-x86?job=build)
&nbsp;| ARM (64-bit) | [stream-tv-server-linux-arm64](https://code.fbi.h-da.de/simons-nzse-2/stream-tv-server/-/jobs/artifacts/master/raw/stream-tv-server-linux-arm64?job=build)
&nbsp;| ARM (32-bit) | [stream-tv-server-linux-arm32](https://code.fbi.h-da.de/simons-nzse-2/stream-tv-server/-/jobs/artifacts/master/raw/stream-tv-server-linux-arm32?job=build)
Darwin (macOS) | x86 (64-bit) | [stream-tv-server-darwin-x86_64](https://code.fbi.h-da.de/simons-nzse-2/stream-tv-server/-/jobs/artifacts/master/raw/stream-tv-server-darwin-x86_64?job=build)
&nbsp;| x86 (32-bit) | [stream-tv-server-linux-x86](https://code.fbi.h-da.de/simons-nzse-2/stream-tv-server/-/jobs/artifacts/master/raw/stream-tv-server-darwin-x86?job=build)
!!! tip
In the following documentation the specific executable e.g. `stream-tv-server-windows-x86_64.exe` is always referenced as `stream-tv-server`.
For simplicity sake you should also rename your executable to `stream-tv-server` or `stream-tv-server.exe` (on Windows).
??? expert info
If you do not wish to use a precompiled executable you can [compile and / or develop on your machine.](contributing.md).
## Run
### Windows
1. Just double-click the exe or run it in a cmd or PowerShell `.\stream-tv-server`.
2. *Optional:* provide [command-line options](options.md) e.g. `.\stream-tv-server --open-browser :9090`
!!! warning
If you get [this](/assets/windows-protected-your-pc.png) *"Windows proteced your PC"* warning press <kbd>More info</kbd> and <kbd>Run anyway</kbd>.
### Linux
1. Assign the file execute permission in a terminal: `chmod +x stream-tv-server`.
2. Run it in a terminal `./stream-tv-server`.
3. *Optional:* provide [command-line options](options.md) e.g. `./stream-tv-server --open-browser :9090`
### Darwin (macOS) <small>in the Terminal</small>
1. Assign the file execute permission in a terminal: `chmod +x stream-tv-server`.
2. Run it from the terminal `./stream-tv-server`.
3. *Optional:* Provide [command-line options](options.md) e.g. `./stream-tv-server --open-browser :9090`
### Darwin (macOS) <small>from the GUI</small>
1. Assign the file execute permission in a terminal: `chmod +x stream-tv-server`.
!!! important
This is important as otherwise macOS will try to edit the file in TextEdit when you open it.
2. In Finder right click the file and <kbd>Open</kbd>.
3. Confirm the dialog again with <kbd>Open</kbd>.
!!! info
After the first launch the file can just be double-clicked.
Read more: [Open an app from an unidentified developer](https://help.apple.com/machelp/mac/10.12/index.html?localePath=en.lproj#/mh40616).
## Common Errors
```
listen tcp :80: bind: permission denied
```
: The port range below 1024 is restricted on \*nix systems to superusers ([more info](https://unix.stackexchange.com/a/16568)).
Either run as superuser `sudo ./stream-tv-server` or change the port via the [command-line options](options.md).
```
listen tcp :80: bind: address already in use
```
: Something is already using the port 80. This could be another Stream TV Server instance or some other application (like a webserver).
Close / disable the other application or change the port via the [command-line options](options.md).
## Testing
The quickest way to get familiar with the functionality is to check out the [Remote Test Page](../remote/testpage.md).
\ No newline at end of file
# License
!!! example "*TODO*"
We should really have a license but idk if MIT is the right one and who actually has copyright here (and who should)
**MIT License**
<!-- Copyright &copy; 2019 Simon Kirsten -->
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment