Add image 'stream-playout'

This commit is contained in:
Luca 2020-09-20 01:09:20 +02:00
parent 7d8e5fd78a
commit 343b3c7ff5
8 changed files with 4270 additions and 0 deletions

116
stream-playout/.gitignore vendored Normal file
View File

@ -0,0 +1,116 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

13
stream-playout/Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM node:current-alpine AS builder
COPY package.json package-lock.json webpack.config.js /build/
COPY index.html /build/dist/
COPY src /build/src/
WORKDIR /build
RUN npm install && npm run build
FROM nginx:stable-alpine
COPY --from=builder /build/dist /usr/share/nginx/html/

14
stream-playout/Makefile Normal file
View File

@ -0,0 +1,14 @@
DOCKER = docker
image = stream-playout
tag = stable-alpine
.PHONY: all clean $(image)
all: $(image)
clean:
$(DOCKER) image rm $(image):$(tag)
$(image): Dockerfile package.json
$(DOCKER) build -t $(image):$(tag) .

14
stream-playout/index.html Normal file
View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Stream playout</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<video class="video-js" data-setup='{}'>
<source src="hls/stream.m3u8" type="application/x-mpegURL" />
</video>
<script src="main.js"></script>
</body>
</html>

4058
stream-playout/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
{
"name": "stream-playout",
"version": "1.0.0",
"description": "Playout website for live streams",
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack"
},
"keywords": [
"livestream",
"videojs"
],
"author": "lujoga",
"license": "AGPL-3.0-or-later",
"devDependencies": {
"css-loader": "^4.3.0",
"mini-css-extract-plugin": "^0.11.2",
"webpack": "^4.44.2",
"webpack-cli": "^3.3.12"
},
"dependencies": {
"video.js": "^7.8.4"
}
}

View File

@ -0,0 +1,2 @@
import videojs from 'video.js';
import 'video.js/dist/video-js.css';

View File

@ -0,0 +1,28 @@
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
module.exports = {
mode: 'production',
plugins: [
new MiniCssExtractPlugin({
filename: '[name].css',
chunkFilename: '[id].css',
}),
],
entry: './src/index.js',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist'),
},
module: {
rules: [
{
test: /\.css$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
],
},
],
},
};